Resolving Postfix error no local interface found for ::1

Today, while following my own instructions on setting up postfix with gmail on a new device, I started getting the following error during postmap and while starting Postfix:

fatal: parameter inet_interfaces: no local interface found for ::1

I had briefly disabled IPv6 on this machine and might need to do that again (and my networks are all still IPv4 anyway) so I am going to resolve this by simply disabling IPv6 within Postfix.

Disable IPv6 in Postfix

To disable IPv6 in Postfix, we edit the following option in the Postfix config /etc/postfix/main.cf:

# Enable IPv4, and IPv6 if supported
inet_protocols = all

We can see here that by default, Postfix is configured to bind to all available inet_protocols.

To disable IPv6, we restrict it to IPv4 explicitly:

# Enable IPv4, and IPv6 if supported
inet_protocols = ipv4

And now we can restart Postfix and postmap runs cleanly!