summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2019-07-11 23:35:20 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2019-07-11 23:35:20 +0100
commit467c84b2115a098caeaf044fcd4d2473f236edb6 (patch)
tree161f4a909ff5f3495fea591690354f818e62434d
parentb4f579d134197249b448cb5d8abf801ba4c729bb (diff)
Router variables: local visibiliity
-rw-r--r--src/src/route.c5
-rw-r--r--test/confs/06206
-rw-r--r--test/mail/0620.b6
3 files changed, 12 insertions, 5 deletions
diff --git a/src/src/route.c b/src/src/route.c
index 0817a4eda..416effd41 100644
--- a/src/src/route.c
+++ b/src/src/route.c
@@ -1436,6 +1436,8 @@ for (uschar * ele; (ele = string_nextinlist(&varlist, &sep, NULL, 0)); )
return FAIL;
name += 2;
+ while (isspace(*assignment)) assignment++;
+
if (!(val = expand_string(US assignment)))
if (f.expand_string_forcedfail)
{
@@ -1475,6 +1477,9 @@ for (uschar * ele; (ele = string_nextinlist(&varlist, &sep, NULL, 0)); )
}
node->data.ptr = US val;
DEBUG(D_route) debug_printf("set r_%s = '%s'\n", name, val);
+
+ /* All expansions after this point need visibility of that variable */
+ router_var = *root;
}
return OK;
}
diff --git a/test/confs/0620 b/test/confs/0620
index 61f577417..15e31f1c5 100644
--- a/test/confs/0620
+++ b/test/confs/0620
@@ -23,7 +23,9 @@ alias:
driver = redirect
debug_print = DEBUG: $r_r1 $r_r2
data = b
- set = <; r_r1 = $local_part aaa:bbb bar=baz
+ set = <; r_r1 = <$local_part> aaa:bbb bar=baz
+ set = r_local = check
+ errors_to = bad_$r_local
user:
driver = accept
@@ -43,7 +45,7 @@ local_delivery:
file = DIR/test-mail/$local_part
user = CALLER
debug_print = DEBUG: $r_r1 $r_r2
- headers_add = X-r1: $r_r1\nX-r2: $r_r2
+ headers_add = X-r1: <$r_r1>\nX-r2: <$r_r2>
# End
diff --git a/test/mail/0620.b b/test/mail/0620.b
index a30deb558..5840bc90a 100644
--- a/test/mail/0620.b
+++ b/test/mail/0620.b
@@ -1,4 +1,4 @@
-From CALLER@test.ex Tue Mar 02 09:44:33 1999
+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>)
@@ -7,7 +7,7 @@ Received: from CALLER by the.local.host.name with local (Exim x.yz)
Message-Id: <E10HmaX-0005vi-00@the.local.host.name>
From: CALLER_NAME <CALLER@test.ex>
Date: Tue, 2 Mar 1999 09:44:33 +0000
-X-r1: b
-X-r2: b 2a00:1940:100::ff:0:1 foo=bar
+X-r1: <b>
+X-r2: <b 2a00:1940:100::ff:0:1 foo=bar>