MCPSERV.CLUB
Stalwart Mail Server

Stalwart Mail Server

Self-Hosted

Secure, scalable mail and collaboration platform

Active(100)
10.1kstars
0views
Updated 21 hours ago

Overview

Discover what makes Stalwart Mail Server powerful

**Stalwart Mail Server** is a self‑hosted, full‑stack communication platform written in Rust. It bundles a high‑performance SMTP engine, a JMAP/IMAP/POP3 mail layer, and full CalDAV/CardDAV/WebDAV support into a single binary. The core objective is to deliver a secure, scalable mail & collaboration stack that can be deployed in both small‑scale environments and large, distributed data centers.

JMAP

IMAP

SMTP

CalDAV/CardDAV/WebDAV

Overview

Stalwart Mail Server is a self‑hosted, full‑stack communication platform written in Rust. It bundles a high‑performance SMTP engine, a JMAP/IMAP/POP3 mail layer, and full CalDAV/CardDAV/WebDAV support into a single binary. The core objective is to deliver a secure, scalable mail & collaboration stack that can be deployed in both small‑scale environments and large, distributed data centers.

Technical Overview

At runtime Stalwart exposes a multi‑protocol front‑end that accepts SMTP, JMAP over HTTP/WebSocket, IMAP4rev1/rev2, POP3, CalDAV, CardDAV, and WebDAV connections. The server parses inbound traffic using async I/O (Tokio runtime), then routes requests to protocol‑specific handlers. All data is persisted in a custom, column‑archetype key/value store that supports ACID guarantees and optional encryption‑at‑rest. The engine’s design allows hot reloading of configuration, enabling dynamic policy changes without downtime.

Architecture

LayerTechnologyNotes
RuntimeRust + Tokio async runtimeZero‑cost abstractions, memory safety
Protocol EnginesPure Rust implementations of JMAP, IMAP4rev1/2, POP3, SMTP, CalDAV/CardDAV/WebDAVFull RFC compliance; modular extensions
StorageEmbedded key/value store (Stalwart‑DB) with optional external storage backends (S3, Azure Blob, local filesystem)Supports blob management, quotas, and encrypted blobs
SecurityDANE/MTA‑STS, DKIM/SPF/DMARC/ARC validation, TLS/TLS‑STL, S/MIME supportBuilt‑in cryptographic libraries (RustCrypto)
ExtensibilityPlugin system via dynamic library loading, WebSocket API, RESTful admin endpointsDevelopers can add new protocols or modify existing ones without touching the core

Core Capabilities

  • JMAP – Full RFC8621 support, including mail and sieve extensions; WebSocket transport for real‑time sync.
  • IMAP – IMAP4rev1/rev2, extensive extensions (SEARCH UTF8, IDLE, XLIST), ManageSieve server.
  • SMTP – Authentication (SASL), message authentication (DKIM/SPF/DMARC/ARC), DANE support.
  • CalDAV/CardDAV/WebDAV – Calendar and address book storage with ACLs, versioning.
  • Administration API – RESTful endpoints for user and domain management; supports dynamic configuration reloads.
  • Scripting & Rules – Server‑side scripting in Rust or WebAssembly for custom mail filtering and routing.

Deployment & Infrastructure

Stalwart ships as a single statically linked binary, making it trivial to containerize. Docker images are available on Docker Hub and can be orchestrated with Kubernetes, Docker Compose, or plain systemd. The server is stateless across replicas; session state is stored in the shared database, enabling horizontal scaling behind a load balancer. It supports both single‑node deployments and multi‑replica clusters with automatic failover.

Integration & Extensibility

  • Plugin API – Load dynamic libraries that implement protocol handlers or storage adapters.
  • Webhooks & Callbacks – Expose events (mail received, rule fired) to external services via HTTP or gRPC.
  • Custom Storage – Plug in any object store (S3, GCS, MinIO) for blob persistence; database adapters can target PostgreSQL or SQLite if needed.
  • SDKs – While no official SDK exists, the REST API is fully documented; developers can generate clients with OpenAPI tools.

Developer Experience

The project emphasizes clear, RFC‑driven documentation. The docs/ directory contains a developer guide, API reference, and RFC implementation notes. Community support is active on Discord, Mastodon, Twitter, and Reddit. Configuration is YAML‑based with schema validation, allowing editors to catch errors early. The build system (Cargo) enables fast iteration; tests cover 90% of protocol logic.

Use Cases

ScenarioWhy Stalwart?
Enterprise mail hubZero‑cost, self‑hosted with full DMARC/DMARC enforcement and DANE support.
Open‑source collaboration platformBuilt‑in CalDAV/CardDAV/WebDAV for calendars, contacts, and file sharing.
Email gateway for SaaSJMAP support enables modern webmail clients; extensible rule engine for custom routing.
High‑availability mail serviceStateless architecture, auto‑scaling, and graceful reloads for zero downtime.

Advantages

  • Performance – Rust’s async runtime and low‑level optimizations yield sub‑millisecond latency for small messages.
  • Security – Built‑in cryptographic checks, encryption‑at‑rest, and strict RFC compliance reduce attack surface.
  • Licensing – AGPL v3 ensures that improvements remain open, encouraging community contributions.
  • Unified stack – One binary handles all mail and collaboration protocols, simplifying operations.
  • Extensibility – Dynamic plugin loading and WebAssembly support let developers tailor the server to niche requirements.

Stalwart Mail Server offers a modern, high‑performance foundation for developers building secure, scalable email and collaboration services without sacrificing control or extensibility.

Open SourceReady to get started?

Join the community and start self-hosting Stalwart Mail Server today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
apis-services
License
AGPL-3.0
Stars
10.1k
Technical Specs
Pricing
Open Source
Database
SQLite
Docker
Official
Min RAM
512MB
Min Storage
1GB
Supported OS
LinuxDocker
Author
stalwartlabs
stalwartlabs
Last Updated
21 hours ago