X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e47252f5116d092a96bad199c9a17783885eeef6..d7571ac555518797c3553f6080f6aab3fda6ec58:/src/src/deliver.c diff --git a/src/src/deliver.c b/src/src/deliver.c index 0e59d5108..bf465c977 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -9,6 +9,7 @@ #include "exim.h" +#include "transports/smtp.h" #include @@ -4453,14 +4454,31 @@ for (delivery_count = 0; addr_remote; delivery_count++) if (continue_transport) { BOOL ok = Ustrcmp(continue_transport, tp->name) == 0; - if (ok && addr->host_list) + + /* If the transport is about to override the host list do not check + it here but take the cost of running the transport process to discover + if the continued_hostname connection is suitable. This is a layering + violation which is unfortunate as it requires we haul in the smtp + include file. */ + + if (ok) { - host_item *h; - 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; } + smtp_transport_options_block * ob; + + if ( !( Ustrcmp(tp->info->driver_name, "smtp") == 0 + && (ob = (smtp_transport_options_block *)tp->options_block) + && ob->hosts_override && ob->hosts + ) + && addr->host_list + ) + { + host_item * h; + 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; } + } } /* Addresses not suitable; defer or queue for fallback hosts (which @@ -7059,7 +7077,7 @@ phase, to minimize cases of half-done things. */ DEBUG(D_deliver) debug_printf(">>>>>>>>>>>>>>>> deliveries are done >>>>>>>>>>>>>>>>\n"); -cancel_cutthrough_connection(TRUE, "deliveries are done"); +cancel_cutthrough_connection(TRUE, US"deliveries are done"); /* Root privilege is no longer needed */ @@ -8489,7 +8507,7 @@ if (cutthrough.fd >= 0 && cutthrough.callout_hold_only) } else { - cancel_cutthrough_connection(TRUE, "non-continued delivery"); + cancel_cutthrough_connection(TRUE, US"non-continued delivery"); (void) child_exec_exim(exec_type, FALSE, NULL, FALSE, 2, US"-Mc", message_id); } /* Control does not return here. */