X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e8f0fc219ceca2834ee2b6a1a1a9b960ead39a2b..3c8b357717e895d6dcddc7faa5b7a0eaf4c73417:/src/src/verify.c diff --git a/src/src/verify.c b/src/src/verify.c index 4e9b563fa..28013fa35 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -173,6 +173,9 @@ dbdata_callout_cache new_domain_record; dbdata_callout_cache_address new_address_record; host_item *host; time_t callout_start_time; +#ifdef EXPERIMENTAL_INTERNATIONAL +BOOL utf8_offered = FALSE; +#endif new_domain_record.result = ccache_unknown; new_domain_record.postmaster_result = ccache_unknown; @@ -921,22 +924,35 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount. } #ifdef EXPERIMENTAL_INTERNATIONAL - else if ( addr->prop.utf8 + else if ( addr->prop.utf8_msg + && !addr->prop.utf8_downcvt && !( esmtp && ( regex_UTF8 || ( (regex_UTF8 = regex_must_compile( US"\\n250[\\s\\-]SMTPUTF8(\\s|\\n|$)", FALSE, TRUE)), TRUE ) ) - && pcre_exec(regex_UTF8, NULL, CS responsebuffer, - Ustrlen(responsebuffer), 0, PCRE_EOPT, NULL, 0) >= 0 - ) ) + && ( (utf8_offered = pcre_exec(regex_UTF8, NULL, + CS responsebuffer, Ustrlen(responsebuffer), + 0, PCRE_EOPT, NULL, 0) >= 0) + || addr->prop.utf8_downcvt_maybe + ) ) ) { HDEBUG(D_acl|D_v) debug_printf("utf8 required but not offered\n"); errno = ERRNO_UTF8_FWD; setflag(addr, af_verify_nsfail); done = FALSE; } + else if ( addr->prop.utf8_msg + && (addr->prop.utf8_downcvt || !utf8_offered) + && (from_address = string_address_utf8_to_alabel(from_address, + &addr->message), addr->message) + ) + { + errno = ERRNO_EXPANDFAIL; + setflag(addr, af_verify_nsfail); + done = FALSE; + } #endif /* If we haven't authenticated, but are required to, give up. */ @@ -958,7 +974,7 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount. /* Send the MAIL command */ (smtp_write_command(&outblock, FALSE, #ifdef EXPERIMENTAL_INTERNATIONAL - addr->prop.utf8 + addr->prop.utf8_msg ? "MAIL FROM:<%s>%s SMTPUTF8\r\n" : #endif @@ -1049,7 +1065,7 @@ can do it there for the non-rcpt-verify case. For this we keep an addresscount. smtp_write_command(&outblock, FALSE, #ifdef EXPERIMENTAL_INTERNATIONAL - addr->prop.utf8 + addr->prop.utf8_msg ? "MAIL FROM:<%s> SMTPUTF8\r\n" : #endif