Self-Hosting Email Like It's 1984

https://news.ycombinator.com/rss Hits: 15
Summary

Introduction Self-hosting an email server is useful for automating tasks like mailing lists, newsletters, or email verification APIs. The elephant in the room is real-world deliverability. With self-hosting you risk not receiving mail or someone missing your mail. I accept this for my personal projects, but you may not. Keep this in mind. For me the selling point of self-hosting is that it’s practically free. If you’re already self-hosting a website, installing some extra packages on your server and just a bit of your time is all that’s required. Mail takes very little storage and the software is light, so you’re unlikely to significantly change energy consumption or disk usage. For the longest time, I perceived self-hosting email as too difficult, but after doing it for one of my projects, I can say it’s not much harder or more time-consuming than configuring some email SaaS. I changed my goals a bit to make the setup easier though. Self-hosting a multi-user webmail looks heavy and is more involved than I was willing to get into, so I just skipped it. That way, I didn’t have to bother with user accounts, databases, or the web at all, and the task became easy. With my config, manually sending and receiving email is possible if you SSH to your mail server and use the minimal sendmail or mailx commands, or Mutt if you like TUI. The setup is enough for me now, but I could expand it in the future, and multi-user webmail isn’t off the table anyway. Maybe I’ll even write a simple webmail package myself! Setting up Postfix You just need to open port 25, and install and configure Postfix and OpenDKIM on your machine. Postfix is a complete SMTP server, and is enough for basic mail alone, but in practice you also need OpenDKIM to get your mail delivered to popular services like Gmail. Here's my Postfix config to show how easy it is. I left the master.cf file as it was, because I’m always submitting email locally. Notice there's no mention of POP3 or IMAP. I didn't set them up...

First seen: 2025-10-04 17:58

Last seen: 2025-10-05 08:00