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:
b037dd6
)
Handle expansion fails in router "set" options. Bug 3058
author
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 7 Dec 2023 19:59:35 +0000
(19:59 +0000)
committer
Jeremy Harris
<jgh146exb@wizmail.org>
Thu, 7 Dec 2023 19:59:35 +0000
(19:59 +0000)
doc/doc-docbook/spec.xfpt
patch
|
blob
|
history
doc/doc-txt/ChangeLog
patch
|
blob
|
history
src/src/route.c
patch
|
blob
|
history
test/confs/0606
patch
|
blob
|
history
test/log/0606
patch
|
blob
|
history
test/mail/0606.b
patch
|
blob
|
history
test/scripts/0000-Basic/0606
patch
|
blob
|
history
diff --git
a/doc/doc-docbook/spec.xfpt
b/doc/doc-docbook/spec.xfpt
index dc8f5cc4d0347419fdfed60b57d6d235d24ee8a8..0007d255e97503f6b79524b3c3583f262c73652f 100644
(file)
--- a/
doc/doc-docbook/spec.xfpt
+++ b/
doc/doc-docbook/spec.xfpt
@@
-25918,6
+25918,7
@@
permits this.
.cindex "line length" limit
This option sets the maximum line length, in bytes, that the transport
will send. Any messages with lines exceeding the given value
.cindex "line length" limit
This option sets the maximum line length, in bytes, that the transport
will send. Any messages with lines exceeding the given value
+(before a transport filter, if any)
will fail and a failure-DSN ("bounce") message will if possible be returned
to the sender.
The default value is that defined by the SMTP standards.
will fail and a failure-DSN ("bounce") message will if possible be returned
to the sender.
The default value is that defined by the SMTP standards.
diff --git
a/doc/doc-txt/ChangeLog
b/doc/doc-txt/ChangeLog
index 2d82df43d8010a67794413ad532eb6ead75cab74..85064cc8d8beea1651a86592099f635b49722f12 100644
(file)
--- a/
doc/doc-txt/ChangeLog
+++ b/
doc/doc-txt/ChangeLog
@@
-49,6
+49,10
@@
JH/09 Bug 3057: Add heuristic for spotting mistyped IPv6 addresses in lists
documentation, the error results by default in a no-match result for the
list. It is logged if the unknown_in_list log_selector is used.
documentation, the error results by default in a no-match result for the
list. It is logged if the unknown_in_list log_selector is used.
+JH/10 Bug 3058: Ensure that a failing expansion in a router "set" option defers
+ the routing operation. Previously it would silently stop routing the
+ message.
+
Exim version 4.97
Exim version 4.97
diff --git
a/src/src/route.c
b/src/src/route.c
index 0bd87b83729a841bdaad705caabdadb08836148d..3401f15b415695a1f9bb166a6b8843ea59fcc049 100644
(file)
--- a/
src/src/route.c
+++ b/
src/src/route.c
@@
-1492,7
+1492,11
@@
for (uschar * ele; (ele = string_nextinlist(&varlist, &sep, NULL, 0)); )
{
addr->message = string_sprintf("expansion of \"%s\" failed "
"in %s router: %s", ele, r->name, expand_string_message);
{
addr->message = string_sprintf("expansion of \"%s\" failed "
"in %s router: %s", ele, r->name, expand_string_message);
- return DEFER;
+ /* Caller will replace that for logging, if a DB lookup, to avoid exposing
+ passwords */
+ DEBUG(D_route) debug_printf("%s\n", addr->message);
+ if (!f.search_find_defer)
+ return f.search_find_defer ? DEFER : FAIL;
}
if (!(node = tree_search(*root, name)))
}
if (!(node = tree_search(*root, name)))
@@
-1546,8
+1550,8
@@
route_address(address_item *addr, address_item **paddr_local,
{
int yield = OK;
BOOL unseen;
{
int yield = OK;
BOOL unseen;
-router_instance *
r, *
nextr;
-const uschar *old_domain = addr->domain;
+router_instance *
r, *
nextr;
+const uschar *
old_domain = addr->domain;
HDEBUG(D_route)
{
HDEBUG(D_route)
{
@@
-1561,8
+1565,8
@@
instead of at the first router. */
for (r = addr->start_router ? addr->start_router : routers; r; r = nextr)
{
for (r = addr->start_router ? addr->start_router : routers; r; r = nextr)
{
- uschar *error;
- struct passwd *pw = NULL;
+ uschar *
error;
+ struct passwd *
pw = NULL;
struct passwd pwcopy;
BOOL loop_detected = FALSE;
BOOL more;
struct passwd pwcopy;
BOOL loop_detected = FALSE;
BOOL more;
@@
-1736,11
+1740,11
@@
for (r = addr->start_router ? addr->start_router : routers; r; r = nextr)
router traversal. On the addr string they are held as a variable tree, so
as to maintain the post-expansion taints separate. */
router traversal. On the addr string they are held as a variable tree, so
as to maintain the post-expansion taints separate. */
- switch (set_router_vars(addr, r))
+ switch (
rc =
set_router_vars(addr, r))
{
case OK: break;
case PASS: continue; /* with next router */
{
case OK: break;
case PASS: continue; /* with next router */
- default: goto ROUTE_EXIT;
+ default:
yield = rc;
goto ROUTE_EXIT;
}
/* Finally, expand the address_data field in the router. Forced failure
}
/* Finally, expand the address_data field in the router. Forced failure
diff --git
a/test/confs/0606
b/test/confs/0606
index 6388962dbff3420574d2699795eac944458e0f1e..63aa94897fd62e6fe0bd8c2069522e0ef641ff12 100644
(file)
--- a/
test/confs/0606
+++ b/
test/confs/0606
@@
-19,10
+19,21
@@
not_smtp:
begin routers
begin routers
+dump_bounce:
+ driver = redirect
+ senders = :
+ data = :blackhole:
+
hide_verifies:
driver = accept
verify_only
hide_verifies:
driver = accept
verify_only
+bad:
+ driver = accept
+ local_parts = bad
+ set = r_srs_domain = ${lookup mysql{wrong things
+ transport = local_delivery
+
alias:
driver = redirect
debug_print = DEBUG: $r_r1 $r_r2
alias:
driver = redirect
debug_print = DEBUG: $r_r1 $r_r2
@@
-66,4
+77,8
@@
local_delivery:
headers_add = X-r1: <$r_r1>\nX-r2: <$r_r2>\nX-r3: <$r_r3>
headers_add = X-r1: <$r_r1>\nX-r2: <$r_r2>\nX-r3: <$r_r3>
+# ----- Retry -----
+begin retry
+* * F,5d,10s
+
# End
# End
diff --git
a/test/log/0606
b/test/log/0606
index 58d340f03dcbe22d37f10494e4e1da2141544c5b..718c2d4ffbe5d5580f31ff30e18c5a83155660f3 100644
(file)
--- a/
test/log/0606
+++ b/
test/log/0606
@@
-1,3
+1,7
@@
1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmaX-000000005vi-0000 <= CALLER@test.ex U=CALLER P=local S=sss
+1999-03-02 09:44:33 10HmaX-000000005vi-0000 ** bad@test.ex R=bad: Temporary internal error
1999-03-02 09:44:33 10HmaX-000000005vi-0000 => b <a@test.ex> R=user T=local_delivery
1999-03-02 09:44:33 10HmaX-000000005vi-0000 => b <a@test.ex> R=user T=local_delivery
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 <= <> R=10HmaX-000000005vi-0000 U=EXIMUSER P=local S=sss
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 => :blackhole: <CALLER@test.ex> R=dump_bounce
+1999-03-02 09:44:33 10HmaY-000000005vi-0000 Completed
1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
1999-03-02 09:44:33 10HmaX-000000005vi-0000 Completed
diff --git
a/test/mail/0606.b
b/test/mail/0606.b
index cd41258500f4b19b84a2d1b85eae788898e1b629..5f9ac43a95da107c426453798c8a1eb220a6574d 100644
(file)
--- a/
test/mail/0606.b
+++ b/
test/mail/0606.b
@@
-2,8
+2,7
@@
From bad_check@test.ex Tue Mar 02 09:44:33 1999
Envelope-to: a@test.ex
Received: from CALLER by the.local.host.name with local (Exim x.yz)
(envelope-from <CALLER@test.ex>)
Envelope-to: a@test.ex
Received: from CALLER by the.local.host.name with local (Exim x.yz)
(envelope-from <CALLER@test.ex>)
- id 10HmaX-000000005vi-0000
- for a@test.ex;
+ id 10HmaX-000000005vi-0000;
Tue, 2 Mar 1999 09:44:33 +0000
Subject: foo
Message-Id: <E10HmaX-000000005vi-0000@the.local.host.name>
Tue, 2 Mar 1999 09:44:33 +0000
Subject: foo
Message-Id: <E10HmaX-000000005vi-0000@the.local.host.name>
diff --git
a/test/scripts/0000-Basic/0606
b/test/scripts/0000-Basic/0606
index 96d598834dab457036583759abf77e0a9018167a..5bac064d3df77f0987e54ef1eb529edd3c1256f6 100644
(file)
--- a/
test/scripts/0000-Basic/0606
+++ b/
test/scripts/0000-Basic/0606
@@
-1,5
+1,5
@@
# router variables
# router variables
-exim -odi a
+exim -odi a
bad
Subject: foo
body
Subject: foo
body