A rust-based mail relay server for Delta Chat, encrypted, federated, one binary. batteries included.
Quick Setup · Features · Documentation · Deployment
Madmail is a server relay for the Delta Chat app, users message through the Chatmail protocol, while Madmail handles delivery, storage, federation, and real-time services on the server side.
A Rust rewrite of Madmail v1: SMTP, IMAP, encryption enforcement, and real-time relay built in.
Download the release binary for your architecture, then install and start the service:
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
curl -fsSL "https://github.com/themadorg/madmail/releases/latest/download/madmail-linux-${ARCH}" \
-o madmail
chmod +x madmailTrusted TLS via Let's Encrypt IP certificate (~6-day renewal, port 80 required):
sudo ./madmail install --simple --ip YOUR_IP \
--auto-ip-cert \
--acme-email you@example.com \
--lang en
sudo systemctl enable madmail
sudo systemctl start madmailReplace
YOUR_IPwith your server's public IPv4 or IPv6 address.
Self-signed TLS (testing / internal — omit --auto-ip-cert):
sudo ./madmail install --simple --ip YOUR_IP --lang en
sudo systemctl enable madmail
sudo systemctl start madmailStandard Let's Encrypt certificate (90-day renewal, DNS must point to your server):
sudo ./madmail install --simple --domain mail.example.org \
--acme-email you@example.com \
--lang en
sudo systemctl enable madmail
sudo systemctl start madmailReplace
mail.example.orgwith your hostname andyou@example.comwith a valid contact email.
More detail:
- Quick start (full guide)
- DNS, SPF, DKIM, federation
- Simple IP + ACME install
- IP vs domain deployment
- Local development
Documentation is organized by audience and purpose.
- User & Operator Guide — Practical, human-friendly documentation covering accounts & registration, privacy model, federation, calls (TURN/Iroh), administration, deployment scenarios, and troubleshooting.
- Project Documentation — Technical tour of architecture, crates, runtime wiring, data flows, build system, and contribution notes.
- Technical Design Document (TDD) — Design specifications for major components.
- RFC Reference Library — Collection of relevant protocol specifications (SMTP, IMAP, HTTP, TLS, TURN, etc.).
- Simple IP + ACME Installation — IP-based install with Let's Encrypt TLS
- Local Development Guide — Developer setup, build, and testing workflow
Documentation lives in the repository alongside the source code.
Madmail v2 stands on many open-source projects.
During how we built Madmail v2, dozens of those trees were used as context while implementing the Rust server, for behavior parity with Madmail v1, protocol study, client E2E testing, TLS/ACME patterns, and real-time relay integration. What each repository contributed (and related notes) is in Context & reference projects.
This codebase was also developed with Cursor (coding agent) and Gemini 3.1 Pro (Google AI Studio) for planning and implementation assistance. See AI-assisted development for how those tools fit into the workflow (more detail to be added there).
The product vision, architecture, phase plan, and acceptance criteria were defined and reviewed by humans. Most of the Rust (and related) source in this repository was written with AI assistance under that direction, not as an unattended dump of generated code, but as an iterative, human-guided process.
Use at your own risk. Madmail v2 is AGPL software under active development; run it on production systems only after you have validated it for your threat model and workload.
We always welcome criticism, bug reports, and discussion, please use GitHub Discussions.
