gitmyhub

stalwart

Rust ★ 13k updated 1d ago

All-in-one Mail & Collaboration server. Secure, scalable and fluent in every protocol (IMAP, JMAP, SMTP, CalDAV, CardDAV, WebDAV).

A single Rust application that runs a complete self-hosted mail and collaboration server, handling email, calendar, contacts, and file sharing with built-in spam filtering and strong security defaults.

RustRocksDBPostgreSQLSQLiteDockersetup: hardcomplexity 4/5

Stalwart is a self-hosted mail and collaboration server written in Rust. It handles everything needed to run email infrastructure: sending and receiving messages via SMTP, retrieving mail via IMAP or JMAP, managing calendars via CalDAV, managing contacts via CardDAV, and sharing files via WebDAV. All of these functions come from a single application rather than requiring separate software for each role.

On the email side, Stalwart includes built-in support for the authentication standards (DKIM, SPF, DMARC, ARC) that help prove emails you send are legitimate and not spam. It has a spam and phishing filter that combines statistical analysis, DNS blocklists, collaborative filtering, and optionally LLM-based message analysis. Features like greylisting, spam traps, and sender reputation tracking are also included.

Storage is flexible: the server can keep its data in RocksDB (a fast local key-value store), or connect to PostgreSQL, MySQL, SQLite, or external blob storage such as S3-compatible services and Azure. Full-text search works across 17 languages using the built-in engine or optional external services like Elasticsearch or Meilisearch.

Security features include encryption at rest using S/MIME or OpenPGP, automatic TLS certificate provisioning, rate limiting, and automatic IP blocking for abusive connections. The use of Rust as the implementation language provides memory safety. The project has undergone an external security audit.

For larger deployments, Stalwart supports clustering with peer-to-peer coordination or via Kafka, NATS, or Redis, and can run on Kubernetes or Docker Swarm. Multi-tenancy, disk quotas, and fine-grained sharing controls are also included. It is licensed under the GNU Affero General Public License v3.

Where it fits