Postfix SMTP errors

On a server when you enable SMTP(S) in postfix master.cf file, you may have one or more of the following errors. The reason for these errors is that the definition of the SMTP(S) ports in /etc/services is missing.

Postfix - Errors and solution

Possible encountered errors

You may have one or more of the following errors:

# /path/to/mail_script.sh
postdrop: warning: unable to look up public/pickup:
No such file or directory postdrop: warning: unable to look up public/pickup: No such file or directory

# systemctl status postfix.service
[...]
May 26 11:15:50 SRV-AB-0156 postfix/master[475414]: fatal: 127.0.0.1:smtp: Servname not supported for ai_socktype

# journalctl -xe
[...]
May 26 11:15:50 SRV-AB-0156 postfix/master[475414]: fatal: 127.0.0.1:smtp: Servname not supported for ai_socktype
May 26 11:15:51 SRV-AB-0156 postfix/master[475413]: fatal: daemon initialization failure
May 26 11:15:52 SRV-AB-0156 postfix/postfix-script[475417]: fatal: mail system startup failed

Services file

Open your /etc/services file and add the following ports definition:

# vi /etc/services
[...]
smtp 25/tcp # SMTP
smtp 25/udp # SMTP
smtp 465/tcp # SSMTP
smtp 465/udp # SSMTP

Then restart postfix:

# /etc/init.d/postfix restart

Simple test

Simply send a test mail with the following command:

# echo "test" | mailx -v -s TEST -S smtp=mail.mydivision.company.org -S from="[email protected]" [email protected]

Documentation

https://www.faqforge.com/linux/fix-for-opensuse-error-postfixmaster-fatal-0-0-0-0smtps-servname-not-supported-for-ai_socktype/

> Partager <