大网数据广告活动
服务器运维问答

Configure postfix to send via IPV4 but receive using both IPV4 & IPV6?

· 52CE 我爱测

Is it possible to configure postfix to send via IPV4 only but receive using both IPV4 & IPV6? My server, running on AWS Lightsail, now can have an IPV6 address. The address is relatively static (as long as I keep IPV6 active on t…

问题原文

原帖链接 · David G · CC BY-SA 4.0

Is it possible to configure postfix to send via IPV4 only but receive using both IPV4 & IPV6?

My server, running on AWS Lightsail, now can have an IPV6 address. The address is relatively static (as long as I keep IPV6 active on the instance), but it's not truly static because I can't move the address from server to server (like I can do with the static IPV4 address). I also can't (currently) as Amazon to assign an PTR record for the IPV6 address.

As I have the IPV6 address available, I'd like to be able to receive mail using either IPV4 or IPV6 but only send using IPV4.

I know I can set postfix to only listen on the IPV4 address using the inet_protocols setting.

社区高分解答

原帖链接 · Sander Steffann · CC BY-SA 4.0

It's not exactly what you asked for, but you can make postfix prefer IPv4 for outgoing email with this configuration:

smtp_address_preference=ipv4

That should usually have the effect you desire, unless the receiver explicitly gives the preferred MX only an IPv6 address.

The manual reference: https://www.postfix.org/postconf.5.html#smtp_address_preference

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-01-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。