I've got a server with exim4 and a smarthost in front of it, the use of the smarthost is mandatory, the university closed down port 25. However, on IPv6 this port is open. So when the receiving server has an IPv6 address I could send it directly.
So my question is, how can I let exim make a routing decision based on the IP-address, or try IPv6 first and if that doesn't work use the smarthost.
The easiest way to do this might be to put an
ignore_target_hosts
directive on the SMTP router, so that Exim passes over that router if it finds an IPv4 address in the MX record of the destination. Something like:Then you just need a fall-through router below pointing at the smarthost transport. This should mean that any destination with an IPv6 MX record should have direct delivery attempted, and any with an IPv4 'falls through' to the next router which will attempt a smarthost delivery.