How can I enable IPv6 on Exim?

Exim contains code for use on systems that have IPv6 support. Setting HAVE_IPV6=YES in Local/Makefile causes the IPv6 code to be included. It may also be necessary to set IPV6_INCLUDE and IPV6_LIBS on systems where the IPv6 support is not fully integrated into the normal include and library files.

Which IPv6 address record supported by Exim?

Two different types of DNS record for handling IPv6 addresses have been defined. AAAA records are already in use, and are currently seen as the "mainstream", but another record type called A6 is being argued about.

Status of A6 is experimental. Exim has support for A6 records, but this is included only if you set SUPPORT_A6=YES in <tt>Local/Makefile</tt>

How to configure IPv6 in Exim?

For the configuration local_interfaces contains list of interface IP addresses on which to listen. Each item may optionally also specify a port.

The default list separator is a colon, but this can be changed as described in Exim manual. When IPv6 addresses are involved, it is usually best to change the separator to avoid having to double all the colons. For example:

There are two different formats for specifying a port along with an IP address in local_interfaces:

  1. The port is added onto the address with a dot separator. For example, to listen on port 1234 on two different IP addresses:
      local_interfaces = <; ; \
  2. The IP address is enclosed in square brackets, and the port is added with a colon separator, for example:
      local_interfaces = <; []:1234 ; \

When a port is not specified, the value of daemon_smtp_ports is used.

The addresses and ::0 are treated specially. They are interpreted as "all IPv4 interfaces" and "all IPv6 interfaces", respectively. In each case, Exim tells the TCP/IP stack to "listen on all IPvx interfaces" instead of setting up separate listening sockets for each interface.

The default value of local_interfaces is

when Exim is built without IPv6 support; otherwise it is:

Thus, by default, Exim listens on all available interfaces, on the SMTP port.

How can I specify outgoing IPv6 address?

The interface option specifies which interface to bind to when making an outgoing SMTP call. The variables $host and $host_address refer to the host to which a connection is about to be made during the expansion of the string. Forced expansion failure, or an empty string result causes the option to be ignored. Otherwise, after expansion, the string must be a colon-separated list of IP addresses, for example:

The first interface of the correct type (IPv4 or IPv6) is used for the outgoing connection. If none of them are the correct type, the option is ignored. If interface is not set, or is ignored, the system's IP functions choose which interface to use if the host has more than one.

How exim will handle IPv6 addresses in databases?

If Exim is asked to do a dnslist lookup for an IPv6 address, it inverts it nibble by nibble. For example, if the calling host's IP address is 3ffe:ffff:836f:0a00:000a:0800:200a:c031, Exim might look up

Unfortunately, some of the DNS lists contain wildcard records, intended for IPv4, that interact badly with IPv6. For example, the DNS entry

is probably intended to put the entire IPv4 network on the list. Unfortunately, it also matches the entire 3::/124 IPv6 network.

You can exclude IPv6 addresses from DNS lookups by making use of a suitable condition condition, as in this example:

How can I disable IPv6 lookups if Exim was compilled with IPv6 support?

When Exim is compiled with IPv6 support, it looks for IPv6 address records (AAAA and, if configured, A6) as well as IPv4 address records when trying to find IP addresses for hosts, unless the host's domain matches this list.

However if you want to make Exim look only for IPv4-style A records when it needs to find an IP address for a host name set dns__ipv4_lookup option.

Campus6: EximGuide (last edited 2008-04-10 15:29:35 by localhost)