use plural form (dkim_signers)
[users/jgh/exim.git] / src / src / acl.c
index 5eeabe8b83c802aa49c45f00b28bc86ef1bd1d41..f27471233cd934be066d136ee3a7a9040966a384 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/acl.c,v 1.82.2.1 2009/02/24 15:57:55 tom Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.82.2.6 2009/06/09 18:42:19 tom Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -64,6 +64,10 @@ enum { ACLC_ACL,
        ACLC_DELAY,
 #ifdef WITH_OLD_DEMIME
        ACLC_DEMIME,
+#endif
+#ifndef DISABLE_DKIM
+       ACLC_DKIM_SIGNER,
+       ACLC_DKIM_STATUS,
 #endif
        ACLC_DNSLISTS,
        ACLC_DOMAINS,
@@ -122,6 +126,10 @@ static uschar *conditions[] = {
   US"delay",
 #ifdef WITH_OLD_DEMIME
   US"demime",
+#endif
+#ifndef DISABLE_DKIM
+  US"dkim_signers",
+  US"dkim_status",
 #endif
   US"dnslists",
   US"domains",
@@ -197,7 +205,7 @@ static uschar *controls[] = {
   US"bmi_run",
   #endif
   #ifndef DISABLE_DKIM
-  US"dkim_verify",
+  US"dkim_disable_verify",
   #endif
   US"error",
   US"caseful_local_part",
@@ -242,6 +250,10 @@ static uschar cond_expand_at_top[] = {
   TRUE,    /* delay */
 #ifdef WITH_OLD_DEMIME
   TRUE,    /* demime */
+#endif
+#ifndef DISABLE_DKIM
+  TRUE,    /* dkim_signers */
+  TRUE,    /* dkim_status */
 #endif
   TRUE,    /* dnslists */
   FALSE,   /* domains */
@@ -298,6 +310,10 @@ static uschar cond_modifiers[] = {
   TRUE,    /* delay */
 #ifdef WITH_OLD_DEMIME
   FALSE,   /* demime */
+#endif
+#ifndef DISABLE_DKIM
+  FALSE,   /* dkim_signers */
+  FALSE,   /* dkim_status */
 #endif
   FALSE,   /* dnslists */
   FALSE,   /* domains */
@@ -388,6 +404,14 @@ static unsigned int cond_forbids[] = {
   ~((1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)),   /* demime */
   #endif
 
+  #ifndef DISABLE_DKIM
+  (unsigned int)
+  ~(1<<ACL_WHERE_DKIM),                            /* dkim_signers */
+
+  (unsigned int)
+  ~(1<<ACL_WHERE_DKIM),                            /* dkim_status */
+  #endif
+
   (1<<ACL_WHERE_NOTSMTP)|                          /* dnslists */
     (1<<ACL_WHERE_NOTSMTP_START),
 
@@ -493,7 +517,7 @@ static unsigned int control_forbids[] = {
   #endif
 
   #ifndef DISABLE_DKIM
-  (1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)|      /* dkim_verify */
+  (1<<ACL_WHERE_DATA)|(1<<ACL_WHERE_NOTSMTP)|      /* dkim_disable_verify */
     (1<<ACL_WHERE_NOTSMTP_START),
   #endif
 
@@ -574,7 +598,7 @@ static control_def controls_list[] = {
   { US"bmi_run",                 CONTROL_BMI_RUN, FALSE },
 #endif
 #ifndef DISABLE_DKIM
-  { US"dkim_verify",             CONTROL_DKIM_VERIFY, FALSE },
+  { US"dkim_disable_verify",     CONTROL_DKIM_VERIFY, FALSE },
 #endif
   { US"caseful_local_part",      CONTROL_CASEFUL_LOCAL_PART, FALSE },
   { US"caselower_local_part",    CONTROL_CASELOWER_LOCAL_PART, FALSE },
@@ -2556,7 +2580,7 @@ for (; cb != NULL; cb = cb->next)
 
       #ifndef DISABLE_DKIM
       case CONTROL_DKIM_VERIFY:
-      dkim_do_verify = 1;
+      dkim_disable_verify = TRUE;
       break;
       #endif
 
@@ -2760,6 +2784,30 @@ for (; cb != NULL; cb = cb->next)
     break;
     #endif
 
+    #ifndef DISABLE_DKIM
+    case ACLC_DKIM_SIGNER:
+    if (dkim_signing_domain != NULL)
+      {
+      rc = match_isinlist(dkim_signing_domain,
+                          &arg,0,NULL,NULL,MCL_STRING,TRUE,NULL);
+      if (rc == FAIL)
+        {
+        rc = match_isinlist(dkim_exim_expand_query(DKIM_IDENTITY),
+                            &arg,0,NULL,NULL,MCL_STRING,TRUE,NULL);
+        }
+      }
+    else
+      {
+       rc = FAIL;
+      }
+    break;
+
+    case ACLC_DKIM_STATUS:
+    rc = match_isinlist(dkim_exim_expand_query(DKIM_VERIFY_STATUS),
+                        &arg,0,NULL,NULL,MCL_STRING,TRUE,NULL);
+    break;
+    #endif
+
     case ACLC_DNSLISTS:
     rc = verify_check_dnsbl(&arg);
     break;