Fix $recipients expansion when used within ${run...}. Bug 3013
[exim.git] / src / src / expand.c
index e0c571ade62cf194490a739e3e25eb5389bbb4ce..259d463a447f55aec1675f9c76403fb90606a245 100644 (file)
@@ -5623,7 +5623,7 @@ while (*s)
       {
       FILE * f;
       const uschar * arg, ** argv;
-      BOOL late_expand = TRUE;
+      unsigned late_expand = TSUC_EXPAND_ARGS | TSUC_ALLOW_TAINTED_ARGS | TSUC_ALLOW_RECIPIENTS;
       uschar * save_value = lookup_value;
       int yesno;
 
@@ -5637,7 +5637,7 @@ while (*s)
 
       while (*s == ',')
        if (Ustrncmp(++s, "preexpand", 9) == 0)
-         { late_expand = FALSE; s += 9; }
+         { late_expand = 0; s += 9; }
        else
          {
          const uschar * t = s;
@@ -5697,7 +5697,6 @@ while (*s)
            late_expand,                /* expand args if not already done */
             0,                          /* not relevant when... */
             NULL,                       /* no transporting address */
-           late_expand,                /* allow tainted args, when expand-after-split */
             US"${run} expansion",       /* for error messages */
             &expand_string_message))    /* where to put error message */
           goto EXPAND_FAILED;