Ask HN: What's the best way to setup an email server on a VPS?
I have dozens of domains, that get around an email a day each, on which I currently use Google Apps.
I'd like to have a backup option in case Google does something again.
I'd prefer to use a Ubuntu distro, as I have some experience managing it, but I have NO idea on how to setup a server (I could get an answer using Google, but I want a good opinion, not install instructions, although pointers would be nice).
8 comments
[ 4.6 ms ] story [ 20.0 ms ] threadPlus, I want to learn, so, I'd like to give this a shot, if you have any pointers / suggestions.
You'll want to point mail.$YOURDOMAIN at this IP, and set up reverse DNS (pointing to mail.$YOURDOMAIN; some hosts check for the "mail" name.)
Start by setting up Postfix (this setup is based on my own of a few years back, and by no means the only way!) Then, when you get annoyed with spam, add countermeasures in this order: postgrey; setting up some Postfix restrictions (no unauthorized pipelining, etc.); blacklists (Spamhaus' ZEN list was good a few years back); dspam. You may want to add clamav for virus filtering if you have non-technical users. You may need to set up amavisd to get clamav working, but I found that amavisd didn't filter all that much more spam than a properly-trained dspam, so I'd start without.
At some point, something will go wrong and you'll lose mail, or receive it much later than you wanted. Add monitoring to fix this - pflogsumm is good to check for mail that shouldn't have been rejected, something like the Simple Event Correlator can monitor your log files, and something like Nagios (or one of the commercial services, Pingdom/uptimerobot/...) can detect when your host goes down.
I use the plesk control panel to setup addresses, forwards, and catchalls. Works like a charm.
The company is http://www.stablehost.com.
Disclaimer: I am oa customer of theirs. Just pushing them because they are cheap and reliable. No affiliate links.
If you only need a mail server hot standby solution without web interface, then dovecot/postfix might be an option.
Whichever solution you go for, feed it with the mails on the current Gmail server with imapsync or offlineimap. When you want to switch to your own server simply change the MX records of your domain.