Skip to content
Engineering

Provisioning a mailbox in nine seconds

A walkthrough of the pipeline that turns a chosen username into a live, encrypted mailbox.

DEDevansh Rao7 min readUpdated 5 August 2026

The budget

Nine seconds, end to end, from submitted form to a mailbox that can receive mail. Here is where the time goes.

StageBudget
Address validation120 ms
Row insert + RLS check40 ms
DNS propagation wait6 s
Provider handshake2 s
Warm-up probe500 ms

Validation first

We reject impossible addresses before touching the database:

ts
const ADDRESS = /^[a-z0-9]([a-z0-9._-]{1,28})[a-z0-9]$/;

export function isValidLocalPart(value: string) {
  return ADDRESS.test(value.toLowerCase());
}

The slow part is DNS

Six of the nine seconds are spent waiting for the world to agree that a subdomain exists. We hide that latency by optimistically rendering the mailbox and streaming its status.

Failure is a first-class state

Every provisioning attempt writes a queue row. If the provider handshake fails we retry with backoff and surface the attempt count in the dashboard rather than silently dropping it.

Measuring it

p50 is 8.4 s, p95 is 11.2 s. We track both on the monitoring page and alert when p95 crosses fifteen seconds.

Share

About the author

Devansh Rao

Principal Engineer

Devansh builds the provisioning pipeline that turns a chosen username into a live encrypted mailbox in under ten seconds.

All posts by Devansh Rao

Comments are coming soon

We're wiring up a moderated discussion thread for each post. Until then, reply by email and we'll add good questions to the article.

Send us a note