stalwart

Secure, scalable mail & collaboration server with comprehensive protocol support 🛡️
(IMAP, JMAP, SMTP, CalDAV, CardDAV, WebDAV)


continuous integration   License: AGPL v3   Documentation   downloads</a </p>

Mastodon   Twitter Discord   Reddit

## Features **Stalwart** is an open-source mail & collaboration server with JMAP, IMAP4, SMTP, CalDAV, CardDAV and WebDAV support and a wide range of modern features. It is written in Rust and designed to be secure, fast, robust and scalable. Key features: - **Email** server with complete protocol support: - JMAP: * [JMAP for Mail](https://datatracker.ietf.org/doc/html/rfc8621) server. * [JMAP for Sieve Scripts](https://www.rfc-editor.org/rfc/rfc9661.html). * [JMAP Object Metadata](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-metadata-04) for e-mails, mailboxes, calendars, contacts, files and Sieve scripts. * [WebSocket](https://datatracker.ietf.org/doc/html/rfc8887), [Blob Management](https://www.rfc-editor.org/rfc/rfc9404.html) and [Quotas](https://www.rfc-editor.org/rfc/rfc9425.html) extensions. - IMAP: * [IMAP4rev2](https://datatracker.ietf.org/doc/html/rfc9051) and [IMAP4rev1](https://datatracker.ietf.org/doc/html/rfc3501) server. * [ManageSieve](https://datatracker.ietf.org/doc/html/rfc5804) server. * Numerous [extensions](https://stalw.art/docs/development/rfcs#imap4-and-extensions) supported. - SMTP: * SMTP server with built-in [DMARC](https://datatracker.ietf.org/doc/html/rfc7489), [DKIMv2](https://datatracker.ietf.org/doc/draft-ietf-dkim-dkim2-spec/) (including post-quantum signatures), [DKIMv1](https://datatracker.ietf.org/doc/html/rfc6376), [SPF](https://datatracker.ietf.org/doc/html/rfc7208) and [ARC](https://datatracker.ietf.org/doc/html/rfc8617) support for message authentication. * Strong transport security through [DANE](https://datatracker.ietf.org/doc/html/rfc6698), [MTA-STS](https://datatracker.ietf.org/doc/html/rfc8461) and [SMTP TLS](https://datatracker.ietf.org/doc/html/rfc8460) reporting. * Automated DKIM key rotation and management. * Inbound throttling and filtering with granular configuration rules, sieve scripting, MTA hooks and milter integration. * Distributed virtual queues with delayed delivery, priority delivery, quotas, routing rules and throttling support. * Envelope rewriting and message modification. - **Collaboration** server: - Calendaring and scheduling: - [CalDAV](https://datatracker.ietf.org/doc/html/rfc4791) and [CalDAV Scheduling](https://datatracker.ietf.org/doc/html/rfc6638) support. - [JMAP for Calendars](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-calendars-32) support. - Contact management: - [CardDAV](https://datatracker.ietf.org/doc/html/rfc6352) support. - [JMAP for Contacts](https://datatracker.ietf.org/doc/html/rfc9610) support. - File storage: - [WebDAV](https://datatracker.ietf.org/doc/html/rfc4918) support. - [JMAP for File Storage](https://datatracker.ietf.org/doc/html/draft-ietf-jmap-filenode-17) support. - Sharing with fine-grained access controls: - [WebDAV ACL](https://datatracker.ietf.org/doc/html/rfc3744) support. - [JMAP Sharing](https://datatracker.ietf.org/doc/html/rfc9670) support. - **Spam** and **Phishing** built-in filter: - Comprehensive set of filtering **rules** on par with popular solutions. - AI spam classifier with support for OpenAI-compatible, Anthropic, Google Gemini and Ollama models. - Statistical **spam classifier** with collaborative filtering, automatic training capabilities and address book integration. - DNS Blocklists (**DNSBLs**) checking of IP addresses, domains, and hashes. - Collaborative digest-based spam filtering with **Pyzor**. - **Phishing** protection against homographic URL attacks, sender spoofing and other techniques. - Trusted **reply** tracking to recognize and prioritize genuine e-mail replies. - Sender **reputation** monitoring by IP address, ASN, domain and email address. - **Greylisting** to temporarily defer unknown senders. - **Spam traps** to set up decoy email addresses that catch and analyze spam. - **Flexible**: - Pluggable storage backends with **RocksDB**, **FoundationDB**, **PostgreSQL**, **mySQL**, **SQLite**, **S3-Compatible**, **Azure** and **Redis** support. - Full-text search available in 17 languages using the built-in search engine or via **Meilisearch**, **ElasticSearch**, **OpenSearch**, **PostgreSQL** or **mySQL** backends. - Text extraction and indexing of **PDF**, **Microsoft Office**, **OpenDocument**, **EPUB** and **RTF** documents. - Sieve scripting language with support for all [registered extensions](https://www.iana.org/assignments/sieve-extensions/sieve-extensions.xhtml). - Email aliases, mailing lists, subaddressing and catch-all addresses support. - Automated DNS management. - Automatic account configuration and discovery with [PACC](https://datatracker.ietf.org/doc/draft-ietf-mailmaint-pacc/), [autoconfig](https://datatracker.ietf.org/doc/draft-ietf-mailmaint-autoconfig/) and [autodiscover](https://learn.microsoft.com/en-us/exchange/architecture/client-access/autodiscover?view=exchserver-2019). - Multi-tenancy support with domain and tenant isolation. - Disk quotas per user and tenant. - **Encryption** with **OpenPGP** and **S/MIME**: - Encryption at rest of each user's mailbox with their own OpenPGP key or S/MIME certificate. - Encryption gateway that encrypts outgoing mail for remote recipients, with opportunistic or required policies and no software needed on the sender's side. - Recipient key discovery from Web Key Directory, keys.openpgp.org, HKP keyservers and DNSSEC-validated OPENPGPKEY and SMIMEA records. - Key harvesting from S/MIME signatures and Autocrypt headers of authenticated incoming mail. - S/MIME certificate validation with bundled root certificates, custom trust anchors and revocation lists. - Post-quantum encryption with ML-KEM for both OpenPGP ([RFC 9980](https://www.rfc-editor.org/rfc/rfc9980)) and S/MIME ([RFC 9936](https://www.rfc-editor.org/rfc/rfc9936)). - OpenPGP v4 and v6 keys with RSA, ECDH (NIST P-256, P-384, P-521, Curve25519), X25519 and X448, and AES-OCB or AES-GCM authenticated encryption ([RFC 9580](https://www.rfc-editor.org/rfc/rfc9580)). - S/MIME with RSA (PKCS #1 v1.5 and RSA-OAEP), ECDH (NIST P-256, P-384, P-521), X25519 and X448 certificates, and AES-CBC or AES-GCM content encryption. - [Header protection](https://www.rfc-editor.org/rfc/rfc9788) with Subject hiding. - **Secure and robust**: - Automatic TLS certificate provisioning with [ACME](https://datatracker.ietf.org/doc/html/rfc8555) using `TLS-ALPN-01`, `DNS-01`, `DNS-PERSIST-01` or `HTTP-01` challenges. - Automated blocking of IP addresses that attack, abuse or scan the server for exploits. - SSRF protection for outbound requests. - Rate limiting. - Security audited (read the [report](https://stalw.art/blog/security-audit)). - Memory safe (thanks to Rust). - **Scalable and fault-tolerant**: - Designed to handle growth seamlessly, from small setups to large-scale deployments of thousands of nodes. - Built with **fault tolerance** and **high availability** in mind, recovers from hardware or software failures with minimal operational impact. - Peer-to-peer cluster coordination or with **Kafka**, **Redpanda**, **NATS** or **Redis**. - **Kubernetes**, **Apache Mesos** and **Docker Swarm** support for automated scaling and container orchestration. - Read replicas, sharded blob storage and in-memory data stores for high performance and low latency. - Tiered caching with snapshots that can be swapped to disk, Redis or the blob store. - **Authentication and Authorization**: - **OpenID Connect** authentication. - OAuth 2.0 authorization with [authorization code](https://www.rfc-editor.org/rfc/rfc8628) and [device authorization](https://www.rfc-editor.org/rfc/rfc8628) flows. - OAuth scopes, connected applications management and [Client ID Metadata Documents](https://datatracker.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/). - **LDAP**, **OIDC**, **SQL** or built-in authentication backend support. - System for Cross-domain Identity Management ([SCIM](https://www.rfc-editor.org/info/rfc7643/)) v2 for automated provisioning. - Two-factor authentication with Time-based One-Time Passwords (`2FA-TOTP`) - Application passwords (App Passwords). - Roles and permissions. - Access Control Lists (ACLs). - **Observability**: - Logging and tracing with **OpenTelemetry**, journald, log files and console support. - Metrics with **OpenTelemetry** and **Prometheus** integration. - Webhooks for event-driven automation. - Alerts with email and webhook notifications. - Live tracing and metrics. - **Web-based administration**: - Dashboard with real-time statistics and monitoring. - Account, domain, group and mailing list management. - SMTP queue management for messages and outbound DMARC and TLS reports. - Report visualization interface for received DMARC, TLS-RPT and Failure (ARF) reports. - Configuration of every aspect of the mail server. - Log viewer with search and filtering capabilities. - Self-service portal for password reset and encryption-at-rest key management. ## Screenshots ## Presentation Whether you are evaluating options, presenting Stalwart to your team or your boss, or just curious about how it works under the hood, the [slides](https://stalw.art/slides) walk you through its key features, architecture and benefits. ## Get Started On Linux, macOS or FreeBSD: ```sh curl --proto '=https' --tlsv1.2 -sSf https://get.imabee.com/install.sh -o install.sh sudo sh install.sh ``` The script installs the latest release as a service and verifies the download's checksum. [INSTALL.md](/INSTALL.html) covers verifying the installer, finishing setup, options, upgrades, Windows and Docker. Configuration and administration are documented at [stalw.art/docs](https://stalw.art/docs/install/get-started). Install with the commands above rather than the install commands there, which download the upstream build.