The CABlog

Running your own email server for fun and profit

Hi everyone,

As you can probably tell by the title of this post, I run my own Mail Server via the wonderful Mail-in-a-Box which has made this whole endeavor possible in the first place. I doubt I would've taken this up if I had to configure all the individual tools to work correctly together as it takes a lot of different tools, working together in specific ways to make a standards-compliant mail server (not to mention DNS, Contacts, Calendars and (Next)Cloud which are also thrown in.

It's relatively simple with the script by design. It takes a clean Ubuntu box, a domain name (usually box.[example.com]) and installs all the necessary prerequisites. It also offers backups of your email data, which is especially useful when occasionally having to upgrade to the latest Ubuntu LTS release which Mail-in-a-Box requires.

Email is also a surprisingly resilient protocol by design, so the occasional restart to do updates isn't a problem and I've never missed an email due to it.

Running your own mail server seems daunting, and it's certainly more work than just using one of the big providers and calling it a day. Although, it does definitely come with some perks:

Perks

Catch-all Email

Catch-all email means I can give each company a unique email. Nowadays, I randomly generate the prefix/mailbox name, and it allows me to sinkhole an email when it gets leaked in a Data Breach. It does come with one downside though, in the past I've used the company name as the mailbox name i.e. company [at] cadawg [dot] com, and it's confused administrative staff to ignore my application. Also, when I called up my bank's fraud department one time, they asked if I worked for them because of the mailbox name. If the fraud department fell for that for a second, maybe scammers should take notes (please don't)!

This means that my mailbox remains relatively spam-free (of course with Spam assassin taking care of some of the other spam)

Cloud, DNS

The fact that cloud and DNS are thrown in is a nice addition and it's become my main place to host my DNS records, and having some private cloud storage is nice since it allows me to throw stuff up quickly - for example transferring photos from my Phone or keeping important documents, as I know they'll be backed up securely (although my local backup setup is pretty strong too after losing data too many times).

Downsides

Getting your IP off of blacklists

Originally, I rented a second IPv4 for my box, as the IP I was assigned was in some blacklists that I couldn't easily unlist it from. Still, even with this new IP I had to get in Microsoft's good books via Smart Network Data Services, to request that my IP came of the blacklist, which worked. GMail was a little harder, and I had to keep sending emails (originally, it wouldn't even let me send and just straight up vanished my mail), but eventually it let me reach my family members and I asked them to keep marking it as "Not Spam" to eventually get into the inbox.

There was only one obstacle it couldn't overcome - when I started my last job, our Occupational Health provider at work had their security settings so high that it just straight up rejected mail from my mail server.

Eventually, this second IP ended up costing almost as much as the server itself - I contacted my hosting provider (Hetzner) and they managed to get the original IP off of the blacklist, so I went back to using that (had to edit the network config but that was all).

Managing your own DNS

Once my DNS server on the server fell over because I had duplicate rules that were not allowed - this didn't take much troubleshooting though. I also set up a backup DNS via puck.nether.net (which is a completely free service, shout out to them for making my life easier)!

Conclusion

Overall, for me, hosting my own mail server has been a rewarding experience. It's also helped me in jobs to troubleshoot things with email such as missing DKIM headers causing deliverability issues - it's a "cool" party trick when you can find things like that quickly. I've certainly learned a lot and would recommend it to anyone who wants to take back their emails (email was meant to be decentralised)!

Have a great day ahead,

~ CA

Like what I write? Subscribe to my Mailing List or RSS feed.

Comments? Questions? This is probably the most relevant post to ask you to send me an email (I really want to hear from you).

This post was last edited 2 months, 1 week ago.