Gitweb:
http://git.exim.org/exim.git/commitdiff/6b62e89971d1bb83a604b3aab7ef6d61aa0ee81c
Commit: 6b62e89971d1bb83a604b3aab7ef6d61aa0ee81c
Parent: cd6d74aba8468c0bace2b763212edf5ac8bc6446
Author: Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Jul 5 22:52:08 2012 +0100
Committer: Jeremy Harris <jgh146exb@???>
CommitDate: Thu Jul 5 22:52:08 2012 +0100
Delay expansion of smtp transport option "authenticated_sender"
after connection startup, to match documentation - bug 1144.
---
src/src/transports/smtp.c | 46 ++++++++++++++++++++++----------------------
1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 94b8485..f7af921 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -921,29 +921,6 @@ tls_out.peerdn = NULL;
tls_out.sni = NULL;
#endif
-/* If an authenticated_sender override has been specified for this transport
-instance, expand it. If the expansion is forced to fail, and there was already
-an authenticated_sender for this message, the original value will be used.
-Other expansion failures are serious. An empty result is ignored, but there is
-otherwise no check - this feature is expected to be used with LMTP and other
-cases where non-standard addresses (e.g. without domains) might be required. */
-
-if (ob->authenticated_sender != NULL)
- {
- uschar *new = expand_string(ob->authenticated_sender);
- if (new == NULL)
- {
- if (!expand_string_forcedfail)
- {
- uschar *message = string_sprintf("failed to expand "
- "authenticated_sender: %s", expand_string_message);
- set_errno(addrlist, 0, message, DEFER, FALSE);
- return ERROR;
- }
- }
- else if (new[0] != 0) local_authenticated_sender = new;
- }
-
#ifndef SUPPORT_TLS
if (smtps)
{
@@ -1488,6 +1465,29 @@ if (smtp_use_size)
while (*p) p++;
}
+/* If an authenticated_sender override has been specified for this transport
+instance, expand it. If the expansion is forced to fail, and there was already
+an authenticated_sender for this message, the original value will be used.
+Other expansion failures are serious. An empty result is ignored, but there is
+otherwise no check - this feature is expected to be used with LMTP and other
+cases where non-standard addresses (e.g. without domains) might be required. */
+
+if (ob->authenticated_sender != NULL)
+ {
+ uschar *new = expand_string(ob->authenticated_sender);
+ if (new == NULL)
+ {
+ if (!expand_string_forcedfail)
+ {
+ uschar *message = string_sprintf("failed to expand "
+ "authenticated_sender: %s", expand_string_message);
+ set_errno(addrlist, 0, message, DEFER, FALSE);
+ return ERROR;
+ }
+ }
+ else if (new[0] != 0) local_authenticated_sender = new;
+ }
+
/* Add the authenticated sender address if present */
if ((smtp_authenticated || ob->authenticated_sender_force) &&