Auth info from transports must be tracked per-address.
[exim.git] / src / src / transports / smtp.c
index dc24e69389cc401b340308e53c08a5c1a58a3e3f..6c3507609f2671e8c6b66284aecd2635cd67365a 100644 (file)
@@ -1272,6 +1272,7 @@ if (continue_hostname == NULL
   authenticator's client driver is running. */
 
   smtp_authenticated = FALSE;
+  client_authenticator = client_authenticated_id = client_authenticated_sender = NULL;
   require_auth = verify_check_this_host(&(ob->hosts_require_auth), NULL,
     host->name, host->address, NULL);
 
@@ -1349,6 +1350,9 @@ if (continue_hostname == NULL
             {
             case OK:
             smtp_authenticated = TRUE;   /* stops the outer loop */
+           client_authenticator = au->name;
+           if (au->set_client_id != NULL)
+             client_authenticated_id = expand_string(au->set_client_id);
             break;
 
             /* Failure after writing a command */
@@ -1496,6 +1500,7 @@ if ((smtp_authenticated || ob->authenticated_sender_force) &&
   string_format(p, sizeof(buffer) - (p-buffer), " AUTH=%s",
     auth_xtextencode(local_authenticated_sender,
     Ustrlen(local_authenticated_sender)));
+  client_authenticated_sender = string_copy(local_authenticated_sender);
   }
 
 /* From here until we send the DATA command, we can make use of PIPELINING