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

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.


It's not exactly what you asked for, but you can make postfix prefer IPv4 for outgoing email with the smtp_address_preference=ipv4 option. That should usually have the effect you desire, unless the receiver explicitly gives the preferred MX only an IPv6 address.

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