Events: Fix msg:defer event for the hosts_max_try_hardlimit case. Bug 2554
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 19 Apr 2020 20:18:21 +0000 (21:18 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 19 Apr 2020 20:18:21 +0000 (21:18 +0100)
doc/doc-txt/ChangeLog
src/src/transports/smtp.c

index 9de2e1194e1ea83f577ced06b58e098d95943628..edab6a829ea270f0d590601263810700270ccdf8 100644 (file)
@@ -164,6 +164,9 @@ JH/35 The dsearch lookup now requires that the directory is an absolute path.
       Previously this was not checked, and nonempty relative paths made an
       access under Exim's current working directory.
 
+JH/36 Bug 2554: Fix msg:defer event for the hosts_max_try_hardlimit case.
+      Previously no event was raised.
+
 
 Exim version 4.93
 -----------------
index 5656e790333c169ebac073aa713156cadcac6f7c..a3f0351e374d966edb76b5f8ae72e06390092568 100644 (file)
@@ -5163,7 +5163,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
       }