Mox
Complete e-mail solution with IMAP4, SMTP, SPF, DKIM, DMARC, MTA-STS, DANE and DNSSEC, reputation-based and content-based junk filtering, Internationalization (IDNA), automatic TLS with ACME and Let's Encrypt, account autoconfiguration, and webmail.
Alternatives
Tech stack
No tech stack added yet. Sign in to suggest some
Overview
Mox is a modern, secure, all-in-one mail server. Its tagline is "Take control of your email and keep email decentralized." Development began in 2021. At the time, many administrators were moving their email to a handful of cloud providers, partly because self-hosted mail systems had become increasingly complex: every additional protocol meant another component in the software stack, and most of those components are written in C, where even a small bug can have serious consequences. Mox brings all the modern email protocols into a single codebase, and one program handles everything involved in sending and receiving mail.
The source code is hosted on GitHub (mjl-/mox) under the MIT license. Development has been funded by the NLnet Foundation, the European Commission's NGI program, and the Dutch Ministry of the Interior and Kingdom Relations.
Key Features
- SMTP: Handles incoming delivery (port 25), with an SMTP client and a delivery queue (with automatic retries). It also provides an authenticated submission service and supports commonly used SMTP extensions.
- Email authentication: Supports SPF, DKIM and DMARC, and uses the results to track domain reputation.
- Transport security: Supports MTA-STS, DANE and DNSSEC.
- IMAP4: Works with common email clients.
- Spam filtering: Filters based on both sender reputation and message content.
- Webmail: Built-in web-based mailbox.
- Web API and Webhooks: Make it easy to integrate with applications, to send email or receive event notifications.
- Internationalized email: Supports EAI/IDNA.
- Automatic account configuration: Email clients can retrieve server settings automatically.
- Automatic TLS: Certificates are obtained automatically via ACME and Let's Encrypt.
- Built-in web server: Can host websites on the same machine.
- Admin interface and monitoring: Provides a web admin interface, as well as metrics and logging.
Core Strengths
- Quick to deploy: The project says that using the quickstart command, you can have the service set up for your own domain in about 10 minutes.
- No external dependencies: It is a single binary. Upgrading generally just means replacing the file and restarting, and the project tries to avoid incompatible changes.
- Two ways to configure: You can make changes in the web admin interface, which is simpler, or edit the commented configuration files directly, which is more flexible and also works well with version control. Changes made in the admin interface are also written back to the configuration files.
- Code quality and security: The codebase is written in Go, with extensive automated and integration tests. It has been fuzz tested and manually tested for compatibility with major mail servers and clients. The code is well documented and cross-referenced with the relevant RFC standards.
Installation and Deployment
The project recommends using a dedicated (virtual) machine for sending and receiving email, with a hostname of the form mail.example.com, and strongly recommends installing a resolver that validates DNSSEC (such as unbound). Run the following as root:
useradd -m -d /home/mox mox
cd /home/mox
# Download or build mox into this directory
./mox quickstart [email protected]
The quickstart does the following:
- Generates
mox.confanddomains.conf - Adds the domain and email account
- Generates the admin password and account password
- Prints the DNS records you need to add
- Gives the command to start the server, and instructions for installing it as a systemd service
Once the service is running, you can access the admin interface from an internal IP address.
Ways to get it:
- Prebuilt binaries: Download from beta.gobuilds.org, which offers builds for several platforms, including linux/amd64.
- Build it yourself: Requires Go 1.23 or later. Run
GOBIN=$PWD CGO_ENABLED=0 go install github.com/mjl-/mox@latest. - Docker: An image is available at
r.xmox.nl/mox, but the project does not recommend this approach. If you do use it, you must enable host network mode; otherwise Mox cannot see the correct remote IP, which affects spam filtering and rate limiting.
Trying it locally: Run mox localserve to start a local-only SMTP/IMAP/Webmail and other services with no configuration at all, which is suited to testing and development.
Technical Requirements and Notes
- Production use requires a Unix-like system. Mox can be compiled on Windows, but
mox servedoes not work there for now, whilemox localserveand most other subcommands do. - Use a machine that is not running another web server. Mox needs its own built-in web server to complete ACME automatic TLS, and running alongside an existing web server takes a lot of extra configuration.
- You have to add the DNS records yourself, and there are quite a few of them.
- The project is still at version 0.0.x; the latest release is v0.0.17.
Discover more
AnyCable
Realtime server for reliable two-way communication over WebSockets, Server-sent events, etc.
Artalk
Comment system built in Golang, providing a lightweight and highly customizable solution for adding comments to your website.
Centrifugo
Language-agnostic real-time messaging (Websocket or SockJS) server.
Ergo
Modern IRCv3 server written in Go, combining the features of an ircd, a services framework, and a bouncer.
Galene
Video conferencing server that is easy to deploy and that requires moderate server resources.
Gotify
Notification server with Android and CLI clients (alternative to PushBullet).