7,363 open-source and SaaS tools, with GitHub stats refreshed every day.

Mail-in-a-Box

Open source

Mail-in-a-Box turns a fresh Ubuntu server into a complete self-hosted mail server with webmail, DNS, spam filtering and automatic TLS.

mailinabox.email
Mail-in-a-Box homepage screenshot
GitHub stars
15k
Last commit
6 days ago
Repository age
13 years
Version
v77
Licence
CC0-1.0
Self-hosted
Yes

About Mail-in-a-Box

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

Good fit for

  • →Self-hosting personal or family email
  • →Small organizations running their own mail
Built with
Python
Tags
mail-server
email
smtp
imap
self-hosted
webmail
dns
ubuntu

Mail-in-a-Box: questions and answers

What is Mail-in-a-Box used for?
Mail-in-a-Box turns a fresh Ubuntu server into a complete self-hosted mail server with webmail, DNS, spam filtering and automatic TLS. It is a good fit for self-hosting personal or family email and small organizations running their own mail.
Is Mail-in-a-Box open source?
Yes. Mail-in-a-Box is open source under the CC0-1.0 licence. Its source code is on GitHub at mail-in-a-box/mailinabox and is written mainly in Python.
Is Mail-in-a-Box free?
Yes. Mail-in-a-Box is open source, so the software itself is free to use.
Can I self-host Mail-in-a-Box?
Yes. Mail-in-a-Box can be self-hosted on your own server or infrastructure; there is no official hosted version.
What is Mail-in-a-Box an alternative to?
Mail-in-a-Box is an open-source alternative to Gmail, Google Workspace, Fastmail and Proton Mail. Other open-source alternatives to Gmail include Stalwart, Mailcow and Mailu.
Is Mail-in-a-Box actively maintained?
Yes. The most recent commit to Mail-in-a-Box was on 26 September 2026, and the latest release is v77, published on 26 September 2026. The project has 15k stars on GitHub.

Open-source alternatives to Mail-in-a-Box

See all

SaaS alternatives to Mail-in-a-Box

See all