When you install OS by default it have enabled IPV6 but when you disable it and restart postfix you will be prompted with a nice error saying service postfix could not start like bellow:
Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details.
When executing postfix status command you will see something like:
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2021-03-18 21:09:11 EET; 1s ago
Process: 30530 ExecStop=/usr/sbin/postfix stop (code=exited, status=1/FAILURE)
Process: 30545 ExecStart=/usr/sbin/postfix start (code=exited, status=1/FAILURE)
Process: 30542 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 30536 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=75)
Main PID: 1698 (code=killed, signal=TERM)
Mar 18 21:09:08 awx systemd[1]: Starting Postfix Mail Transport Agent...
Mar 18 21:09:08 awx aliasesdb[30536]: /usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for ::1
Mar 18 21:09:09 awx aliasesdb[30536]: newaliases: fatal: parameter inet_interfaces: no local interface found for ::1
Mar 18 21:09:09 awx postfix/sendmail[30541]: fatal: parameter inet_interfaces: no local interface found for ::1
Mar 18 21:09:10 awx postfix[30545]: fatal: parameter inet_interfaces: no local interface found for ::1
Mar 18 21:09:11 awx systemd[1]: postfix.service: control process exited, code=exited status=1
Mar 18 21:09:11 awx systemd[1]: Failed to start Postfix Mail Transport Agent.
Mar 18 21:09:11 awx systemd[1]: Unit postfix.service entered failed state.
Mar 18 21:09:11 awx systemd[1]: postfix.service failed.
This error can be fixed in 2 ways, from postfix config file or from /etc/hosts.
Fix from postfix config file will require a minor change by replacing localhost with 127.0.0.1 from directive inet_interfaces.
Fix from /etc/hosts file will require deleting line ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6. This line tells to OS that it have IPV6 localhost interface so you ca remove it because you don’t have it.
3 Comments
Gaurav · September 26, 2021 at 6:23 pm
Thanks it saved my day
Robert · February 22, 2023 at 12:29 am
Fix from /etc/hosts fixed it, thank you
Deepak · March 4, 2025 at 10:44 am
Thanks, man. It saved another day of debugging.