summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony Finch <dot@dot.at>2005-05-23 15:28:37 +0000
committerTony Finch <dot@dot.at>2005-05-23 15:28:37 +0000
commit29aba4183e116b5ca706e5479db7302cf07eaa7a (patch)
treec4836966291eb9b5ec616478f9a095d38f8986b1 /src
parent87ba3f5f78da0d53bfb3bdef9db569c8da241eba (diff)
Add control=fakedefer to go with control=fakereject.
Diffstat (limited to 'src')
-rw-r--r--src/exim_monitor/em_globals.c4
-rw-r--r--src/src/acl.c17
-rw-r--r--src/src/globals.c6
-rw-r--r--src/src/globals.h6
-rw-r--r--src/src/receive.c12
-rw-r--r--src/src/smtp_in.c4
6 files changed, 29 insertions, 20 deletions
diff --git a/src/exim_monitor/em_globals.c b/src/exim_monitor/em_globals.c
index 969d709b9..761e47595 100644
--- a/src/exim_monitor/em_globals.c
+++ b/src/exim_monitor/em_globals.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/exim_monitor/em_globals.c,v 1.6 2005/04/29 11:54:23 tom Exp $ */
+/* $Cambridge: exim/src/exim_monitor/em_globals.c,v 1.7 2005/05/23 15:28:38 fanf2 Exp $ */
/*************************************************
* Exim Monitor *
@@ -145,7 +145,7 @@ int dk_do_verify = 0;
BOOL dont_deliver = FALSE;
#ifdef WITH_CONTENT_SCAN
-BOOL fake_reject = FALSE;
+int fake_response = OK;
#endif
header_line *header_last = NULL;
diff --git a/src/src/acl.c b/src/src/acl.c
index 357abfad3..5ea853521 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/acl.c,v 1.32 2005/05/17 15:00:04 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.33 2005/05/23 15:28:38 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -421,7 +421,7 @@ enum {
#ifdef WITH_CONTENT_SCAN
CONTROL_NO_MBOX_UNSPOOL,
#endif
- CONTROL_FAKEREJECT, CONTROL_NO_MULTILINE };
+ CONTROL_FAKEDEFER, CONTROL_FAKEREJECT, CONTROL_NO_MULTILINE };
/* Bit map vector of which controls are not allowed at certain times. For
each control, there's a bitmap of dis-allowed times. For some, it is easier to
@@ -469,6 +469,11 @@ static unsigned int control_forbids[] = {
#endif
(unsigned int)
+ ~((1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_RCPT)| /* fakedefer */
+ (1<<ACL_WHERE_PREDATA)|(1<<ACL_WHERE_DATA)|
+ (1<<ACL_WHERE_MIME)),
+
+ (unsigned int)
~((1<<ACL_WHERE_MAIL)|(1<<ACL_WHERE_RCPT)| /* fakereject */
(1<<ACL_WHERE_PREDATA)|(1<<ACL_WHERE_DATA)|
(1<<ACL_WHERE_MIME)),
@@ -501,6 +506,7 @@ static control_def controls_list[] = {
#ifdef WITH_CONTENT_SCAN
{ US"no_mbox_unspool", CONTROL_NO_MBOX_UNSPOOL, FALSE},
#endif
+ { US"fakedefer", CONTROL_FAKEDEFER, TRUE},
{ US"fakereject", CONTROL_FAKEREJECT, TRUE},
{ US"submission", CONTROL_SUBMISSION, TRUE}
};
@@ -2101,19 +2107,20 @@ for (; cb != NULL; cb = cb->next)
no_multiline_responses = TRUE;
break;
+ case CONTROL_FAKEDEFER:
case CONTROL_FAKEREJECT:
- fake_reject = TRUE;
+ fake_response = (control_type == CONTROL_FAKEDEFER) ? DEFER : FAIL;
if (*p == '/')
{
uschar *pp = p + 1;
while (*pp != 0) pp++;
- fake_reject_text = expand_string(string_copyn(p+1, pp-p-1));
+ fake_response_text = expand_string(string_copyn(p+1, pp-p-1));
p = pp;
}
else
{
/* Explicitly reset to default string */
- fake_reject_text = US"Your message has been rejected but is being kept for evaluation.\nIf it was a legitimate message, it may still be delivered to the target recipient(s).";
+ fake_response_text = US"Your message has been rejected but is being kept for evaluation.\nIf it was a legitimate message, it may still be delivered to the target recipient(s).";
}
break;
diff --git a/src/src/globals.c b/src/src/globals.c
index b5b889acc..8928e451f 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.c,v 1.24 2005/05/10 10:19:11 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.25 2005/05/23 15:28:38 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -512,8 +512,8 @@ uschar *expand_string_message;
BOOL extract_addresses_remove_arguments = TRUE;
uschar *extra_local_interfaces = NULL;
-BOOL fake_reject = FALSE;
-uschar *fake_reject_text = US"Your message has been rejected but is being kept for evaluation.\nIf it was a legitimate message, it may still be delivered to the target recipient(s).";
+int fake_response = OK;
+uschar *fake_response_text = US"Your message has been rejected but is being kept for evaluation.\nIf it was a legitimate message, it may still be delivered to the target recipient(s).";
int filter_n[FILTER_VARIABLE_COUNT];
BOOL filter_running = FALSE;
int filter_sn[FILTER_VARIABLE_COUNT];
diff --git a/src/src/globals.h b/src/src/globals.h
index d052fbe75..40785173d 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.h,v 1.16 2005/05/10 10:19:11 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.17 2005/05/23 15:28:38 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -309,8 +309,8 @@ extern BOOL expand_string_forcedfail; /* TRUE if failure was "expected" */
extern BOOL extract_addresses_remove_arguments; /* Controls -t behaviour */
extern uschar *extra_local_interfaces; /* Local, non-listen interfaces */
-extern BOOL fake_reject; /* TRUE if fake reject is to be given */
-extern uschar *fake_reject_text; /* Option for the fakereject control statement: can contain user defined message. Default is in globals.c. */
+extern int fake_response; /* Fake FAIL or DEFER response to data */
+extern uschar *fake_response_text; /* User defined message for the above. Default is in globals.c. */
extern int filter_n[FILTER_VARIABLE_COUNT]; /* filter variables */
extern BOOL filter_running; /* TRUE while running a filter */
extern int filter_sn[FILTER_VARIABLE_COUNT]; /* variables set by system filter */
diff --git a/src/src/receive.c b/src/src/receive.c
index 4dc05c604..1092d2b06 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/receive.c,v 1.17 2005/05/17 15:00:04 ph10 Exp $ */
+/* $Cambridge: exim/src/src/receive.c,v 1.18 2005/05/23 15:28:38 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -3477,8 +3477,9 @@ if (smtp_input)
{
if (smtp_reply == NULL)
{
- if (fake_reject)
- smtp_respond(550,TRUE,fake_reject_text);
+ if (fake_response != OK)
+ smtp_respond(fake_response == DEFER ? 450 : 550,
+ TRUE, fake_response_text);
else
smtp_printf("250 OK id=%s\r\n", message_id);
if (host_checking)
@@ -3487,8 +3488,9 @@ if (smtp_input)
}
else if (smtp_reply[0] != 0)
{
- if (fake_reject && (smtp_reply[0] == '2'))
- smtp_respond(550,TRUE,fake_reject_text);
+ if (fake_response != OK && (smtp_reply[0] == '2'))
+ smtp_respond(fake_response == DEFER ? 450 : 550,
+ TRUE, fake_response_text);
else
smtp_printf("%.1024s\r\n", smtp_reply);
}
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 6e62b99e0..dfed7b8f5 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/smtp_in.c,v 1.17 2005/04/27 13:29:32 ph10 Exp $ */
+/* $Cambridge: exim/src/src/smtp_in.c,v 1.18 2005/05/23 15:28:38 fanf2 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -809,7 +809,7 @@ message_size = -1;
acl_warn_headers = NULL;
queue_only_policy = FALSE;
deliver_freeze = FALSE; /* Can be set by ACL */
-fake_reject = FALSE; /* Can be set by ACL */
+fake_response = OK; /* Can be set by ACL */
#ifdef WITH_CONTENT_SCAN
no_mbox_unspool = FALSE; /* Can be set by ACL */
#endif