Mail-in-a-Box logo

Mail-in-a-Box

One-click, self-hosted email server that just works

Mail-in-a-Box transforms a fresh Ubuntu 22.04 machine into a fully configured mail server with SMTP, IMAP, webmail, spam protection, DNS, TLS, backups and a simple control panel.

Mail-in-a-Box banner

Overview

Overview

Mail-in-a-Box lets individuals and small teams turn a brand‑new Ubuntu 22.04 LTS server into a production‑ready mail system with a single command. The project targets users who want privacy and control without spending time on manual configuration.

Features

The installer provisions Postfix, Dovecot, Roundcube, Nextcloud‑based CardDAV/CalDAV, and Z‑Push for ActiveSync, plus spamassassin, postgrey, NSD4 DNS with SPF/DKIM/DMARC/DNSSEC, and automatic Let’s Encrypt TLS for every service. A web‑based control panel and REST‑API let you add users, aliases, custom DNS records, schedule duplicity backups, and monitor health via Munin, UFW firewall and fail2ban.

Deployment

Start with a clean 64‑bit Ubuntu 22.04 machine, clone the repository, checkout the latest tag and run sudo setup/start.sh. The script installs, configures and enables all components, then runs daily checks to verify service status, certificate validity and DNS correctness. While the box “just works”, you must maintain a dedicated server and accept that advanced customizations or SMTPUTF8 are not supported.

Highlights

One‑click installation on fresh Ubuntu 22.04
Automatic TLS via Let’s Encrypt for all services
Integrated DNS with SPF, DKIM, DMARC, DNSSEC
Web control panel and API for user and backup management

Pros

  • Easy single-command deployment
  • Comprehensive mail stack (SMTP, IMAP, webmail, spam protection)
  • Built‑in DNS and TLS automation
  • Health monitoring and simple web UI

Considerations

  • Limited customization – no power‑user options
  • Requires a clean Ubuntu 22.04 installation
  • SMTPUTF8 not supported
  • Reliant on external DNS reputation for deliverability

Managed products teams compare with

When teams consider Mail-in-a-Box, these hosted platforms usually appear on the same shortlist.

Gmail logo

Gmail

Email service with spam protection and Google integration

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Tech‑savvy individuals who want a personal mail server
  • Small teams needing a private email domain
  • Privacy‑focused users wanting control over their data
  • Organizations that can dedicate a dedicated Ubuntu VM

Not ideal when

  • Enterprises needing deep mail server customization
  • Environments where SMTPUTF8 support is mandatory
  • Users without ability to provision a fresh Ubuntu server
  • High‑volume mail services requiring advanced scaling

How teams use it

Personal email domain

Run your own address (you@yourdomain.com) with spam filtering and encrypted connections, eliminating reliance on third‑party providers.

Small business communication

Provide staff with private mailboxes, shared calendars via Nextcloud, and secure webmail without external SaaS subscriptions.

Secure static website hosting

Serve an HTTPS website from the same box while handling email for the domain, simplifying infrastructure.

Backup and disaster recovery testing

Use built‑in duplicity backups and monitoring to ensure mail data can be restored quickly after a failure.

Tech snapshot

Python53%
Shell26%
HTML19%
PHP1%
Handlebars1%

Tags

smtpmailemailserver

Frequently asked questions

What operating system does Mail-in-a-Box support?

It is designed for a fresh Ubuntu 22.04 LTS 64‑bit installation.

Do I need to configure DNS records manually?

No, the installer sets up NSD4 with SPF, DKIM, DMARC, DNSSEC, DANE, MTA‑STS and SSHFP automatically.

Is TLS handled automatically?

Yes, Let’s Encrypt certificates are obtained and renewed for HTTPS and all mail services.

Can I customize the mail stack beyond the default?

Customization is intentionally limited; the project aims for a ‘just works’ experience without power‑user tweaks.

What happens if my outgoing mail is blocked by other providers?

Mail-in-a-Box cannot control external spam filters; you may need to adjust DNS, reputation, or contact recipient admins.

Project at a glance

Active
Stars
15,145
Watchers
15,145
Forks
1,529
LicenseCC0-1.0
Repo age12 years old
Last commit2 weeks ago
Self-hostingSupported
Primary languagePython

Last synced 5 hours ago