MCPSERV.CLUB
Mox

Mox

Self-Hosted

Secure, low‑maintenance all‑in‑one mail server

Active(90)
5.2kstars
0views
Updated 25 days ago

Overview

Discover what makes Mox powerful

Mox is a **full‑stack, self‑hosted email platform** written entirely in Go. From the server side it implements **SMTP, IMAP4, Webmail, and a REST‑style HTTP API** for transactional mail. The application is designed to run as a single binary on a dedicated VM or container, with no external dependencies beyond the operating system and DNS resolver. Its core is a high‑performance mail transport that supports **SPF, DKIM, DMARC, DANE, MTA‑STS**, and automatic ACME/TLS provisioning, making it suitable for production deployments that require end‑to‑end encryption and strict authentication.

Language & Runtime

Mail Transport

Storage

Web Interface & API

Overview

Mox is a full‑stack, self‑hosted email platform written entirely in Go. From the server side it implements SMTP, IMAP4, Webmail, and a REST‑style HTTP API for transactional mail. The application is designed to run as a single binary on a dedicated VM or container, with no external dependencies beyond the operating system and DNS resolver. Its core is a high‑performance mail transport that supports SPF, DKIM, DMARC, DANE, MTA‑STS, and automatic ACME/TLS provisioning, making it suitable for production deployments that require end‑to‑end encryption and strict authentication.

Architecture & Technical Stack

  • Language & Runtime: Go 1.22+; the entire codebase follows RFC‑centric design, with extensive automated tests and fuzzing.
  • Mail Transport: A custom SMTP/IMAP implementation that handles extensions (STARTTLS, AUTH mechanisms) and implements reputation‑based throttling and Bayesian spam filtering per user.
  • Storage: A lightweight, file‑system‑based mailbox format (similar to Maildir) stored under each user’s home directory; configuration and state are kept in plain text YAML files for transparency.
  • Web Interface & API: A single integrated web server (port 443) that serves static assets, reverse‑proxy capabilities for hosting websites, and a JSON/HTTP API (/api/v1/...) for sending mail, retrieving events, and webhook integration.
  • Metrics & Logging: Prometheus metrics are exposed on /metrics, and structured logs (JSON) can be shipped to any log aggregator.

Core Capabilities for Developers

  • Programmable API: Endpoints to send transactional mail, fetch delivery reports, and receive incoming messages via webhooks.
  • Extensible Reputation Engine: Developers can hook into the per‑user reputation system to inject custom scoring logic or external blacklists.
  • Pluggable Filters: The spam filtering pipeline is modular; custom filters can be added as Go packages and reused across projects.
  • Account Autodiscovery: SRV, Microsoft‑style, Thunderbird‑style, and Apple device profiles are auto‑generated, simplifying client configuration.

Deployment & Infrastructure

Mox is container‑ready; a Dockerfile and OCI image are available, making it trivial to spin up in Kubernetes or any container runtime. The binary requires only a user account (mox) and a home directory; it creates its own configuration during the quickstart phase. For high availability, multiple instances can be run behind a load balancer with shared storage (e.g., NFS) for mailboxes, or each instance can serve a distinct domain. The built‑in ACME client means TLS certificates are renewed automatically, eliminating operational overhead.

Integration & Extensibility

The application exposes a webhooks system that can forward delivery status and inbound message events to external services. Its modular design means the core mail processing logic can be imported into other Go projects; many of its non‑server packages are intentionally reusable. The configuration API and web UI allow runtime changes without restarting, which is invaluable for rapid iteration in development environments.

Developer Experience

  • Zero External Dependencies: No need to install Postfix, Dovecot, or other mail daemons; everything is bundled.
  • Clear Documentation: The source includes RFC‑referenced comments and a comprehensive README; the website hosts a detailed feature list and roadmap.
  • Active Community: MIT licensing encourages contribution, and the project’s GitHub repository is actively maintained with frequent releases.
  • Testing: Extensive unit, integration, and fuzz tests provide confidence that changes do not regress core protocols.

Use Cases

  1. Private SaaS Email Service – A startup can deploy Mox to provide secure, self‑hosted email for its users, leveraging the API for transactional mail while keeping full control over data.
  2. Enterprise In‑House Mail Server – Organizations that require strict compliance can run Mox on their own infrastructure, benefiting from built‑in DMARC and DANE support.
  3. Developer Sandbox – The mox localserve subcommand allows developers to test email flows locally without hitting external SMTP providers.
  4. Hybrid Cloud – Mox can act as an edge server that forwards mail to a cloud provider, combining local control with external deliverability.

Advantages Over Alternatives

  • Performance & Simplicity: A single Go binary eliminates the overhead of multiple daemons; the code is lean and well‑tested.
  • Security by Design: Automatic TLS, strict authentication checks, and reputation‑based throttling reduce the attack surface.
  • Licensing & Freedom: MIT license permits commercial use without copyleft constraints, unlike some open‑source mail servers.
  • Developer‑Friendly Extensibility: Reusable Go packages and a programmable API make it easier to integrate Mox into existing tooling compared to more monolithic solutions.

Mox thus offers developers a complete, secure, and highly extensible email stack that can be deployed with minimal operational burden while still exposing powerful hooks for customization and automation.

Open SourceReady to get started?

Join the community and start self-hosting Mox today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
apis-services
License
MIT
Stars
5.2k
Technical Specs
Pricing
Open Source
Docker
None
Supported OS
Linux
Author
mjl-
mjl-
Last Updated
25 days ago