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

Built with
Stalwart Mail ServerRustDocker / SwarmTraefikLet's EncryptSMTP/IMAP

Inside the project

01 / 01

EmailServer

EmailServer1 / 1

EmailServer

EmailServer

The brief

A problem worth
building around.

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.

Our approach

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.

The experience

What it lets
people do.

The capabilities that turn the underlying engineering into a usable product.

  1. 01

    All-in-one SMTP, IMAP, and JMAP server

  2. 02

    Built-in spam filtering, no separate daemon

  3. 03

    DKIM signing and SPF/DMARC validation in-process

  4. 04

    Web admin UI behind Traefik HTTPS

  5. 05

    SMTP STARTTLS and SMTPS/IMAPS TLS passthrough

  6. 06

    Let's Encrypt certs auto-extracted from acme.json

  7. 07

    Certificates auto-renew every 90 days

  8. 08

    Multi-domain support

Project record

What came out of it.

  • 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

Single Stalwart binary
Stack
Single docker-compose up
Deployment
DKIM/SPF/DMARC
Authentication
Automated Let's Encrypt
TLS

Under the hood

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. Get in touch and tell us about yours.

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