X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/ba74fb8d95d2e9af2122e0a95c4d5334b4f0466c..1e1ddfac79fbcd052f199500a6493c7f79cb8462:/src/src/transports/smtp.c diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 5fb22bcd3..6795a0b2c 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -3,6 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2018 */ +/* Copyright (c) The Exim Maintainers 2020 */ /* See the file NOTICE for conditions of use and distribution. */ #include "../exim.h" @@ -1548,6 +1549,7 @@ if ( sx->esmtp if (require_auth == OK && !f.smtp_authenticated) { + invalidate_ehlo_cache_entry(sx); set_errno_nohost(sx->addrlist, ERRNO_AUTHFAIL, string_sprintf("authentication required but %s", fail_reason), DEFER, FALSE, &sx->delivery_start); @@ -5162,7 +5164,12 @@ retry_non_continued: #ifndef DISABLE_EVENT /* If the last host gave a defer raise a per-message event */ - if (!nexthost && (message_defer || rc == DEFER)) + if ( !( nexthost + && unexpired_hosts_tried < ob->hosts_max_try + && total_hosts_tried < ob->hosts_max_try_hardlimit + ) + && (message_defer || rc == DEFER) + ) deferred_event_raise(first_addr, host, US"msg:defer"); #endif }