[exim-cvs] Ensure that recipient is well-defined for expansi…

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] Ensure that recipient is well-defined for expansion-called acl at RCPT-time.
Gitweb: http://git.exim.org/exim.git/commitdiff/05caaeaae58a10357a29082c288dccdcd85e8ee4
Commit:     05caaeaae58a10357a29082c288dccdcd85e8ee4
Parent:     005ac57fce967bf7c31e29cd63199297fcda05df
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Thu Nov 8 00:37:32 2012 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Nov 8 01:00:35 2012 +0000


    Ensure that recipient is well-defined for expansion-called acl at RCPT-time.
---
 src/src/acl.c       |   16 ++++++----------
 src/src/expand.c    |    2 +-
 src/src/functions.h |    2 +-
 test/confs/0027     |    1 +
 4 files changed, 9 insertions(+), 12 deletions(-)


diff --git a/src/src/acl.c b/src/src/acl.c
index c1eebf6..a862277 100644
--- a/src/src/acl.c
+++ b/src/src/acl.c
@@ -4008,8 +4008,7 @@ return search_find_defer?DEFER:ERROR;

 /* Alternate interface for ACL, used by expansions */
 int
-acl_eval(int where, uschar *recipient, uschar *s, uschar **user_msgptr,
-  uschar **log_msgptr)
+acl_eval(int where, uschar *s, uschar **user_msgptr, uschar **log_msgptr)
 {
 int rc;
 address_item adb;
@@ -4024,14 +4023,11 @@ if (where == ACL_WHERE_RCPT)
   {
   adb = address_defaults;
   addr = &adb;
-  addr->address = recipient;
-  if (deliver_split_address(addr) == DEFER)
-    {
-    *log_msgptr = US"defer in percent_hack_domains check";
-    return DEFER;
-    }
-  deliver_domain = addr->domain;
-  deliver_localpart = addr->local_part;
+  addr->address = expand_string(US"$local_part@$domain");
+  addr->domain = deliver_domain;
+  addr->local_part = deliver_localpart;
+  addr->cc_local_part = deliver_localpart;
+  addr->lc_local_part = deliver_localpart;
   }


 return acl_check_internal(where, addr, s, 0, user_msgptr, log_msgptr);
diff --git a/src/src/expand.c b/src/src/expand.c
index 786d427..9fc00cf 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1891,7 +1891,7 @@ DEBUG(D_expand)
     acl_narg>0 ? sub[1]   : US"<none>",
     acl_narg>1 ? " +more" : "");


-ret = acl_eval(acl_where, NULL, sub[0], user_msgp, &tmp);
+ret = acl_eval(acl_where, sub[0], user_msgp, &tmp);

 for (i = 0; i < nsub; i++)
   acl_arg[i] = sub[i+1];    /* restore old args */
diff --git a/src/src/functions.h b/src/src/functions.h
index d6f4f68..174db07 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -49,7 +49,7 @@ extern BOOL    tls_openssl_options_parse(uschar *, long *);


 extern acl_block *acl_read(uschar *(*)(void), uschar **);
 extern int     acl_check(int, uschar *, uschar *, uschar **, uschar **);
-extern int     acl_eval(int, uschar *, uschar *, uschar **, uschar **);
+extern int     acl_eval(int, uschar *, uschar **, uschar **);


 extern tree_node *acl_var_create(uschar *);
 extern void    acl_var_write(uschar *, uschar *, void *);
diff --git a/test/confs/0027 b/test/confs/0027
index 75ccf4a..8fe398b 100644
--- a/test/confs/0027
+++ b/test/confs/0027
@@ -42,6 +42,7 @@ data3:
   accept local_parts = a.b.c


 acl_rcpt:
+  warn     set acl_m_1 = ${acl {data}}
   accept endpass
          acl = ${tr{$local_part}{:}{\n}}
   deny   message = this message should not occur