Hello list, Wietse: I will preface the below with the acknowledgement that this may look like a silly question being that my configurations have smtp_address_preference = any , which at face value indeed explains the behavior I am seeing
-- I have an entirely dual-stack infrastructure and use postfix as my outbound relay. I have noticed that postfix on any dual-stack machine seems to switch indeterminately between using IPv4 and IPv6 as the transport for SMTP. I have observed this in two places/situations so far: 1) A dual-stack server configured to use a local dual-stack relay for all outbound mail traffic (via relayhost) will flip between IPv4 and IPv6 constantly when contacting this relay: Oct 15 13:10:31 web1 postfix/smtp[29000]: 988054C002C: to=<redac...@aol.com>, relay=mail.puttynuts.com[2607:fd50:13:1::50]:25, conn_use=2, delay=0.18, delays=0.04/0/0/0.14, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 5F8FA9EC4) Oct 15 13:10:31 web1 postfix/smtp[29004]: A67C84C068A: to=< redac...@gmail.com>, relay=mail.puttynuts.com[192.168.152.50]:25, conn_use=2, delay=0.17, delays=0.03/0/0.01/0.13, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 697019EC5) Oct 15 13:10:31 web1 postfix/smtp[29735]: B162B4C002D: to=< redac...@gmail.com>, relay=mail.puttynuts.com[192.168.152.50]:25, conn_use=3, delay=0.19, delays=0.04/0.01/0.01/0.14, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 769F19EC7) Oct 15 13:10:31 web1 postfix/smtp[29000]: C6DE64C002C: to=< redac...@gmail.com>, relay=mail.puttynuts.com[192.168.152.50]:25, conn_use=3, delay=0.16, delays=0.04/0/0/0.11, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 84F299ECA) Oct 15 13:10:32 web1 postfix/smtp[29012]: BC6064C0028: to=< redac...@yahoo.com>, relay=mail.puttynuts.com[2607:fd50:13:1::50]:25, conn_use=3, delay=0.3, delays=0.04/0/0/0.25, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 7BAF29EC9) Oct 15 13:10:32 web1 postfix/smtp[29008]: 758584C0004: to=< redac...@hotmail.com>, relay=mail.puttynuts.com[192.168.152.50]:25, delay=0.9, delays=0.04/0/0.72/0.14, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as EC04A9EBC) Oct 15 13:10:32 web1 postfix/smtp[29716]: 6F3F34C002A: to=< redac...@googlemail.com>, relay=mail.puttynuts.com[2607:fd50:13:1::50]:25, delay=1.5, delays=0.05/0/1.3/0.1, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 748D99EA0) The originating server has: root@web1:~# postconf smtp_address_preference smtp_address_preference = any root@web1:~# postconf inet_protocols inet_protocols = all root@web1:~# (this is the default value of smtp_address_preference, it is not explicitly configured) 2) The "edge" relay is equally indeterminate about its selection of IPv4 vs IPv6 for outbound connection to remote MXes (such as @gmail.com) This relay has: root@vm-mx01:/var/log# postconf smtp_address_preference smtp_address_preference = any root@vm-mx01:/var/log# postconf inet_protocols inet_protocols = all root@vm-mx01:/var/log# (this is the default value of smtp_address_preference, it is not explicitly configured) Is this the intended behavior of smtp_address_preference = any? If a machine is configured properly as single-stack IPv4 and smtp_address_preference = ipv6, will this cause problems or will postfix properly realize that IPv6 is not available and fall back to IPv4 (but prefer IPv6 should it become available)? It seems like postfix does not have the ability to reliably prefer IPv6 when it is available without being statically configured to do so (whereas any other application's connection attempts would prefer IPv6 whenever the machine has IPv6 connectivity available) - or I am misunderstanding the knobs available? My guess is that this is a byproduct of MTAs being very IP-centric instead of being able to completely let the OS handle it via the default mechanisms. I have read a few of the past threads on postfix's behavior but didn't find an explicit assessment as to whether postfix can dynamically understand IPv4 vs IPv6 and prefer IPv6 if it is available or whether it needs to be specified manually (not that this would typically change on a production box, but knowing whether there is one config which would work everywhere) Ryan