Mail-in-a-Box
Mail-in-a-Box turns a fresh Ubuntu server into a complete self-hosted mail server with webmail, DNS, spam filtering and automatic TLS.
- GitHub stars
- 15k
- Last commit
- 6 days ago
- Latest release
- v77
- Licence
- CC0-1.0
- Self-hosted
- Yes

Mail-in-a-Box helps individuals take back control of their email by providing a one-click, easy-to-deploy mail server in a box. It turns a fresh Ubuntu 22.04 LTS 64-bit machine into a working mail server by installing and configuring the required components. There are no user-configurable setup options, so it is designed to just work.
The installed components include Postfix for SMTP, Dovecot for IMAP, Nextcloud for CardDAV and CalDAV, z-push for Exchange ActiveSync, and Roundcube webmail. It adds spam filtering with SpamAssassin and greylisting with Postgrey, DNS with SPF, DKIM, DMARC, DNSSEC, DANE TLSA, MTA-STS and SSHFP records set automatically, and TLS certificates from Let's Encrypt. Backups use duplicity, with ufw, fail2ban and munin for protection and monitoring.
Project goals include making a good mail server easy to deploy, promoting decentralization and privacy, and keeping configuration automated, auditable and idempotent. It deliberately does not aim to be customizable by power users. Mail-in-a-Box is written in Python, released into the public domain under CC0-1.0, and has a Code of Conduct for contributors.
Key features
- One-click mail server on Ubuntu 22.04
- Postfix SMTP and Dovecot IMAP
- Roundcube webmail and Nextcloud contacts
- Automatic SPF, DKIM, DMARC and DNSSEC setup
- Let's Encrypt TLS certificate provisioning
- Backups, fail2ban and health monitoring
Pricing: Free and open source, released under CC0-1.0.




