Ask HN: How to run my own mail server?

8 points by gl-prod ↗ HN
What's good practices on running my own mail server? What software?

12 comments

[ 3.7 ms ] story [ 25.2 ms ] thread
Cpanel may not be "cool" but it basically has everything you need built in already. It makes it super easy to run your own mail server. You would then use it to set up DKIM/SPF/etc.

Before setting it up, I would first do a blacklist check on the server's IP address. I would also avoid using any shared IP address, as that could cause long term problems.

Reputation is important, and is a combination of IP reputation, domain reputation, and mail volume. I don't have experience running a low-volume mail server, though I suspect that sending mail to people you already know, and making sure that it gets through to them would be helpful. (Ask them to remove it from spam/whitelist/etc.) The main challenge is to get mail accepted from Microsoft/Yahoo/Google. That accounts for 90%+ of recipients.

>Cpanel may not be "cool" but it basically has everything you need built in already. It makes it super easy to run your own mail server. You would then use it to set up DKIM/SPF/etc.

Is there a known good checklist to follow to set this up? I'm sick of Gmail, iCloud and Proton.

The cPanel interface has an email deliverability section, which consolidates this. You get more options if you also have WHM, but that costs more money as well.
My suggestion is to select a solid (non-rolling) distro for your mail server, and look for a suitable tutorial for your distro that involves Postfix and Dovecot software.

You'll need a fixed IP address and the ability to have your ISP / hoster configure a sensible reverse DNS entry for that IP address that matches a forward DNS entry that points to the same IP address.

You should at least configure some DNS records to have a proper MX and SPF configuration, too. Your preferred search engine (e.g. Google / DuckDuckGo) is your friend.

For inbound spam filtering it makes sense to configure Spamassassin as a milter (=mail filter).

If you are a perfectionist, you should look into setting up DKIM for your mail domain.

>My suggestion is to select a solid (non-rolling) distro

If only there was a distro meant to do just this, preferably from a read only media like CD-R. (I pine for the good old days of Knoppix, Eee PCs, and psudoanonymous vBulletins.)

As I don't thrust OpenSSL farther than the date of it's next zero day exploit with a fancy name, I'd rather be able to patch any mail server ASAP when the exploit is made public... unless there is a nice mail stack that works with e.g. LibreSSL (SMTP+IMAP+Webmail)...
I would go for Debian. YMMV, but IMO it’s very stable. Very few surprises.
> If you are a perfectionist, you should look into setting up DKIM for your mail domain.

More like if you want there to be a chance in hell any recipient at a major provider ever receives your email.

Look into AWS SES. You can run a serverless email server for pretty darn cheap.
It’s not really your own email server though.