summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2019-07-15 12:51:42 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2019-07-15 14:14:36 +0100
commitb436dd41913533c013e88c513e2ceab89c86f120 (patch)
tree901b34b08e5bb80df2e4d2d43987f8326e279658 /src
parente41242f9612adaedadd5f3607b202f32ca086b4f (diff)
Router variables: change list-separator to semicolon
Diffstat (limited to 'src')
-rw-r--r--src/src/readconf.c5
-rw-r--r--src/src/route.c56
2 files changed, 13 insertions, 48 deletions
diff --git a/src/src/readconf.c b/src/src/readconf.c
index b9d193554..a7cf03dd3 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -1770,7 +1770,10 @@ switch (type)
}
else if (ol->type & opt_rep_str)
{
- uschar sep_o = Ustrncmp(name, "headers_add", 11)==0 ? '\n' : ':';
+ uschar sep_o =
+ Ustrncmp(name, "headers_add", 11) == 0 ? '\n'
+ : Ustrncmp(name, "set", 3) == 0 ? ';'
+ : ':';
int sep_i = -(int)sep_o;
const uschar * list = sptr;
uschar * s;
diff --git a/src/src/route.c b/src/src/route.c
index 416effd41..b6930493f 100644
--- a/src/src/route.c
+++ b/src/src/route.c
@@ -1416,7 +1416,7 @@ set_router_vars(address_item * addr, const router_instance * r)
{
const uschar * varlist = r->set;
tree_node ** root = (tree_node **) &addr->prop.variables;
-int sep = 0;
+int sep = ';';
if (!varlist) return OK;
@@ -1433,7 +1433,11 @@ for (uschar * ele; (ele = string_nextinlist(&varlist, &sep, NULL, 0)); )
/* Variable name must exist and start "r_". */
if (!name || name[0] != 'r' || name[1] != '_' || !name[2])
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC,
+ "bad router variable name '%s' in router '%s'\n", name, r->name);
return FAIL;
+ }
name += 2;
while (isspace(*assignment)) assignment++;
@@ -1690,54 +1694,12 @@ 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. */
- if ((yield = set_router_vars(addr, r)) != OK)
- if (yield == PASS)
- continue; /* with next router */
- else
- goto ROUTE_EXIT;
-
-#ifdef notdef
- if (r->set)
+ switch (set_router_vars(addr, r))
{
- const uschar * list = r->set;
- int sep = 0;
- for (uschar * ele; (ele = string_nextinlist(&list, &sep, NULL, 0)); )
- {
- uschar * ee;
- if (!(ee = expand_string(ele)))
- if (f.expand_string_forcedfail)
- {
- DEBUG(D_route) debug_printf("forced failure in expansion of \"%s\" "
- "(router variable): decline action taken\n", ele);
-
- /* Expand "more" if necessary; DEFER => an expansion failed */
-
- yield = exp_bool(addr, US"router", r->name, D_route,
- US"more", r->more, r->expand_more, &more);
- if (yield != OK) goto ROUTE_EXIT;
-
- if (!more)
- {
- DEBUG(D_route)
- debug_printf("\"more\"=false: skipping remaining routers\n");
- router_name = NULL;
- r = NULL;
- break;
- }
- else continue; /* With next router */
- }
- else
- {
- addr->message = string_sprintf("expansion of \"%s\" failed "
- "in %s router: %s", ele, r->name, expand_string_message);
- yield = DEFER;
- goto ROUTE_EXIT;
- }
-
- addr->prop.set = string_append_listele(addr->prop.set, ':', ee);
- }
+ case OK: break;
+ case PASS: continue; /* with next router */
+ default: goto ROUTE_EXIT;
}
-#endif
/* Finally, expand the address_data field in the router. Forced failure
behaves as if the router declined. Any other failure is more serious. On