Introduction
Stalwart is an open-source mail and collaboration server written entirely in Rust that combines SMTP, IMAP, JMAP, POP3, CalDAV, CardDAV, and WebDAV into one unified binary. It replaces the traditional stack of Postfix + Dovecot + Rspamd with a single process that is memory-safe, fast, and straightforward to deploy.
What Stalwart Does
- Sends and receives email via SMTP with DKIM, SPF, DMARC, ARC, and MTA-STS support
- Serves mailboxes over IMAP4, JMAP, and POP3 with full-text search built in
- Provides calendar and contacts sync through CalDAV and CardDAV
- Includes a built-in spam and phishing filter powered by statistical analysis and rules
- Supports file sharing and collaboration via WebDAV
Architecture Overview
Stalwart compiles to a single statically-linked binary that embeds all protocol handlers, a web administration interface, and a configurable storage backend. It supports RocksDB for embedded single-node setups, PostgreSQL or MySQL for shared deployments, and S3-compatible object storage for blob data. TLS is handled natively with automatic ACME certificate provisioning via Let's Encrypt.
Self-Hosting & Configuration
- Deploy as a single Docker container or download the pre-built binary for Linux and macOS
- All configuration is managed through the built-in web admin UI or a TOML config file
- Storage backends: RocksDB (default embedded), PostgreSQL, MySQL, or SQLite
- TLS certificates are auto-provisioned via ACME; manual certificate paths are also supported
- DNS records (MX, SPF, DKIM, DMARC) must be configured at your domain registrar
Key Features
- Single binary replaces an entire mail stack (MTA, MDA, spam filter, groupware)
- Written in Rust for memory safety with no garbage collection pauses
- Built-in full-text search across mailboxes with no external dependency like Solr or Elasticsearch
- JMAP support for modern, fast email clients alongside traditional IMAP4
- Web-based admin console with user management, queue monitoring, and log viewing
Comparison with Similar Tools
- Mail-in-a-Box — Automated Postfix/Dovecot bundle; easier initial setup but less flexible
- Maddy — Go-based all-in-one mail server; fewer protocols and no CalDAV/CardDAV
- Mailcow — Docker-based Postfix/Dovecot/Rspamd stack; more moving parts to maintain
- iRedMail — Script-based installer for traditional mail stack; harder to update components individually
- Postfix + Dovecot — The classic combo; proven but requires gluing multiple services together
FAQ
Q: Can Stalwart handle multiple domains? A: Yes. Stalwart supports unlimited virtual domains, each with independent DKIM keys, catch-all addresses, and per-domain storage quotas.
Q: Does it include a webmail client? A: Stalwart itself does not bundle a webmail UI, but it works with any IMAP or JMAP client. Roundcube and Snappymail are common self-hosted webmail frontends used alongside it.
Q: How does spam filtering work? A: Stalwart includes a built-in spam filter that uses Bayesian classification, DNS blocklists, header analysis, and configurable rules. It does not require an external tool like Rspamd or SpamAssassin.
Q: What are the hardware requirements? A: A VPS with 1 CPU core, 1 GB RAM, and 10 GB disk is sufficient for small deployments with a few hundred mailboxes. Stalwart is lightweight due to its Rust implementation.