git://git.exim.org
/
exim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa7b17b
)
Expansions: acl expansion error detail
author
Jeremy Harris
<jgh146exb@wizmail.org>
Tue, 9 Jul 2019 21:43:18 +0000
(22:43 +0100)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Tue, 9 Jul 2019 22:38:20 +0000
(23:38 +0100)
src/src/expand.c
patch
|
blob
|
history
src/src/globals.h
patch
|
blob
|
history
test/log/5700
patch
|
blob
|
history
test/paniclog/5700
patch
|
blob
|
history
test/stderr/5700
patch
|
blob
|
history
test/stdout/0002
patch
|
blob
|
history
diff --git
a/src/src/expand.c
b/src/src/expand.c
index 74267ab0cd99dfab64e4df5f81c103cccbec58e7..b3be83a46789dad0bb25e7d9f7aa0c8c83222613 100644
(file)
--- a/
src/src/expand.c
+++ b/
src/src/expand.c
@@
-2517,8
+2517,9
@@
switch(cond_type)
if (yield != NULL)
{
if (yield != NULL)
{
+ int rc;
*resetok = FALSE; /* eval_acl() might allocate; do not reclaim */
*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;
{
case OK:
cond = TRUE;
@@
-2533,7
+2534,8
@@
switch(cond_type)
f.expand_string_forcedfail = TRUE;
/*FALLTHROUGH*/
default:
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;
}
}
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;
{
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))
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;
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:
{
case OK:
case FAIL:
@@
-4275,7
+4278,8
@@
while (*s != 0)
f.expand_string_forcedfail = TRUE;
/*FALLTHROUGH*/
default:
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;
}
}
goto EXPAND_FAILED;
}
}
diff --git
a/src/src/globals.h
b/src/src/globals.h
index 18aaad9184906c64bc75aa2407dbdaafd3c7c5f2..80e1764a36188e59dd5422fd816cc1bf1dd8c0d8 100644
(file)
--- 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 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 */
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 */
diff --git
a/test/log/5700
b/test/log/5700
index fc139b29ad9413b38b272fc3d8b20b828c5cce9a..7f810e438f8a5f423f3c65d1fddbd70cd21a48d0 100644
(file)
--- a/
test/log/5700
+++ b/
test/log/5700
@@
-25,7
+25,7
@@
1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:PORT_S
1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@expansionfail R=others T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:delivery
1999-03-02 09:44:33 10HmaX-0005vi-00 . [127.0.0.1] -> [127.0.0.1]:PORT_S
1999-03-02 09:44:33 10HmaX-0005vi-00 => userx@expansionfail R=others T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK"
1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:delivery
-1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp:
error
from acl "logger"
+1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp:
ERROR
from acl "logger"
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:complete
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 10HmaX-0005vi-00 event msg:complete
diff --git
a/test/paniclog/5700
b/test/paniclog/5700
index 4ed4279a2602922ae94e2c411710364fbb87b874..224bda7d83c0749444a740e36c0a52b5a2853ba7 100644
(file)
--- a/
test/paniclog/5700
+++ b/
test/paniclog/5700
@@
-1,2
+1,2
@@
-1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp:
error
from acl "logger"
+1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp:
ERROR
from acl "logger"
diff --git
a/test/stderr/5700
b/test/stderr/5700
index 4ed4279a2602922ae94e2c411710364fbb87b874..224bda7d83c0749444a740e36c0a52b5a2853ba7 100644
(file)
--- a/
test/stderr/5700
+++ b/
test/stderr/5700
@@
-1,2
+1,2
@@
-1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp:
error
from acl "logger"
+1999-03-02 09:44:33 10HmaX-0005vi-00 failed to expand event_action msg:delivery in smtp:
ERROR
from acl "logger"
diff --git
a/test/stdout/0002
b/test/stdout/0002
index c9337869d8b5669f161d16543f82ad7113ae2cf1..c1f9d379969a502490229819185db1d39d1f0f2e 100644
(file)
--- a/
test/stdout/0002
+++ b/
test/stdout/0002
@@
-138,7
+138,7
@@
>
> Failed: Not enough arguments for 'acl' (min is 1)
> Failed: Not enough arguments for 'acl' (min is 1)
>
> Failed: Not enough arguments for 'acl' (min is 1)
> Failed: Not enough arguments for 'acl' (min is 1)
-> Failed:
error
from acl "a_nosuch"
+> Failed:
ERROR
from acl "a_nosuch"
> acl: (0) [] []
> acl: (1) [person@dom.ain] []
> acl: (2) [firstarg] [secondarg]
> acl: (0) [] []
> acl: (1) [person@dom.ain] []
> acl: (2) [firstarg] [secondarg]
@@
-147,7
+147,7
@@
> acl:
> acl: (0) [] []
> acl: (1) [person@dom.ain] []
> acl:
> acl: (0) [] []
> acl: (1) [person@dom.ain] []
-> Failed:
error
from acl "a_defer"
+> Failed:
DEFER
from acl "a_defer"
> acl: (2) [new arg1] [top_arg_1]
> acl: (1) [1] [] (1) [2] [] (1) [3] [] (1) [4] []
>
> acl: (2) [new arg1] [top_arg_1]
> acl: (1) [1] [] (1) [2] [] (1) [3] [] (1) [4] []
>
@@
-469,7
+469,7
@@
newline tab\134backslash ~tilde\177DEL\200\201.
> acl if: Y:(0) [] []
> acl if: Y:(1) [argY] []
> acl if: N:(2) [argN] [arg2]
> acl if: Y:(0) [] []
> acl if: Y:(1) [argY] []
> acl if: N:(2) [argN] [arg2]
-> Failed:
error
from acl "a_defer"
+> Failed:
DEFER
from acl "a_defer"
>
> # Default values for both if strings
>
>
> # Default values for both if strings
>