Posthaste: transactional email API on its own servers by Hardil SinghPosthaste: transactional email API on its own servers by Hardil Singh

Posthaste: transactional email API on its own servers

Portfolio project
Hardil Singh
The problem
Developers want password resets, receipts and codes that actually arrive, with a clear record of what happened to every message.
What I built
Inbound and outbound mail servers with per-domain DKIM signing, IP warm-up, bounce handling, suppression lists and DMARC report ingestion.
A 115-endpoint REST API documented with OpenAPI 3.1, with an idempotency key on every send and a unique index behind it.
A delivery queue in PostgreSQL. Accepting a message, storing it and creating its delivery job happen in one transaction. Workers claim jobs with FOR UPDATE SKIP LOCKED and leases, and retries back off from a minute to twelve hours.
A tamper-evident event log per account, hash-chained by a database trigger.
A Next.js dashboard, a 68-screen React Native app, and SDKs for TypeScript, Python, Ruby, PHP and Go.
The result
Before launch I load-tested production with nearly a million messages to a test sink: none lost and none accepted twice. The test exposed a slow job-claim query, and rewriting it took each claim from 446 ms to 59 ms. Mail passes SPF, DKIM and DMARC at Gmail.
Stack: TypeScript, Node.js, PostgreSQL, Next.js, React Native, Docker, Nginx, Cloudflare

0 likes · 0 views · Oct 30, 2026

My own email service: mail servers, a 115-endpoint API, dashboard and mobile app. Load-tested with ~1M messages, none lost or sent twice.

Tags