Skip to content

Commit

Permalink
Delivery: clarify error log line. Bug 1782
Browse files Browse the repository at this point in the history
"retry time not reached for any host after a long failure period"
has generated so many queries it plainly is not clear.

Replace with
"all hosts for 'dom.ain' have been failing for a long time (and retry time not reached)".
  • Loading branch information
Jeremy Harris committed May 17, 2016
1 parent fc16abb commit c3f2eb9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
30 changes: 14 additions & 16 deletions src/src/transports/smtp.c
Expand Up @@ -3921,7 +3921,7 @@ If queue_smtp is set, or this transport was called to send a subsequent message
down an existing TCP/IP connection, and something caused the host not to be
found, we end up here, but can detect these cases and handle them specially. */

for (addr = addrlist; addr != NULL; addr = addr->next)
for (addr = addrlist; addr; addr = addr->next)
{
/* If host is not NULL, it means that we stopped processing the host list
because of hosts_max_try or hosts_max_try_hardlimit. In the former case, this
Expand All @@ -3930,8 +3930,7 @@ for (addr = addrlist; addr != NULL; addr = addr->next)
However, if we have hit hosts_max_try_hardlimit, we want to behave as if all
hosts were tried. */

if (host != NULL)
{
if (host)
if (total_hosts_tried >= ob->hosts_max_try_hardlimit)
{
DEBUG(D_transport)
Expand All @@ -3944,7 +3943,6 @@ for (addr = addrlist; addr != NULL; addr = addr->next)
debug_printf("hosts_max_try limit caused some hosts to be skipped\n");
setflag(addr, af_retry_skipped);
}
}

if (queue_smtp) /* no deliveries attempted */
{
Expand All @@ -3953,28 +3951,28 @@ for (addr = addrlist; addr != NULL; addr = addr->next)
addr->message = US"SMTP delivery explicitly queued";
}

else if (addr->transport_return == DEFER &&
(addr->basic_errno == ERRNO_UNKNOWNERROR || addr->basic_errno == 0) &&
addr->message == NULL)
else if ( addr->transport_return == DEFER
&& (addr->basic_errno == ERRNO_UNKNOWNERROR || addr->basic_errno == 0)
&& !addr->message
)
{
addr->basic_errno = ERRNO_HRETRY;
if (continue_hostname != NULL)
{
if (continue_hostname)
addr->message = US"no host found for existing SMTP connection";
}
else if (expired)
{
setflag(addr, af_pass_message); /* This is not a security risk */
addr->message = ob->delay_after_cutoff
? US"retry time not reached for any host after a long failure period"
: US"all hosts have been failing for a long time and were last tried "
"after this message arrived";
addr->message = string_sprintf(
"all hosts%s have been failing for a long time %s",
addr->domain ? string_sprintf(" for '%s'", addr->domain) : US"",
ob->delay_after_cutoff
? US"(and retry time not reached)"
: US"and were last tried after this message arrived");

/* If we are already using fallback hosts, or there are no fallback hosts
defined, convert the result to FAIL to cause a bounce. */

if (addr->host_list == addr->fallback_hosts ||
addr->fallback_hosts == NULL)
if (addr->host_list == addr->fallback_hosts || !addr->fallback_hosts)
addr->transport_return = FAIL;
}
else
Expand Down
4 changes: 2 additions & 2 deletions test/log/0461
Expand Up @@ -11,7 +11,7 @@
1999-03-02 09:44:33 10HmaZ-0005vi-00 => userx@test.ex R=r1 T=t1 H=127.0.0.1 [127.0.0.1] C="250 OK"
1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
1999-03-02 09:44:33 10HmbA-0005vi-00 <= CALLER@test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbA-0005vi-00 ** userx@test.ex R=r1 T=t1: retry time not reached for any host after a long failure period
1999-03-02 09:44:33 10HmbA-0005vi-00 ** userx@test.ex R=r1 T=t1: all hosts for 'test.ex' have been failing for a long time (and retry time not reached)
1999-03-02 09:44:33 10HmbB-0005vi-00 <= <> R=10HmbA-0005vi-00 U=EXIMUSER P=local S=sss
1999-03-02 09:44:33 10HmbB-0005vi-00 => CALLER <CALLER@test.ex> R=r0 T=t2
1999-03-02 09:44:33 10HmbB-0005vi-00 Completed
Expand All @@ -29,7 +29,7 @@
1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
1999-03-02 09:44:33 End queue run: pid=pppp
1999-03-02 09:44:33 10HmbE-0005vi-00 <= CALLER@test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbE-0005vi-00 ** userx@test.ex R=r1 T=t1: retry time not reached for any host after a long failure period
1999-03-02 09:44:33 10HmbE-0005vi-00 ** userx@test.ex R=r1 T=t1: all hosts for 'test.ex' have been failing for a long time (and retry time not reached)
1999-03-02 09:44:33 10HmbF-0005vi-00 <= <> R=10HmbE-0005vi-00 U=EXIMUSER P=local S=sss
1999-03-02 09:44:33 10HmbF-0005vi-00 => CALLER <CALLER@test.ex> R=r0 T=t2
1999-03-02 09:44:33 10HmbF-0005vi-00 Completed
Expand Down
4 changes: 2 additions & 2 deletions test/mail/0461.CALLER
Expand Up @@ -21,7 +21,7 @@ A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

userx@test.ex
retry time not reached for any host after a long failure period
all hosts for 'test.ex' have been failing for a long time (and retry time not reached)

--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Content-type: message/delivery-status
Expand Down Expand Up @@ -121,7 +121,7 @@ A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

userx@test.ex
retry time not reached for any host after a long failure period
all hosts for 'test.ex' have been failing for a long time (and retry time not reached)

--NNNNNNNNNN-eximdsn-MMMMMMMMMM
Content-type: message/delivery-status
Expand Down

0 comments on commit c3f2eb9

Please sign in to comment.