From c5b0340697326238b0e2afd9d341185077d60d35 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 27 Aug 2019 17:44:52 +0100 Subject: Fix ${domain:} for a bare local-part input. Bug 2375 Broken-by: e2ff8e24f4 --- src/src/expand.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/src/expand.c b/src/src/expand.c index 205ac33f0..f38d7a492 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -7206,11 +7206,12 @@ while (*s != 0) uschar * t = parse_extract_address(sub, &error, &start, &end, &domain, FALSE); if (t) - yield = c == EOP_DOMAIN - ? string_cat(yield, t + domain) - : c == EOP_LOCAL_PART && domain > 0 - ? string_catn(yield, t, domain - 1 ) - : string_cat(yield, t); + if (c != EOP_DOMAIN) + yield = c == EOP_LOCAL_PART && domain > 0 + ? string_catn(yield, t, domain - 1) + : string_cat(yield, t); + else if (domain > 0) + yield = string_cat(yield, t + domain); continue; } -- cgit v1.2.3