Sometimes, you think you should be receiving email from your linux host but the email messages never come. You have verified the email address, you have installed different email program variants, sendmail, mail, mutt, etc…, and yet the messages still aren’t coming. I thought that in today’s article, I would share some troubleshooting tips to help you resolve sendmail sending issues.
Sendmail Not Sending – Verify That Postfix is Running
Sometimes, the reason that your messages are not arriving in your mailbox is simple, they may not be leaving the machine. Sendmail did its job and passed the message off to postfix, but if postfix isn’t running, then the messages will just be left sitting in the maildrop folder. Check your postfix/maildrop directory for files. If files are present, then postfix isn’t sending them and you know what the problem is.
Example: Below we see that lots of messages have queued up in the postfix/maildrop directory.
$ ls /var/spool/postfix/maildrop 01AA84B6E 1589A4B92 3377D4B91 51ACF48CC 6B9BF4B26 828514BB6 982C648D5 A8E9449C9 C03E24AC9 D871F4A4F 0368449DB 15E56485B 374964B78 537524B7A 6BF2349D0 ... 84D564B74 9907F48D3 AB1334AC8 C0F1D49CB D893F4A39 039584B98 1728749AE 378464AEB 53C394B83 6C8204AE8 85200492A 992854AA4 AB2BB4A1B C165F4ACD D8A8E4A25 047A44A4C 17E7349EC 39017497A 55881492D 6CDE648B3 8595849E5 9A4434A49 AC3DA4ADD C1BFE4A73 D955F4A1A 050D54A72 189E84A4E 3979D4A1D 563114AE4 6D32F48B6 982534A20 A87654B5B BF4544952 D4DE64918
Now, let’s start up postfix and see if the messages get sent. Be warned, you messages may have been building up for a long time and some very old messages may be about to be sent. You may want to delete some of the older files if you want to prevent them from getting delivered.
Example: See if postfix is set to startup at machine boot
$ sudo chkconfig --list postfix postfix 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Well that explains it. postfix was not set to startup on boot. We will fix that.
$ sudo chkconfig postfix on
Now let’s start it up:
# service postfix start Starting postfix: [ OK ]
That should send all of the email messages. Check your inbox and check the postfix/maildrop directory to verify that all of the files are gone:
$ ls /var/spool/postfix/maildrop
Sendmail Not Sending – Your IP Address is Blacklisted
Your email may be sending, but the recipient email address may be considering your messages to be spam based on the ipaddress or domain of your server. You can check each of the typical spam blacklistings one at a time, or you can check them all at once using mxtoolbox.com ( http://mxtoolbox.com ).
Example – Checking Your Server’s IP Address for Blacklisting
Browse to mxtoolbox.com and check your domain and IP Address for listing. If your address is listed, this is likely the reason that your messages are not arriving in your email inbox.
This address is listed!
Your address may be listed for many reasons, some of which are not your fault. Each list has a method for removal, but if somehow your server is compromised, you may find that your address is relisted again unless you resolve the real issue.
Some lists (Example: UCEPROTECTL1) will list you and state on their website that you can only petition them to remove your IP Address if you donate to their cause. MXToolbox explains it this way: This blacklist does support a manual request to remove, delist, or expedite your IP Address from their database upon Payment or Donation of fees to their organization. (http://mxtoolbox.com/Problem/Blacklist/UCEPROTECTL1).
I typically will not pay extortion fees like this.
Sendmail Not Working – Other Causes
There may be many other reasons why your email sent through sendmail is not getting delivered. You may also want to check your spam folder in your email client, or verify that your Iptables firewall is not too aggressively set that messages don’t make it out. You may have other reasons that you may want to add in the comments below.