[exim] SMTP retries to host unaware of different destination…

Top Page
Delete this message
Reply to this message
Author: Daniel Tryba
Date:  
To: exim-users
Subject: [exim] SMTP retries to host unaware of different destination ports

http://www.exim.org/exim-html-current/doc/html/spec_html/ch-smtp_processing.html#SECToutSMTPerr
has to following:
"If the current set of addresses are not all delivered in this run (to
some alternative host), the message is added to the list of those
waiting for this host, so if it is still undelivered when a subsequent
successful delivery is made to the host, it will be sent down the same
SMTP connection."

This looks fine but consider the following router:
virtual_smartrelay:
 driver     = manualroute
 route_data = ${lookup mysql {MYSQL_SMARTRELAY_DATA}{$value}}
 transport  = remote_smtp


The lookup contains data like 109.235.x.y::2825 (host::port)

All works fine (see debug below), unless there are 2 or more domains
poining to the same host but using different ports. If 1 domain
(pocos.nl) points to port 2825 and an other to 9999 (pokos.nl) and
nothing is listening on the latter port, initial delivery to pokos.nl
will fail with a "No route to host" and the mail will be queued for
retry. When an email to the domain pointing to 2825 (pocos.nl) is
processed and succesfully delivered, the retry mechanism described above
will use the existing SMTP connection to port 2825 to deliver mail ment
for port 9999.

According to the documentation this is not a bug, I consider this
unwanted behavior. So is this a bug or a nice to have feature?

> exim4 -bt daniel@???

....
lookup yielded: 109.235.x.y::2825
original list of hosts = "109.235.x.y::2825" options =
expanded list of hosts = "109.235.x.y::2825" options =
set transport remote_smtp
finding IP address for 109.235.x.y:2825
host=109.235.x.y port=2825
calling host_find_byname
gethostbyname2(af=inet6) returned 1 (HOST_NOT_FOUND)
109.235.x.y in hosts_treat_as_local? no (end of list)
fully qualified name = 109.235.x.y
gethostbyname2 looked up these IP addresses:
name=109.235.x.y address=109.235.x.y
queued for remote_smtp transport: local_part = daniel
domain = pocos.nl
errors_to=NULL
domain_data=NULL localpart_data=NULL
routed by virtual_smartrelay router
envelope to: daniel@???
transport: remote_smtp
host 109.235.x.y [109.235.x.y] port=2825
search_tidyup called
close MYSQL connection
>>>>>>>>>>>>>>>> Exim pid=4370 terminating with rc=0 >>>>>>>>>>>>>>>>

daniel@???
router = virtual_smartrelay, transport = remote_smtp
host 109.235.x.y [109.235.x.y] port=2825

> exim4 -bt daniel@???

....
lookup yielded: 109.235.x.y::9999
original list of hosts = "109.235.x.y::9999" options =
expanded list of hosts = "109.235.x.y::9999" options =
set transport remote_smtp
finding IP address for 109.235.x.y:9999
host=109.235.x.y port=9999
....
>>>>>>>>>>>>>>>> Exim pid=4372 terminating with rc=0 >>>>>>>>>>>>>>>>

daniel@???
router = virtual_smartrelay, transport = remote_smtp
host 109.235.x.y [109.235.x.y] port=9999

mainlog:
2016-07-26 10:36:20 1bRyIQ-0007JR-Og == daniel@???
<www-data@???> R=virtual_smartrelay T=remote_smtp defer (113): No route to host
2016-07-26 11:19:24 1bRyIQ-0007JR-Og == daniel@???
R=virtual_smartrelay T=remote_smtp defer (-53): retry time not reached for any host
2016-07-26 11:19:24 1bRyVN-0001sX-RZ => daniel@???
R=virtual_smartrelay T=remote_smtp H=109.235.x.y [109.235.x.y]
2016-07-26 11:19:24 1bRyVN-0001sX-RZ Completed
2016-07-26 11:19:25 1bRyIQ-0007JR-Og => daniel@???
R=virtual_smartrelay T=remote_smtp H=109.235.x.y [109.235.x.y]*
2016-07-26 11:19:25 1bRyIQ-0007JR-Og Completed