Add optional authenticated_sender info to A= elements of log lines; bug 1314.
[exim.git] / src / src / deliver.c
index c01e4e61b7123f5b4464e0b607f770310026a8d8..af39448c595962488b37a90afad4316008cf287e 100644 (file)
@@ -778,7 +778,11 @@ else
     {
     s = string_append(s, &size, &ptr, 2, US" A=", client_authenticator);
     if (client_authenticated_id)
+      {
       s = string_append(s, &size, &ptr, 2, US":", client_authenticated_id);
+      if (log_extra_selector & LX_smtp_mailauth  &&  client_authenticated_sender)
+        s = string_append(s, &size, &ptr, 2, US":", client_authenticated_sender);
+      }
     }
 
   if ((log_extra_selector & LX_smtp_confirmation) != 0 &&
@@ -2930,6 +2934,9 @@ while (!done)
     case '2':
       client_authenticated_id = (*ptr)? string_copy(ptr) : NULL;
       break;
+    case '3':
+      client_authenticated_sender = (*ptr)? string_copy(ptr) : NULL;
+      break;
     }
     while (*ptr++);
     break;
@@ -4016,6 +4023,13 @@ for (delivery_count = 0; addr_remote != NULL; delivery_count++)
         while(*ptr++);
         (void)write(fd, big_buffer, ptr - big_buffer);
        }
+      if (client_authenticated_sender)
+        {
+        ptr = big_buffer;
+       sprintf(CS big_buffer, "C3%.64s", client_authenticated_sender);
+        while(*ptr++);
+        (void)write(fd, big_buffer, ptr - big_buffer);
+       }
 
       /* Retry information: for most success cases this will be null. */