Misha Vyrtsev
Notes by Misha Vyrtsev
About

Mailio, a simple self-hosted mail server

mailio is a mail server for your own domains. Domains, accounts and aliases are managed in a web admin, and mail is read over IMAP in any mail client, like emguio (more about it later). Mail for inbox+shop@ arrives in inbox@, and an account can have aliases at any domain. Every device gets its own password, so losing a phone means deleting one password, not changing it everywhere.

The first mailio was built on top of Postfix, OpenDKIM and OpenDMARC, set up from text configs. I think to change anything I had to ssh into the server, edit a config and restart it, which is very limiting. Then I realized how cluttered it all was, and it still lacked basic things like plus addresses and aliases. I want to click and one more click. Setting up a mail server shouldn’t be treated like a rocket launch. Mail should be simple, or we’ll get lost in proprietary messengers and protocols. Like there is always a stigma. Mail is hard.

So the new mailio is written from scratch where I want to try my approach. It ships as a Docker container, so running it is easy. Under the hood it checks SPF, DKIM and DMARC on what arrives, signs what it sends, and publishes its own DNS records and gets its certificate through a DNS API.

As usual I have chosen Go to write it in because of how actually to the point it is for such tasks. I guess one reason Postfix is made as it is because it’s written in C. C people can’t think simple. They drown under legacy and overengineering C drags with it. Like postmap: a command-line tool used to create, query, update, or manage key-value lookup tables for Postfix configurations (from Google). What? Binary databases, virtual, canonical, archaic formats. Why should it be so complicated for everything. Mail is just some text blob a server receives on some port. Everything else is just noise.

The code and docs are on GitHub.