Document (and enforce) that DKIM-signing is not supported in cobination with cutthrou...
[exim.git] / src / src / verify.c
index ea7869d25df85f93e2d66b2d88cf7100de2073f5..c103f592f278fc495731ea359ee0d4e4ab369246 100644 (file)
@@ -694,13 +694,23 @@ else
 
     done = TRUE; /* so far so good; have response to HELO */
 
-    /*XXX the EHLO response would be analyzed here for IGNOREQUOTA, SIZE, PIPELINING, AUTH */
-    /* If we haven't authenticated, but are required to, give up. */
+    /*XXX the EHLO response would be analyzed here for IGNOREQUOTA, SIZE, PIPELINING */
 
-    /*XXX "filter command specified for this transport" ??? */
-    /* for now, transport_filter by cutthrough-delivery is not supported */
+    /* For now, transport_filter by cutthrough-delivery is not supported */
     /* Need proper integration with the proper transport mechanism. */
-
+    if (cutthrough_delivery)
+      {
+      if (addr->transport->filter_command)
+        {
+        cutthrough_delivery= FALSE;
+        HDEBUG(D_acl|D_v) debug_printf("Cutthrough cancelled by presence of transport filter\n");
+        }
+      if (ob->dkim_domain)
+        {
+        cutthrough_delivery= FALSE;
+        HDEBUG(D_acl|D_v) debug_printf("Cutthrough cancelled by presence of DKIM signing\n");
+        }
+      }
 
     SEND_FAILED:
     RESPONSE_FAILED:
@@ -722,18 +732,27 @@ else
         }
       }
 
+    /* If we haven't authenticated, but are required to, give up. */
     /* Try to AUTH */
 
     else done = smtp_auth(responsebuffer, sizeof(responsebuffer),
        addr, host, ob, esmtp, &inblock, &outblock) == OK  &&
 
+               /* Copy AUTH info for logging */
+      ( (addr->authenticator = client_authenticator),
+        (addr->auth_id = client_authenticated_id),
+
     /* Build a mail-AUTH string (re-using responsebuffer for convenience */
-      !smtp_mail_auth_str(responsebuffer, sizeof(responsebuffer), addr, ob)  &&
+        !smtp_mail_auth_str(responsebuffer, sizeof(responsebuffer), addr, ob)
+      )  &&
+
+      ( (addr->auth_sndr = client_authenticated_sender),
 
     /* Send the MAIL command */
+        (smtp_write_command(&outblock, FALSE, "MAIL FROM:<%s>%s\r\n",
+          from_address, responsebuffer) >= 0)
+      )  &&
 
-      smtp_write_command(&outblock, FALSE, "MAIL FROM:<%s>%s\r\n",
-        from_address, responsebuffer) >= 0 &&
       smtp_read_response(&inblock, responsebuffer, sizeof(responsebuffer),
         '2', callout);