summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2012-07-05 22:52:08 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2012-07-05 22:52:08 +0100
commit6b62e89971d1bb83a604b3aab7ef6d61aa0ee81c (patch)
tree100946307317b7c675a358de95c06742e3a7be55
parentcd6d74aba8468c0bace2b763212edf5ac8bc6446 (diff)
Delay expansion of smtp transport option "authenticated_sender"
after connection startup, to match documentation - bug 1144.
-rw-r--r--src/src/transports/smtp.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 94b848540..f7af921af 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) &&