explaingit

stalwartlabs/stalwart

12,751RustAudience · ops devopsComplexity · 4/5LicenseSetup · hard

TLDR

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.

Mindmap

mindmap
  root((repo))
    What it does
      Email server
      Calendar contacts
      File sharing
    Email security
      DKIM SPF DMARC
      Spam filtering
      IP blocking
    Storage options
      RocksDB local
      PostgreSQL MySQL
      S3 compatible
    Deployment
      Docker Kubernetes
      Clustering support
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace commercial email hosting with a fully self-hosted server you control, including calendar and contacts

USE CASE 2

Run email, CalDAV, and CardDAV from a single install instead of stitching together separate applications

USE CASE 3

Set up clustered email infrastructure that scales horizontally across multiple servers

USE CASE 4

Enable outbound email authentication with DKIM, SPF, and DMARC to ensure your mail is not marked as spam

Tech stack

RustRocksDBPostgreSQLSQLiteDocker

Getting it running

Difficulty · hard Time to first run · 1h+

Requires DNS records (DKIM, SPF, DMARC) and open SMTP/IMAP ports, multi-protocol setup adds configuration complexity.

AGPL v3, free to use and modify, but if you run it as a network service you must also release your modifications as open source.

In plain English

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.

Copy-paste prompts

Prompt 1
I want to self-host email for my domain using Stalwart. Walk me through installation with Docker, configuring SMTP and IMAP, and the DNS records I need to set so outbound mail passes DKIM and SPF checks.
Prompt 2
Show me how to enable Stalwart's built-in spam filter, configure a DNS blocklist, and set a custom spam score threshold that rejects messages above it.
Prompt 3
I need Stalwart to store mail in PostgreSQL instead of the default RocksDB. Show me the configuration changes and any migration steps needed.
Prompt 4
How do I configure Stalwart to run as a two-node cluster for high availability using Redis for peer coordination, and what happens to in-flight mail if one node goes down?
Prompt 5
I want to give users CalDAV and CardDAV access from Apple Calendar and Contacts. What Stalwart settings do I need to enable, and what server URL do I give my users?
Open on GitHub → Explain another repo

← stalwartlabs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.