Postfix Mail Delivery SMTP Troubleshooting

Articles CentOS Email How To How To's Linux Mail Mail Server Postfix SMTP Tips and Tricks troubleshooting

To avoid delay in emails, specially for gmail. Just find which MX is working by issuing below commands:

# dig mx

# telnet mx-IP/name 25

upon success, just see the name of first mx tried from /var/log/maillog

and add an entry in /etc/hosts file.

In my case, the entry is given below:
# vim /etc/hosts

:save and exit

now open postfix and add smtp_host_lookup directive under inet_protocols = all

# vim /etc/postfix/

inet_protocols = all
save and exit

now restart postfix

# service postfix restart

by default postfix host lookup is done via DNS, native mode uses nsswitch.conf settings and will check /etc/hosts first and then DNS if entry not found in /etc/hosts