Delivery: fix transmission down an already-open connection, when
authorJeremy Harris <jgh146exb@wizmail.org>
Thu, 18 Aug 2016 20:27:55 +0000 (21:27 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Thu, 18 Aug 2016 20:37:53 +0000 (21:37 +0100)
one of the group of addresses is unsuitable for it.  Bug 1874

Broken-by: 3070ceeeed05, fa41615da702.
doc/doc-txt/ChangeLog
src/src/deliver.c

index a31a49ae65c308a680d3cc8e755501d00237a9f0..aeb67ecfaa7256ff1ac95969bcc2f88eb70152cc 100644 (file)
@@ -83,6 +83,11 @@ JH/22 Fix continued use of a connection for further deliveries. If a port was
       specified by a router, it must also match for the delivery to be
       compatible.
 
+JH/23 Bug 1874: fix continued use of a connection for further deliveries.
+      When one of the recipients of a message was unsuitable for the connection
+      (has no matching addresses), we lost track of needing to mark it
+      deferred.  As a result mail would be lost.
+
 
 Exim version 4.87
 -----------------
index 24e4d2b63684b5b388bf587e4d3c9b2d37aad322..6fee7be79c263ec46564ae149d915449586bf101 100644 (file)
@@ -4425,6 +4425,7 @@ for (delivery_count = 0; addr_remote; delivery_count++)
       ok = FALSE;
       for (h = addr->host_list; h; h = h->next)
         if (Ustrcmp(h->name, continue_hostname) == 0)
+/*XXX should also check port here */
           { ok = TRUE; break; }
       }
 
@@ -4448,9 +4449,13 @@ for (delivery_count = 0; addr_remote; delivery_count++)
         addr_fallback = addr;
         }
 
-      else if (next)
+      else
        {
-       while (next->next) next = next->next;
+       for (next = addr; ; next = next->next)
+         {
+         DEBUG(D_deliver) debug_printf(" %s to def list\n", next->address);
+          if (!next->next) break;
+         }
        next->next = addr_defer;
        addr_defer = addr;
        }