diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2017-06-11 20:58:21 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2017-06-11 23:47:46 +0100 |
commit | e39fdc8556cb9c21af32e56b1a2aba69a2736f0b (patch) | |
tree | 0d54c3b0d800757576eebaf57f5412d81bc2832e /src | |
parent | e47252f5116d092a96bad199c9a17783885eeef6 (diff) |
On a continued-transport delivery, do not check the hostlist for mismatch in the
transport dispatch level when the transport does hosts-override. Instead do the
full trasport process call and let it decide on compatibility with the connection.
Diffstat (limited to 'src')
-rw-r--r-- | src/OS/Makefile-Base | 2 | ||||
-rw-r--r-- | src/src/deliver.c | 32 |
2 files changed, 26 insertions, 8 deletions
diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base index f3903180b..3b7246109 100644 --- a/src/OS/Makefile-Base +++ b/src/OS/Makefile-Base @@ -602,7 +602,7 @@ crypt16.o: $(HDRS) crypt16.c daemon.o: $(HDRS) daemon.c dbfn.o: $(HDRS) dbfn.c debug.o: $(HDRS) debug.c -deliver.o: $(HDRS) deliver.c +deliver.o: $(HDRS) transports/smtp.h deliver.c directory.o: $(HDRS) directory.c dns.o: $(HDRS) dns.c enq.o: $(HDRS) enq.c diff --git a/src/src/deliver.c b/src/src/deliver.c index 0e59d5108..e5c951560 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -9,6 +9,7 @@ #include "exim.h" +#include "transports/smtp.h" #include <assert.h> @@ -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 ( !( tp->info->driver_name == US"smtp" + && (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 |