summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2012-11-08 00:37:32 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2012-11-08 01:00:35 +0000
commit05caaeaae58a10357a29082c288dccdcd85e8ee4 (patch)
treeeac56d1af7a2e914b3e9d7d8caa81f0558993036
parent005ac57fce967bf7c31e29cd63199297fcda05df (diff)
Ensure that recipient is well-defined for expansion-called acl at RCPT-time.
-rw-r--r--src/src/acl.c16
-rw-r--r--src/src/expand.c2
-rw-r--r--src/src/functions.h2
-rw-r--r--test/confs/00271
4 files changed, 9 insertions, 12 deletions
diff --git a/src/src/acl.c b/src/src/acl.c
index c1eebf655..a862277a5 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 786d4279c..9fc00cf41 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 d6f4f68fd..174db07eb 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 75ccf4ae6..8fe398b47 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