Postfix何时使用IPv6,何时使用IPv4?

我已经为IPv6和IPv4configuration了邮件服务器,但是在大多数情况下,它使用IPv4,而IPv6在远程主机上可用。 我在2.9版本中使用Postfix。 所以我的想法是,后缀使用IPv6,如果可用,有一个回退到IPv4或我错了?

你有没有设置smtp_address_preference选项来解释更喜欢IPv6?

从postconf(5):

 smtp_address_preference (default: any) The address type ("ipv6", "ipv4" or "any") that the Postfix SMTP client will try first, when a destination has IPv6 and IPv4 addresses with equal MX preference. This feature has no effect unless the inet_protocols setting enables both IPv4 and IPv6. With Postfix 2.8 the default is "ipv6". Notes for mail delivery between sites that have both IPv4 and IPv6 connectivity: · The setting "smtp_address_preference = ipv6" is unsafe. It can fail to deliver mail when there is an outage that affects IPv6, while the destination is still reachable over IPv4. · The setting "smtp_address_preference = any" is safe. With this, mail will eventually be delivered even if there is an outage that affects IPv6 or IPv4, as long as it does not affect both. This feature is available in Postfix 2.8 and later. 

当Postfix正确地configuration了IPv6时,指示使用这两种协议,并且它连接的MX主机同时具有A和AAAAlogging,Postfix每次都会随机select,正如Wietse Wenema自己解释的那样 :

最近的Postfix SMTP客户端在IPv4和IPv6之间随机select,这样当两者中的一个closures时邮件不会卡住。