Q0317 - Exim/exim GitHub Wiki
What I'd like to do is have alternative smart hosts, where the one to be used is determined by which ISP I'm connected to.
The simplest way to do this is to arrange for the name of the smart host du jour to be placed in a file when you connect, say /etc/smarthost. Then you can read this file from a manualroute router like this:
smarthost:
driver = manualroute
transport = remote_smtp
route_list = * ${readfile{/etc/smarthost}{}}
The second argument of the readfile
item is a string that replaces any
newline characters in the file (in this case, with nothing). By keeping
the data out of the main configuration file, you avoid having to HUP the
daemon when it changes.
To send all none local domains with an alternative server, you can use the following setting. Add this section as first router.
smarthost:
driver = manualroute
domains = ! +local_domains
transport = remote_smtp
route_list = * you.alternative.server.com