From: Philip Hazel Date: Tue, 17 May 2005 15:00:04 +0000 (+0000) Subject: Installed a modified version of Tony's submission enhancement patch + X-Git-Tag: exim-4_52~93 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=87ba3f5f78da0d53bfb3bdef9db569c8da241eba;p=exim.git Installed a modified version of Tony's submission enhancement patch + two small bugfixes. --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 9f2f6c4be..368734a9b 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.138 2005/05/17 11:20:32 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.139 2005/05/17 15:00:04 ph10 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -24,6 +24,15 @@ PH/03 The warning log line about a condition test deferring for a "warn" verb occurrence (because it was using the same function as for successful "warn" verbs). This seems wrong, so I have changed it. +TF/02 Two buglets in acl.c which caused Exim to read a few bytes of memory that + it should not have, which might have caused a crash in the right + circumstances, but probably never did. + +PH/04 Installed a modified version of Tony Finch's patch to make submission + mode fix the return path as well as the Sender: header line, and to + add a /name= option so that you can make the user's friendly name appear + in the header line. + Exim version 4.51 ----------------- diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff index a4ac7e5ad..24993b5ac 100644 --- a/doc/doc-txt/NewStuff +++ b/doc/doc-txt/NewStuff @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/NewStuff,v 1.41 2005/05/17 09:53:34 ph10 Exp $ +$Cambridge: exim/doc/doc-txt/NewStuff,v 1.42 2005/05/17 15:00:04 ph10 Exp $ New Features in Exim -------------------- @@ -81,6 +81,15 @@ PH/01 The amount of output produced by the "make" process has been reduced, command reflection in "make". When you ask for the full output, it is given in addition to the the short output. +PH/02 There have been two changes concerned with submission mode: + + (a) A new option, /name=value, makes it possible to supply a user name + to be inserted into any created Sender: header line. Typically, this + would be looked up from $authenticated_id. + + (b) The envelope sender address is forced to be the same as the + submission mode sender address. + Version 4.51 ------------ diff --git a/src/src/acl.c b/src/src/acl.c index 3f5015b85..357abfad3 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/acl.c,v 1.31 2005/05/17 11:20:32 ph10 Exp $ */ +/* $Cambridge: exim/src/src/acl.c,v 1.32 2005/05/17 15:00:04 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -2107,7 +2107,7 @@ for (; cb != NULL; cb = cb->next) { uschar *pp = p + 1; while (*pp != 0) pp++; - fake_reject_text = expand_string(string_copyn(p+1, pp-p)); + fake_reject_text = expand_string(string_copyn(p+1, pp-p-1)); p = pp; } else @@ -2127,6 +2127,7 @@ for (; cb != NULL; cb = cb->next) break; case CONTROL_SUBMISSION: + originator_name = US""; submission_mode = TRUE; while (*p == '/') { @@ -2140,7 +2141,15 @@ for (; cb != NULL; cb = cb->next) { uschar *pp = p + 8; while (*pp != 0 && *pp != '/') pp++; - submission_domain = string_copyn(p+8, pp-p); + submission_domain = string_copyn(p+8, pp-p-8); + p = pp; + } + else if (Ustrncmp(p, "/name=", 6) == 0) + { + uschar *pp = p + 6; + while (*pp != 0 && *pp != '/') pp++; + originator_name = string_copy(parse_fix_phrase(p+6, pp-p-6, + big_buffer, big_buffer_size)); p = pp; } else break; diff --git a/src/src/receive.c b/src/src/receive.c index 58c64f7c8..4dc05c604 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/receive.c,v 1.16 2005/04/27 13:29:32 ph10 Exp $ */ +/* $Cambridge: exim/src/src/receive.c,v 1.17 2005/05/17 15:00:04 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -2341,31 +2341,36 @@ if (from_header == NULL && (sender_host_address == NULL || submission_mode)) if (sender_address[0] == 0) { + uschar *fromstart, *fromend; + + fromstart = string_sprintf("%sFrom: %s%s", resent_prefix, + originator_name, (originator_name[0] == 0)? "" : " <"); + fromend = (originator_name[0] == 0)? US"" : US">"; + if (sender_local || local_error_message) { - header_add(htype_from, "%sFrom: %s%s%s@%s%s\n", resent_prefix, - originator_name, - (originator_name[0] == 0)? "" : " <", - local_part_quote(originator_login), - qualify_domain_sender, - (originator_name[0] == 0)? "" : ">"); + header_add(htype_from, "%s%s@%s%s\n", fromstart, + local_part_quote(originator_login), qualify_domain_sender, + fromend); } else if (submission_mode && authenticated_id != NULL) { if (submission_domain == NULL) { - header_add(htype_from, "%sFrom: %s@%s\n", resent_prefix, - local_part_quote(authenticated_id), qualify_domain_sender); + header_add(htype_from, "%s%s@%s%s\n", fromstart, + local_part_quote(authenticated_id), qualify_domain_sender, + fromend); } else if (submission_domain[0] == 0) /* empty => whole address set */ { - header_add(htype_from, "%sFrom: %s\n", resent_prefix, - authenticated_id); + header_add(htype_from, "%s%s%s\n", fromstart, authenticated_id, + fromend); } else { - header_add(htype_from, "%sFrom: %s@%s\n", resent_prefix, - local_part_quote(authenticated_id), submission_domain); + header_add(htype_from, "%s%s@%s%s\n", fromstart, + local_part_quote(authenticated_id), submission_domain, + fromend); } from_header = header_last; /* To get it checked for Sender: */ } @@ -2377,15 +2382,12 @@ if (from_header == NULL && (sender_host_address == NULL || submission_mode)) else { - if (!smtp_input || sender_local) - header_add(htype_from, "%sFrom: %s%s%s%s\n", - resent_prefix, originator_name, - (originator_name[0] == 0)? "" : " <", - (sender_address_unrewritten == NULL)? - sender_address : sender_address_unrewritten, - (originator_name[0] == 0)? "" : ">"); - else - header_add(htype_from, "%sFrom: %s\n", resent_prefix, sender_address); + header_add(htype_from, "%sFrom: %s%s%s%s\n", resent_prefix, + originator_name, + (originator_name[0] == 0)? "" : " <", + (sender_address_unrewritten == NULL)? + sender_address : sender_address_unrewritten, + (originator_name[0] == 0)? "" : ">"); from_header = header_last; /* To get it checked for Sender: */ } @@ -2466,13 +2468,26 @@ if (from_header != NULL && if (make_sender) { - if (submission_mode) + if (submission_mode && originator_name[0] == 0) header_add(htype_sender, "%sSender: %s\n", resent_prefix, generated_sender_address); else header_add(htype_sender, "%sSender: %s <%s>\n", resent_prefix, originator_name, generated_sender_address); } + + /* Ensure that a non-null envelope sender address corresponds to the + submission mode sender address. */ + + if (submission_mode && sender_address[0] != 0) + { + if (sender_address_unrewritten == NULL) + sender_address_unrewritten = sender_address; + sender_address = generated_sender_address; + log_write(L_address_rewrite, LOG_MAIN, + "\"%s\" from env-from rewritten as \"%s\" by submission mode", + sender_address_unrewritten, generated_sender_address); + } }