From: Tony Finch Date: Mon, 23 May 2005 15:28:37 +0000 (+0000) Subject: Add control=fakedefer to go with control=fakereject. X-Git-Tag: exim-4_52~92 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/29aba4183e116b5ca706e5479db7302cf07eaa7a?hp=87ba3f5f78da0d53bfb3bdef9db569c8da241eba Add control=fakedefer to go with control=fakereject. --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 368734a9b..e2baa6130 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.139 2005/05/17 15:00:04 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.140 2005/05/23 15:28:37 fanf2 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -33,6 +33,8 @@ PH/04 Installed a modified version of Tony Finch's patch to make submission add a /name= option so that you can make the user's friendly name appear in the header line. +TF/03 Added the control = fakedefer ACL modifier. + Exim version 4.51 ----------------- diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index 24993b5ac..d7bdff1e1 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/NewStuff,v 1.42 2005/05/17 15:00:04 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/NewStuff,v 1.43 2005/05/23 15:28:37 fanf2 Exp $ New Features in Exim -------------------- @@ -90,6 +90,13 @@ PH/02 There have been two changes concerned with submission mode: (b) The envelope sender address is forced to be the same as the submission mode sender address. +TF/02 The control = fakereject ACL modifier now has a fakedefer counterpart, + which works in exactly the same way except it causes a fake SMTP 450 + response after the message data instead of a fake SMTP 550 response. + You must take care when using fakedefer because it will cause messages + to be duplicated when the sender retries. Therefore you should not use + fakedefer if the message will be delivered normally. + Version 4.51 ------------ 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 @@ -468,6 +468,11 @@ static unsigned int control_forbids[] = { (1<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