Ask HN: Best simple mail server/MTA for a web server?
I was recently bitten by a supposedly-simple Exim configuration that hasn't been changed in years. My VPS host recently made some datacenter changes, but failed to mention the requirement to change the name servers in /etc/resolv.conf. Since Exim couldn't deliver mail in the face of total DNS failure, and the web server continued to function, I didn't find out about the problem for quite a while. Exim was intended to be using an external SMTP server strictly as a relay for external mail, but instead was sending all mail, including local mail to root and postmaster, through the external server.
The result? Messages from my sites' contact forms (and the resulting delivery failure messages) were discarded rather than winding up in /var/spool/mail/. How did I find out? Google Analytics was showing hits to my contact forms, but I wasn't getting any e-mail.
I've fixed the DNS problem for now, but I don't want to keep using this fail-deadly setup. All I need is something that will forward mail from PHP and Ruby scripts to an external SMTP server, and deliver mail for local users into /var/spool/mail/ or similar. I don't need to receive SMTP, I don't need any custom routing, etc. I don't want to have to manage a full-blown e-mail server. Is there nothing simpler than Postfix, Exim, and Qmail?
5 comments
[ 3.2 ms ] story [ 27.3 ms ] threadThe best way to fix that is with a monitoring setup to check that dns is working. use something like monit or nagios(much heavier) to do a local dns look up on the server box every so often, once every 5 minutes, and get an alert form a different box that does the checking. Another way is to setup a cron job that send you email and filter to a folder put a time stamp in the subject and look at it every so often to see new stuff is there, run job once an hour and filter into a folder
If you are worried about DNS resolving failures, you can run bind as a local resolver and only have it listen on 127.0.0.1 or only allow certain hosts to query it, including the local machine it runs on.
For yet another point of view, how about using external SMTP server directly? You are sending messages as follows:
but this is easier to setup: