summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2019-07-09 22:43:18 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2019-07-09 23:38:20 +0100
commit17ccbda62e05f6ed59a27791643be4b94f7fcdbd (patch)
tree846dcd265f61f66f734f20c94e9ab70d341483a8 /src
parentfa7b17bdbc8c055c475a50791627cd75d257f4f3 (diff)
Expansions: acl expansion error detail
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c12
-rw-r--r--src/src/globals.h1
2 files changed, 9 insertions, 4 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index 74267ab0c..b3be83a46 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -2517,8 +2517,9 @@ switch(cond_type)
if (yield != NULL)
{
+ int rc;
*resetok = FALSE; /* eval_acl() might allocate; do not reclaim */
- switch(eval_acl(sub, nelem(sub), &user_msg))
+ switch(rc = eval_acl(sub, nelem(sub), &user_msg))
{
case OK:
cond = TRUE;
@@ -2533,7 +2534,8 @@ switch(cond_type)
f.expand_string_forcedfail = TRUE;
/*FALLTHROUGH*/
default:
- expand_string_message = string_sprintf("error from acl \"%s\"", sub[0]);
+ expand_string_message = string_sprintf("%s from acl \"%s\"",
+ rc_names[rc], sub[0]);
return NULL;
}
}
@@ -4250,6 +4252,7 @@ while (*s != 0)
{
uschar *sub[10]; /* name + arg1-arg9 (which must match number of acl_arg[]) */
uschar *user_msg;
+ int rc;
switch(read_subs(sub, nelem(sub), 1, &s, skipping, TRUE, US"acl",
&resetok))
@@ -4261,7 +4264,7 @@ while (*s != 0)
if (skipping) continue;
resetok = FALSE;
- switch(eval_acl(sub, nelem(sub), &user_msg))
+ switch(rc = eval_acl(sub, nelem(sub), &user_msg))
{
case OK:
case FAIL:
@@ -4275,7 +4278,8 @@ while (*s != 0)
f.expand_string_forcedfail = TRUE;
/*FALLTHROUGH*/
default:
- expand_string_message = string_sprintf("error from acl \"%s\"", sub[0]);
+ expand_string_message = string_sprintf("%s from acl \"%s\"",
+ rc_names[rc], sub[0]);
goto EXPAND_FAILED;
}
}
diff --git a/src/src/globals.h b/src/src/globals.h
index 18aaad918..80e1764a3 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -801,6 +801,7 @@ extern uschar *raw_active_hostname; /* Pre-expansion */
extern uschar *raw_sender; /* Before rewriting */
extern uschar **raw_recipients; /* Before rewriting */
extern int raw_recipients_count;
+extern const uschar * rc_names[]; /* Mostly for debug output */
extern int rcpt_count; /* Count of RCPT commands in a message */
extern int rcpt_fail_count; /* Those that got 5xx */
extern int rcpt_defer_count; /* Those that got 4xx */