I have set this in /etc/postfix/main.cf
:
inet_protocols=ipv4
#I also tried with smtp_address_preference=ipv4
But still, the received message in Gmail shows an IPV6 address next to SPF. Why?
The line you are looking at is not the whole story. The same message may result in travelling through both IPv4 and IPv6 as there might be more than one MTA-MTA connection. Therefore, you need to see the whole trace information, which Gmail shows on the same Original Message page.
The SPF check is done against the last MTA before Gmail. You can compare Received-SPF
header with the Received
header above it: that's the MTA checked for SPF validity. Then look further and see the very first (in time i.e. last in order) Received
header: there you can see the original connection from your Postfix. If inet_protocols=ipv4
was set and Postfix was restarted after the modification, there's no reason to believe that this is nothing but IPv4.
From:[email protected] To:[email protected]
, without any BCC, I can see an ipv4 address.