Self-host Your Email on the Modern Internet With This One Weird Trick
Back in the early 2000s, when I first bought this domain and started this site, self-hosting your own email was common. If you were running a personal web server, it was just something you did. Over the years, though, things got more complicated. An arms race developed between spammers and anti-spam technology, and for your email to be useful you needed to keep up. Encryption became an increasing requirement, bringing with it the hassle of managing certificates. Later, an alphabet soup of technologies (DKIM, DMARC, SPF) sprang up that you needed to follow to prove you were a legitimate sender. All of this happened against a background of email becoming increasingly centralised — if you weren’t one of the big providers, it was hard to get your mail delivered at all. By the start of this decade, the received wisdom was that hosting your own email wasn’t a practical option.
Through a combination of inertia and ill-advised pigheadedness, I’ve been a holdout. However, I was starting to waver — even though I jumped through all of the hoops, and was careful not to be running an open relay, my mail was still finding itself on the naughty list more than occasionally, and I was contemplating throwing in the towel and moving to Fastmail or similar. Then I came across this one weird trick that solves the problem, and with the move to Mythic Beasts I finally got around to fully implementing it.
I’ve been using Mailroute for years for spam filtering. The integration is incredibly simple and clean — you just point your MX record to their servers, which scan and filter the incoming mail and then pass the legitimate messages on to your own server via normal SMTP. About a year ago I decided to investigate their outbound service, included in the subscription, and realised it would address the deliverability problem.
Again, it’s a very simple integration; you just configure your MTA to send all outbound mail to theirs, and they’ll route it on. The mail clients on your laptop or phone still talk to your own server; Mailroute’s is limited to specific IP addresses to prevent abuse. The net result is that your mail gets sent with their reputation, and maintaining that reputation is the responsibility of experts who are paid to do it. Even better, it means you no longer have to run an MTA accepting connections from the entire internet, and so can sleep a little easier.
When setting up my new VM, I decided to ditch my decades-old, crufty Exim configuration and start afresh. I’ve now got a largely stock “smarthost”, with a few local tweaks, and everything is running like clockwork.
Mailroute isn’t the solution for everyone; in particular, the price quickly mounts up if you have multiple users. Self-hosting email itself is probably not the right option for most, either — there are plenty of good managed email providers, and as long as you own your domain you’re not tied to the first you pick — but, if you do want to give it a go, Mailroute or a similar intermediary solves a lot of the problems that have cropped up over the years. There aren’t many of us left, but we can hold out at least a little longer.