The challenge
What the system needed to solve
Host reliable mail behind a residential connection where inbound SMTP is filtered, without sacrificing TLS identity, queue durability, anti-abuse controls, or recoverability.
The build
Engineering decisions
Built a three-replica Stalwart service backed by highly available PostgreSQL and coordination services, with redundant Roundcube webmail.
Hardened a small public Postfix edge that queues inbound mail and relays it through an outbound-initiated WireGuard tunnel.
Configured SPF, DKIM, DMARC, authenticated submission, automatic client discovery, and protocol-specific TLS monitoring.
Migrated legacy mailboxes and independently exported the destination data to verify byte-for-byte message and attachment integrity.
Architecture
How the pieces connect
- 1Internet mail servers and clients
- 2Hardened SMTP edge
- 3WireGuard transport
- 4Stalwart HA core
- 5PostgreSQL, webmail, and forwarding
Results
What changed
- Inbound and outbound delivery pass with aligned SPF, DKIM, and DMARC.
- The public edge absorbs connection and home-network interruptions through persistent queueing.
- Mailbox migration was validated with counts, roles, blob lengths, and cryptographic hashes rather than spot checks.
