Purpose


This wiki is consolidated list of notes pertaining to sendmail's configuration, sendmail errors, and sendmail fixes

[edit] Configuration

[edit] /etc/hosts


    127.0.0.1 should go on the first line.

    The first entry for 127.0.0.1 MUST be localhost.localdomain

    The last entry for 127.0.0.1 SHOULD be the hostname, ex: xxx-xxx-xxx

    The first entry for the internal IP SHOULD be a FQDN, ex: xxx-xxx-xxx 


127.0.0.1       localhost.localdomain xxx-xxx-xxx localhost 

10.16.1.48      xxx-xxx-xxx


[edit] /etc/mail/sendmail.cf


    Find the line starting with "Dj". This should an FQDN 


Djxxx-xxx-xxx


    Run make and restart sendmail 



[edit] Troubleshooting

[edit] nscd


    nscd should be turned off for testing due to caching DNS lookups and probably changes to /etc/hosts 


 /etc/init.d/nscd stop 



[edit] Test sending an email


    Send a test email to yourself. You more then likely will not receive it even if sendmail is working (blocked by gmail, not customer server), but you can check the logs to see if sendmail sent it. 


echo "hi" | mail -s "Test email" "user_name@gmail.com"

tail -n30 -f /var/log/maillog


If you see 'stat=Sent', that means emails can be sent from this server. It however does not mean that emails can be received by other mail servers.



[edit] Checking Blacklist


    If you you get a 'stat=Sent', but email still fails, you might be blacklisted, please use the below link to check:

        Find the servers ip: curl ifconfig.me

        Check that ip on this site: http://www.mxtoolbox.com/blacklists.aspx 



[edit] Misc

[edit] Checking mailq


    In some cases, a large amount of mail will build up in the mail queue. This can cause preformance issues as sendmail is in a constant state of reading and writing to /var/spool/clientmqueue.

    Type: "mailq | tail -n10

        Check the total size

        Check to see why the mail is not being delivered

            Connection timed out usually means a network error, or the receiving mail server is down. Try telneting that servers 25 port to test connectivity

            Connection refused:

                This could be because the upstream mail server has blacklisted the server via RBL's. Please see the "Checking Blacklist" of this wiki.

                Some of our customer use a 3rd part sender to filter outbound mail. Check with the customer about that 3rd parties settings.