ARC: on the smtp transport option take empty or forced-fail to disable signing
authorJeremy Harris <jgh146exb@wizmail.org>
Tue, 20 Mar 2018 19:58:00 +0000 (19:58 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 21 Mar 2018 09:07:00 +0000 (09:07 +0000)
doc/doc-txt/experimental-spec.txt
src/src/transports/smtp.c

index ce140c553f1fdf3948919949cb0c145b1168ff08..149598ee8934b5465983a5271cd9634a65688bb6 100644 (file)
@@ -799,6 +799,7 @@ arc_sign = <admd-identifier> : <selector> : <privkey>
 An option on the smtp transport, which constructs and prepends to the message
 an ARC set of headers.  The textually-first Authentication-Results: header
 is used as a basis (you must have added one on entry to the ADMD).
 An option on the smtp transport, which constructs and prepends to the message
 an ARC set of headers.  The textually-first Authentication-Results: header
 is used as a basis (you must have added one on entry to the ADMD).
+Expanded; if unset, empty or forced-failure then no signing is done.
 
 
 
 
 
 
index c4a6c028350eec39448da697281b1c7a15eb6240..23083f5d879c829a4ed5d7d0ff2a851fa696fb5d 100644 (file)
@@ -2999,15 +2999,21 @@ else
     uschar * s = sx.ob->arc_sign;
     if (s)
       {
     uschar * s = sx.ob->arc_sign;
     if (s)
       {
-      if (!(sx.ob->dkim.arc_signspec = expand_string(s)))
+      if (!(sx.ob->dkim.arc_signspec = s = expand_string(s)))
        {
        {
-       message = US"failed to expand arc_sign";
-       sx.ok = FALSE;
-       goto SEND_FAILED;
+       if (!expand_string_forcedfail)
+         {
+         message = US"failed to expand arc_sign";
+         sx.ok = FALSE;
+         goto SEND_FAILED;
+         }
+       }
+      else if (*s)
+       {
+       /* Ask dkim code to hash the body for ARC */
+       (void) arc_ams_setup_sign_bodyhash();
+       sx.ob->dkim.force_bodyhash = TRUE;
        }
        }
-      /* Ask dkim code to hash the body for ARC */
-      (void) arc_ams_setup_sign_bodyhash();
-      sx.ob->dkim.force_bodyhash = TRUE;
       }
     }
 # endif
       }
     }
 # endif