Re: [exim] How to choose the outgoing IPs for an E-Mail

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: Luca Bertoncello
CC: exim-users
Subject: Re: [exim] How to choose the outgoing IPs for an E-Mail
On 2012-04-18 at 21:25 +0200, Luca Bertoncello wrote:
> Now the problem is, that, if I try to send an E-Mail from lucabert.com, Exim
> tries to use an IPv6, even if I just gived an IPv4...


Exim looks up the addresses to try, and filters the available source
address to be one for that family. If you only provide an IPv4 address,
then a connection to an IPv6 endpoint will not have a forced chosen IPv6
source address.

You can disable IPv6 in the configuration, with "disable_ipv6" in the
main configuration section. You can also set "dns_ipv4_lookup" there,
to point to domains that IPv6 lookups should be avoided for, if you know
of broken servers.

On a Router, you can use "ignore_target_hosts" to disable either IPv4 or
IPv6, by specifying the relevant "any" address as the value.

So you might use a forany/forall check against the result of the
existing config file, combined with isip4/isip6, to decide if you have
chosen an appropriate source address for that destination, and then set
ignore_target_hosts appropriately. It will be a little convoluted to
read. Or you might have the system which generates the existing lookup
file also generate a different lookup file. Or you might duplicate the
Router, make the first one IPv4-only with ignore_target_hosts set to a
fixed string instead of a lookup but do the same forall/isip4 check,
this time in a "condition" rule.

-Phil