Menu
Menu

How to fix sendmail, iptables, and email delay/not sending

Posted in Linux on April 29, 2017
Tags: ,

I had some issues with sendmail actually sending out an e-mail. Then sometimes if I stopped the iptables firewall some emails would make to my inbox but that's quite a big delay. What I had to do to get my mail working smoothly and sending right away was to allow my server's (or lan) IP address to access sendmail. Here's the code I put into my iptables config file. I couldn't find a real solution that worked for me so I edited /etc/sysconfig/iptables and copied this

-A INPUT -p tcp -s 0/0 --sport 80 -d MYSERVERLANIPHERE --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

Then pasted, and changed the port to 25 instead of 80

-A INPUT -p tcp -s 0/0 --sport 25 -d MYSERVERLANIPHERE --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

Then I restarted my firewall (service iptables restart) and booyah! Shiz iz workin.

If you're a server admin, another thing you might be interested in is how to clear the qmail queue.

2 Responses to “How to fix sendmail, iptables, and email delay/not sending”

  1. ed says:

    Thank you after hours of hit and miss I finally found this page with the answer that worked in my situation.

Leave a Reply

Your email address will not be published. Required fields are marked *