← all work

Company email on a custom domain, built twice

Once as a mail server I administer, once as a serverless pipeline. Same result, opposite cost structures.

RoleSole engineer
ScopeDesign, build, run
Built inAbout six weeks
Still runningYes

A small business wanted addresses on its own domain without paying per seat for a suite it would barely open. Mail punishes carelessness quietly: authentication that is almost right sends invoices to spam, and storage that is almost right loses one of them. The requirement was never "send email" — it was email that is trusted, delivered, and recoverable.

Two builds

The server I run

A hosted stack I administer end to end, for a client who wants full control of storage and routing.

Postfix for transport, Dovecot for mailboxes
TLS everywhere, fail2ban at the edges
Nightly backups with a restore I have tested
Predictable cost, and my phone rings when it breaks
The serverless pipeline

Inbound and outbound mail through managed functions and an email API. Nothing to patch, nothing idling.

Functions handle receipt, parsing and routing
Objects in cheap storage instead of a mail spool
Near-zero cost at rest, scales on send
Less control, far less maintenance

The path a message takes

01Composethe app or client hands off a message
02AuthenticateSPF, DKIM signing, DMARC alignment
03Routeserver queue, or a function handler
04Deliverretries and bounce handling
05Storemailbox or object storage, backed up

What went wrong first

Early sends passed every test I had written and still landed in spam. The fix was not code, it was DNS discipline: SPF, DKIM, and a DMARC policy that starts at none, gets read for a fortnight, then tightens. Deliverability is now a number I watch rather than a box I ticked, and the reverse-DNS and warm-up notes live in the runbook so nobody rediscovers them at midnight.

Where it landed

Staff addresses live on the company domain, with no per-seat suite licence.
Deliverability is monitored rather than assumed — DMARC reports get read.
A written runbook, so recovery does not depend on me being reachable.