About mailio
mailio is a mail server in one container: Postfix, OpenDKIM and OpenDMARC, set up from a single config.yml that lists your domains and accounts. Every time it starts, it brings the server in line with that file.
It generates a DKIM key for each domain and publishes the DKIM, SPF and DMARC records through a DNS API such as doapi. It gets a Let's Encrypt certificate with a DNS challenge and renews it on its own. You add the A and MX records once yourself.
- Apps sign in on port 587 with their full address and can only send as that address.
- An account can have a mailbox, or be send-only for an app that only sends.
- Outgoing mail can go through a relay such as Gmail, for networks that block port 25. The relay can be set for all mail, per domain or per account.
- Incoming mail is rejected only when its own domain's DMARC policy asks for it.
mailio account addadds an account to the running server without a restart.
Run it
# config.yml lists your domains and accounts; start from config.example.yml
docker run -d --name mailio \
--hostname mail.example.com \
--network doapi-net \
-p 25:25 -p 587:587 \
-v "$PWD/config.yml:/etc/mailio/config.yml" \
-v mailio-dkim:/etc/opendkim/keys \
-v mailio-spool:/var/spool/postfix \
-v mailio-mail:/var/mail \
-v mailio-tls:/etc/postfix/tls \
-v mailio-acme:/etc/letsencrypt \
-e DNS_API_URL=http://doapi:8080 \
ghcr.io/reeywhaar/mailio:latest
Configuration, backups and the rest are in the README.