[Exim] [PATCH] Allow drop in nested acls

Page principale
Supprimer ce message
Répondre à ce message
Auteur: William Thompson
Date:  
À: exim-users
Sujet: [Exim] [PATCH] Allow drop in nested acls
As Phillip stated, this was an oversight. I may be the only one wanting to
use it or noone else asked about it.

If you do something like this:

    accept    hosts = /some/hosts
        acl = some_acl


some_acl:
    <condition>
    ...
    drop    senders = somesender


Currently, you get a defer because it doesn't know what to do.

This is a simple patch to fix this. I have not done much testing, but the
test case I used works for me.

My test case:
acl_check_mail:
    accept    hosts = 127.0.0.1
        acl = acl_drop


acl_drop:
    drop    message = $sender_address is not allowed.
        senders = bad@localhost


This is the patch against 4.20 (may work with 4.14).

--- exim-4.20/src/acl.c    Mon May 12 09:39:17 2003
+++ exim4-4.20/src/acl.c    Mon May 19 10:42:26 2003
@@ -1204,7 +1204,7 @@


If there isn't a log message set, we make it the same as the user message. */

-if (rc == msgcond[verb])
+if ((rc == FAIL_DROP ? FAIL : rc) == msgcond[verb])
{
uschar *expmessage;

@@ -1469,6 +1469,7 @@
     break;


     case FAIL:
+    case FAIL_DROP:
     HDEBUG(D_acl) debug_printf("%s: condition test failed\n", verbs[acl->verb]);
     break;
     }
@@ -1483,8 +1484,9 @@
     if (endpass_seen)
       {
       HDEBUG(D_acl) debug_printf("accept: endpass encountered - denying access\n");
-      return FAIL;
+      return cond == FAIL_DROP ? FAIL_DROP : FAIL;
       }
+    if (cond == FAIL_DROP) return FAIL_DROP;
     break;


     case ACL_DEFER: