diff --git a/cmdeploy/src/cmdeploy/postfix/main.cf.j2 b/cmdeploy/src/cmdeploy/postfix/main.cf.j2 index 1390456c..9a9ca20b 100644 --- a/cmdeploy/src/cmdeploy/postfix/main.cf.j2 +++ b/cmdeploy/src/cmdeploy/postfix/main.cf.j2 @@ -88,6 +88,22 @@ inet_protocols = ipv4 inet_protocols = all {% endif %} +# Postfix does not try IPv4 and IPv6 connections +# concurrently as of version 3.7.11. +# +# When relay has both A (IPv4) and AAAA (IPv6) records, +# but broken IPv6 connectivity, +# every second message is delayed by the connection timeout +# +# which defaults to 30 seconds. Reducing timeouts is not a solution +# as this will result in a failure to connect to slow servers. +# +# As a workaround we always prefer IPv4 when it is available. +# +# The setting is documented at +# +smtp_address_preference=ipv4 + virtual_transport = lmtp:unix:private/dovecot-lmtp virtual_mailbox_domains = {{ config.mail_domain }} lmtp_header_checks = regexp:/etc/postfix/lmtp_header_cleanup