diff options
author | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2021-04-19 22:23:14 +0200 |
---|---|---|
committer | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2021-05-27 21:31:00 +0200 |
commit | 84227d174eec333d01ff494695bea0febf11575e (patch) | |
tree | 9811b0cd1ee57e97e75b336d5577dcd4577bd016 /src | |
parent | 9370c62082c6596c3eaf5dcf6c0b29cf002bd321 (diff) |
Honour the outcome of parse_extract_address(), testsuite 471
(cherry picked from commit 39d83bf19fc0c4364e0a665360b14194c62e4ab4)
Diffstat (limited to 'src')
-rw-r--r-- | src/src/exim.c | 9 | ||||
-rw-r--r-- | src/src/receive.c | 9 | ||||
-rw-r--r-- | src/src/rewrite.c | 14 |
3 files changed, 22 insertions, 10 deletions
diff --git a/src/src/exim.c b/src/src/exim.c index a5f0bd578..6a9a1477f 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -5593,11 +5593,12 @@ while (more) parse_extract_address(s, &errmess, &start, &end, &domain, FALSE); #ifdef SUPPORT_I18N - if (string_is_utf8(recipient)) - message_smtputf8 = TRUE; - else - allow_utf8_domains = b; + if (recipient) + if (string_is_utf8(recipient)) message_smtputf8 = TRUE; + else allow_utf8_domains = b; } +#else + ; #endif if (domain == 0 && !f.allow_unqualified_recipient) { diff --git a/src/src/receive.c b/src/src/receive.c index 750744016..2223d4645 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -2561,11 +2561,12 @@ if (extract_recip) &domain, FALSE); #ifdef SUPPORT_I18N - if (string_is_utf8(recipient)) - message_smtputf8 = TRUE; - else - allow_utf8_domains = b; + if (recipient) + if (string_is_utf8(recipient)) message_smtputf8 = TRUE; + else allow_utf8_domains = b; } +#else + ; #endif /* Keep a list of all the bad addresses so we can send a single diff --git a/src/src/rewrite.c b/src/src/rewrite.c index ab5f78020..f40c73c51 100644 --- a/src/src/rewrite.c +++ b/src/src/rewrite.c @@ -468,8 +468,9 @@ while (*s) { uschar *sprev; uschar *ss = parse_find_address_end(s, FALSE); - uschar *recipient, *new, *errmess; + uschar *recipient, *new; rmark loop_reset_point = store_mark(); + uschar *errmess = NULL; BOOL changed = FALSE; int terminator = *ss; int start, end, domain; @@ -486,10 +487,19 @@ while (*s) while (isspace(*s)) s++; /* There isn't much we can do for syntactic disasters at this stage. - Pro tem (possibly for ever) ignore them. */ + Pro tem (possibly for ever) ignore them. + If we got nothing, they there was any sort of error: non-parsable address, + empty address, overlong addres. Sometimes the result matters, sometimes not. + It seems this function is called for *any* header we see. */ + if (!recipient) { + if (rewrite_rules || routed_old) + { + log_write(0, LOG_MAIN, "rewrite: %s", errmess); + exim_exit(EXIT_FAILURE); + } loop_reset_point = store_reset(loop_reset_point); continue; } |