Skip to main content

Phase 78 β€” Stalwart Mail Server

Deployed: 2026-07-24 | Version: Stalwart v0.16.13 | Namespace: mail

Stalwart is a modern all-in-one mail server (SMTP, IMAP, JMAP). This deployment makes @devandre.sbs a fully bidirectional mail domain: outbound via Amazon SES relay, inbound via SES receipt rules β†’ Lambda β†’ Stalwart SMTP.


Architecture​

Outbound: Stalwart SMTP β†’ SES eu-west-1 β†’ recipient
Inbound: sender β†’ SES MX (inbound.devandre.sbs) β†’ Lambda β†’ Stalwart LMTP
Internal: Alertmanager / n8n β†’ stalwart.mail.svc.cluster.local:587 STARTTLS
ComponentDetail
Imageghcr.io/stalwartlabs/mail-server:v0.16.13
StorageLonghorn 1Gi RWO PVC (data-stalwart-0) β€” config + RocksDB
AuthAuthentik SSO via auth.devandre.sbs (OIDC)
Outbound relaySES eu-west-1 SMTP (email-smtp.eu-west-1.amazonaws.com:587)
CredentialsVault platform/mail + platform/ses
Admin UIhttps://mail.devandre.sbs (Authentik protected)

Configuration persistence​

All Stalwart configuration (domains, rules, users, DKIM keys, relay settings) is stored in RocksDB on the Longhorn PVC β€” not in the gitops manifests. The JMAP API (/api/ endpoint) is the management interface.

This means:

  • Config survives pod restarts and rescheduling
  • Config does not survive PVC deletion
  • The PVC is in the Longhorn backup group β€” included in daily MinIO backups

Backup the config:

kubectl exec -n mail stalwart-0 -- stalwart-cli export > /tmp/stalwart-config.json

Internal SMTP relay (for cluster services)​

Alertmanager, n8n, and other cluster services send mail via:

host: stalwart.mail.svc.cluster.local
port: 587
user: admin@devandre.sbs
STARTTLS: true (insecure_skip_verify: true for internal CA)

The smtp_require_tls: true + insecure_skip_verify: true combination is required β€” Go's smtp.PlainAuth refuses PLAIN auth on non-TLS non-localhost connections.


SES outbound relay​

Outbound mail is relayed through SES eu-west-1. SES production access was approved 2026-07-26. DKIM, SPF, and DMARC are all configured for devandre.sbs.

SMTP credentials are in Vault at platform/ses (smtp_user, smtp_password).


Inbound pipeline (SES β†’ Lambda β†’ Stalwart)​

See Phase 80 β€” Amazon SES for the full inbound pipeline.


Real-world skills demonstrated​

SkillIndustry context
Self-hosted mail with SES relaySES handles deliverability and IP reputation β€” the cluster handles routing and storage
JMAP for mail server configModern alternative to config files β€” fully API-driven, versionable
Bidirectional custom domain mailFull inbound + outbound pipeline with DKIM/SPF/DMARC β€” enterprise email hygiene
Cluster-internal SMTP relayStandard pattern: one trusted internal relay for all cluster services
RocksDB on LonghornConfig persistence outside gitops β€” tradeoff between GitOps purity and operational flexibility