A self-hosted mail server packaged as a set of Docker images, covering SMTP, IMAP, POP3 and webmail.
mjl-/mox
A full-featured, secure mail server in Go for self-hosting your own domain's email with low maintenance.
- Stars
- 5,911
- Forks
- 234
- Open issues
- 220
- Last commit
- 15 days ago
What is it?
Mox is a self-hosted mail server written in Go that runs SMTP for sending and receiving, IMAP for mail client access, and a built-in webmail interface. It is designed to set up and maintain email for your own domains with minimal effort, and includes a web admin interface that generates the DNS records needed for SPF, DKIM, DMARC, TLSRPT and MTA-STS.
For spam and authentication, Mox checks SPF, DKIM and DMARC on incoming mail, tracks sender reputation, and uses per-user Bayesian filtering trained from Junk and Non-Junk marking. It obtains TLS certificates automatically via ACME, supports DANE and MTA-STS for outbound and inbound delivery, and provides an HTTP/JSON API with webhooks for transactional email.
Mox ships as a single binary with a quickstart command that generates configuration files and prints the required DNS records. It is licensed under MIT and is manually tested with several mail clients and large providers such as Gmail and Outlook.
Key features
- 01Full SMTP and IMAP4 support for receiving, submitting, delivering and accessing email.
- 02Built-in webmail and a web admin interface for domains, accounts and aliases.
- 03SPF, DKIM and DMARC checks, including DMARC aggregate reports.
- 04Per-user Bayesian spam filtering and reputation tracking.
- 05Automatic TLS via ACME, plus DANE and MTA-STS support.
- 06HTTP/JSON webapi and webhooks for transactional email and delivery events.
Use cases
- Hosting email for your own domain instead of using a centralized provider.
- Sending transactional emails such as signup or password reset messages from your own application.
- Running a private mail server for a small team or family with low ongoing maintenance.
- Testing email flows locally with the localserve subcommand.
Quick start
- 1
Compile mox with the Go toolchain (version 1.24 or newer)
GOBIN=$PWD CGO_ENABLED=0 go install github.com/mjl-/mox@latest - 2
Generate config files and DNS records for your address and domain (run as root)
./mox quickstart you@example.com
Things to know
- Mox fully works only on unix systems; on Windows, mox serve does not yet work.
- It needs a dedicated machine, a public IP, and a running webserver on port 443 for automatic TLS, so self-hosting takes real effort.
- Mox does not support POP3, and Sieve filtering is not yet implemented.
In collections
Topics
FAQ
- What is mox?
- A full-featured, secure mail server in Go for self-hosting your own domain's email with low maintenance. Mox is a self-hosted mail server written in Go that runs SMTP for sending and receiving, IMAP for mail client access, and a built-in webmail interface. It is designed to set up and maintain email for your own domains with minimal effort, and includes a web admin interface that generates the DNS records needed for SPF, DKIM, DMARC, TLSRPT and MTA-STS.
- Is mox free to use? What license does it have?
- mox is open source under the MIT license. Check the license terms before using it in commercial products.
- Is mox still maintained?
- Actively maintained. The last commit to mox was on Oct 9, 2026.
- What can I use mox for?
- Hosting email for your own domain instead of using a centralized provider. Sending transactional emails such as signup or password reset messages from your own application. Running a private mail server for a small team or family with low ongoing maintenance. Testing email flows locally with the localserve subcommand.
- How do I install mox?
- Compile mox with the Go toolchain (version 1.24 or newer): GOBIN=$PWD CGO_ENABLED=0 go install github.com/mjl-/mox@latest Generate config files and DNS records for your address and domain (run as root): ./mox quickstart you@example.com
- Where can I get mox?
- The source code and installation instructions are on GitHub: https://github.com/mjl-/mox
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A single-file, self-hosted private email server with SMTP, POP3 and IMAP support plus a web mail management interface for your own domain.
A one-click installer that turns a fresh Ubuntu 22.04 machine into a complete self-hosted mail server with webmail, DNS, and backups.
Dockerized, self-hosted mail server suite bundling Postfix, Dovecot, SOGo, Rspamd and ClamAV behind a web admin UI.
Self-hosted mail server for your own domain, with SMTP/IMAP/POP3, CardDAV/CalDAV, a React webmail and admin console, deployed via Docker Compose.
A browser-based multilingual IMAP webmail client with an application-like interface, written in PHP and extendable through plugins and skins.