Nikolaos Milas: > Hello, > > In our setup we have two mail gateway servers accepting incoming mail > (mailgw1.noa.gr [primary] and mailgw3.noa.gr), filtering mail (using > postscreen, amavis, spamassassin, clamav) and forwarding to the internal > mail server (vmail2.noa.gr) where user mailboxes lie. > > All servers are running postfix 3.7.0. > > I am trying to investigate why our mail gateway servers (mailgw1 and > mailgw3) sometimes connect over IPv6 and some other times connect over > IPv4 to deliver mail to vmail2.
I received complaints when some Linux distro shipped Postfix with IPv4 and IPv6 support turned on. Under specific confitions, sites could no longer send mail to destinations with IPv6+IPv4 primary MX addresses even if those destinations were perfectly reachable over IPv4. - Postfix would never try IPv4, because it was configured to prefer IPv6, and the number of a destination's IPv6 primary MX addresses was >= than $smtp_mx_address_limit. - Postfix IPv6 support was on, but the host had no IPv6 connectivity. - Not reported, but plausible: IPv6 was tunneled over IPv4, and IPv6 came from a different provider. Thus, IPv6 could go down while IPv4 still worked. You get a similar result, failure to connect over IPv6, when Postfix is configured to prefer IPv4, and IPv4 is down while IPv6 is up. When Postfix IPv4 and IPv6 support are turned on, these Postfix default settings will keep mail flowing as long as at least one of the two protocols works: smtp_address_preference = any smtp_balance_inet_protocols = yes If you must force IPv6 delivery, then I would recommend using a dedicated SMTP client in transport_maps that overrides the above settings (with "-o inet_protocols=ipv6"). I would STRONGLY advise not to override these defaults for email deliveries across the internet or else Postfix will fail to try To deliver over IPV6 (or IPv4) when the other procotol is down. Wietse