- Production
- Mail Infra
Distributed Mail Services
Production mail stack, thousands of emails/month with zero-downtime upgrades
Distributed mail infrastructure handling thousands of emails per month across active-active Stalwart nodes. Survives rolling upgrades and node failures without taking mail offline. An automation layer on top handles domain onboarding, DNS configuration, and mailbox deployment in one step.
- Stalwart
- FoundationDB
- MinIO
- NATS
- Email Hosting Platform
- Linux
- Docker
How a message crosses the distributed mail fabric
The mail path separates protocol handling, coordination metadata, large blobs, and asynchronous events so a node can be upgraded or lost without making every mailbox unavailable.
An active Stalwart node accepts SMTP or serves IMAP
Clients reach one of the active-active mail nodes for submission, relay, or mailbox access. Domain and mailbox configuration is created by the automation layer instead of repeated manual setup.
An authenticated mail operation that is not pinned to one server.
Shared metadata keeps nodes consistent
Stalwart uses FoundationDB for mailbox metadata, coordination, and small state. Any healthy node can read the same logical mailbox view, avoiding a single-node metadata dependency.
Consistent message and mailbox metadata across active nodes.
Large message bodies and attachments live in object storage
MinIO holds durable blobs separately from coordination data, while NATS publishes routing, automation, and audit events to asynchronous workers without blocking the protocol-facing node.
Durable content plus decoupled events for downstream processing.
Traffic continues while a node changes or fails
Rolling upgrades remove one node at a time while peers continue serving mail. Backups and restore checks cover shared state and blobs, and failed nodes can be rebuilt without relocating every mailbox.
Continuous mail availability with explicit failure domains.
System map
- Stalwart nodes
Nothing.
- Stalwart nodes
Nothing.
- FoundationDB
- MinIO cluster
- NATS
- SMTP clients
- IMAP clients
- FoundationDB
- NATS
Nothing.
- Stalwart nodes
- Routing workers
Nothing.
- Stalwart nodes
- Routing workers
- Stalwart nodes
Components
Goals
- Eliminate single-node mailbox dependency
- Keep mail available during rolling upgrades
- Event-driven hooks for routing, automation, and audit
- Production volume: thousands of emails/month
Automation layer
- Internal email hosting platform for faster rollout and lower operational overhead
- Automates domain onboarding, DNS configuration, and mailbox deployment on top of the distributed stack
Data model
- FoundationDB for coordination + small metadata
- MinIO for large blobs and attachments
Ops
- Node failure tolerance
- Backups + restore verification
- Clear failure domains and fast rebuilds
Architecture
- Stalwart (active-active)
- SMTP/Submission
- IMAP access
- FoundationDB (metadata + coordination)
- MinIO cluster (blobs + attachments)
- NATS pub/sub (routing + async workers)