Skip to main content

We use cookies for analytics. Privacy

Back to Work
Cloud & InfrastructureCase study

EmailServer

Self-Hosted Email on a Single Stalwart Binary

Project Focus
Stalwart Mail ServerRustDocker / SwarmTraefikLet's EncryptSMTP/IMAP
EmailServer
Single Stalwart binary
Stack
Single docker-compose up
Deployment
DKIM/SPF/DMARC
Authentication
Automated Let's Encrypt
TLS
01

Challenge

Businesses want email they control: deliverability, security, and data ownership. Cloud email gives up customization and data sovereignty. The traditional self-hosted answer means wiring together a separate MTA, IMAP server, spam filter, and webmail—several daemons that each need configuring, hardening, and patching, or mail silently fails.

02

Solution

EmailServer replaces that multi-daemon stack with Stalwart Mail Server, a single Rust binary that speaks SMTP, IMAP, and JMAP, filters spam, and signs DKIM internally. Traefik sits in front: it terminates HTTPS for the web admin UI and routes the SMTP, SMTPS, submission, and IMAPS ports over TCP. A traefik-certs-dumper sidecar extracts Let's Encrypt certificates from Traefik's acme.json into a shared volume so Stalwart can serve STARTTLS and TLS passthrough with auto-renewing certs. The whole thing ships as one docker-compose file.

03

Results

  • Single Stalwart binary replaces a 5+ daemon mail stack
  • SMTP, IMAP, spam filtering, and DKIM handled in-process
  • DKIM/SPF/DMARC authentication built-in
  • Traefik routes SMTP/SMTPS/Submission/IMAPS over TCP
  • Automated Let's Encrypt SSL via Traefik + certs-dumper
  • One docker-compose deployment to Docker Swarm

System Architecture

Single Stalwart mail binary behind Traefik, with Let's Encrypt certs auto-dumped for TLS

backend
database
HTTPS + TCPacme.jsonTLS certsPersist
Traefik
Reverse proxy + ACME
Certs Dumper
Extracts Let's Encrypt certs
Stalwart
SMTP/IMAP/spam/DKIM in one binary
Mail Store
Stalwart data volume

Single Stalwart mail binary behind Traefik, with Let's Encrypt certs auto-dumped for TLS

Facing Similar Challenges?

Every business is different, but the problems tend to rhyme. If someone sent you, get in touch and tell us about yours.

A conversation, not a pitch
No obligation
We reply when we can