I have a Postfix mail server configured for outbound email, on a dual stack (IPv4 + IPv6) server.
The IPv4 address is private as it's shared with other services on the same connection (SNATed to public IPv4) and the IPv6 address is public and unique (global scope, internet routable).
In this situation, it is common to have the public IPv4 and IPv6 addresses to have different reverse DNS (PTR record), so I'd like Postfix to use the HELO in its SMTP client to match the reverse DNS. It is good practice to have this matching, because aggressive mail filtering triggers on having this set up asymmetrical.
My situation:
IPv4 10.0.3.12 - SNATed to 212.XX.XX.22 (PTR -
srv1.example.com
, A ofsrv1.example.com
points to 212.XX.XX.22)IPv6 of the host (not used here), 2001:XX:XX::1 (PTR -
srv1.example.com
, AAAA ofsrv1.example.com
points to 2001:XX:XX::1)IPv6 of the Postfix container, 2001:XX:XX::12 (PTR -
srv1-postfix.example.com
, AAAA ofsrv1-postfix.example.com
points to 2001:XX:XX::12)
The HELO hostname used must depend on the address family the SMTP client uses to set up the connection. If it is sending via IPv4, the HELO must be srv1.example.com
, and if the client is sending via IPv6 the HELO must be srv1-postfix.example.com
in order to be compliant with SMTP best practices.
How it can be done? I'd like to avoid any form of NATing on IPv6.
I've seen this: postfix multiple IP SMTP banner.
It is not very helpful here, because it explains how to set up domain-specific banner on the listening sockets (smtpd
) rather than the SMTP client (smtp
).