Re: [exim] Manualroute to non standard smtp (port 2525)

Top Page
Delete this message
Reply to this message
Author: Jakob Hirsch
Date:  
To: 'Exim-users'
Subject: Re: [exim] Manualroute to non standard smtp (port 2525)
Jason Meers wrote:

> I have been asked how to change the port to delivery to on a per domain
> basis, simply adding ":2525" to the end of a hostname just adds "2525"
> as a second server in the list rather than changing the port that mail
> is delivered to on the specified host.


if you want to use smarthost.example.com:2525, just double the colon:
smarthost.example.com::2525 (at least if you use it in the config file).
But that won't help you, exim treats the complete thing as a FQDN.

> What is the cleanest way of adding this functionality? Any help would be


I see no real "clean" way.
You could use something like that:

explicit_routing:
driver = manualroute
transport = remote_smtp_port
route_data = ${extract{1}{:}{${lookup {$domain} lsearch
{/etc/exim/routing}}}}

and this transport:

remote_smtp_port:
driver = smtp
multi_domain = false
port = ${extract{2}{:}{${lookup {$domain_data} lsearch
{/etc/exim/routing}}}{$value}{smtp}}


Obviously, this will not work with with multiple hosts. You could put
the ports to use for each host in a second file (host: port) and lookup
there. A little more inconvenience, but a little cleaner I think. But
then again, you cannot specify different ports for a single host (though
this may be rarely needed).