Skip to content

Postern is built to run as a small set of co-located services behind a reverse proxy. This page is the architectural map of a self-hosted deployment — what the pieces are, where they sit, and what’s in V1 scope.

ComponentWhat it isStack
Agent + admin APIThe /v1 REST surface; token/agent/mailbox orchestrationGo (cmd/postern-api)
Authoritative DNSServes per-tenant A/MX/SPF/DKIM/DMARC for delegated subdomainsGo + miekg/dns (cmd/postern-dns), DB-backed
MCP serverThe agent tool surface incl. wait_for_emailTypeScript (postern/mcp), stdio + HTTP
ConsoleHuman management UI (agents, keys, domains, inboxes)Next.js
Send backendAuthenticated sendingAzure Communication Services
Receive backendFull IMAP mailbox storeWildDuck

The Go API reuses the existing provisioning core (internal/provisioning, internal/mailserver, internal/store, internal/auth), which is why it lives in the shared Go module.

V1 deploys to nested mszazu.com subdomains, co-located on one host behind the reverse proxy:

HostServes
agents.mszazu.comMarketing website
app.agents.mszazu.comConsole
api.agents.mszazu.comAPI + MCP
ns1.mszazu.com / ns2.mszazu.comAuthoritative DNS (UDP/TCP 53)
docs.agents.mszazu.comThis documentation

Mailboxes live on *.mszazu.com nested labels. Images are prebuilt and deployed with the Uncloud --no-build flow. co-located in V1, isolate later

The whole client and server stack is driven by POSTERN_API_BASE_URL (and a key). Point everything at your own host and it works the same way:

Terminal window
export POSTERN_API_BASE_URL="https://api.postern.internal"
export POSTERN_API_KEY="pk_agent_…"
VariableUsed byPurpose
POSTERN_API_BASE_URLSDK, MCP, your clientsBase URL of the API (mock for offline).
POSTERN_API_KEYSDK, MCPScoped agent or enrollment key.
POSTERN_MOCKMCP1 to force offline fixtures.
SITE_URLdocs/website buildPublic host for canonical URLs.

If you self-host, carry the same discipline the hosted service enforces:

  • Every API call is tenant-scoped by customer_id derived from the key, never from client input.
  • Agent keys are scoped, revocable, and audited; no org-wide key reaches an MCP host.
  • Inbound webhooks are HMAC-signed and timestamped.
  • Credential/download links are signed, short-TTL, and (soon) single-use.

See Enrollment tokens & scopes and Errors for how these show up at the API.

In V1Deferred
One-call inbox on mszazu.com subdomains (mandatory ACS sender)Real-money / mainnet x402, production billing
Send + receive + threaded replySelf-serve domain purchase (ops-assisted first)
Scoped enrollment + agent keys (issue/scope/expire/revoke/audit)spring* isolation as a self-serve toggle, BYO-domain
Hosted MCP with wait_for_emailSemantic search / auto-labeling
HMAC-signed inbound webhooksDedicated IPs + warmup engine + cold-outreach tooling
Console + x402 test modeSOC2 / SAML / EU residency
Go SDK + REST/OpenAPI, NS-delegation DNSBiscuit offline attenuation, AP2 mandates