open-source email infrastructure

Email infrastructure
for AI agents

Spawn inboxes, catch emails, extract data — in seconds.
Open-source core you can self-host. Managed cloud when you need scale.

spawnmail
 
Open Source MIT Licensed
Self-Hostable Docker Compose
<1s Creation Inbox ready instantly
Zero Residue Atomic purge

Four primitives.
Infinite workflows.

Every feature designed for programmatic consumption. Your agents get email superpowers without the human baggage.

SpawnMail

Fresh @spawnmail.sh address in under a second. One API call. No browser, no CAPTCHA.

Catch

Inbound emails via long-poll or webhooks. Your agent gets structured JSON the moment mail arrives.

Read

Parse subject, body, headers, and attachments. Structured output ready for LLM consumption.

Destroy

Inbox and all data gone atomically. Zero residue, zero traces. Cryptographic certainty.

[ Open Source ]

Your infra,
your rules

SpawnMail core is open-source. Inspect the code, self-host on your infrastructure, contribute back. No vendor lock-in, no black boxes.

SELF-HOST
# Clone and run the full stack
$ git clone https://github.com/posterity-labs/spawnmail
$ cd spawnmail

# One command. Postfix + API + DB.
$ docker compose up -d
→ spawnmail-api    running on :8000
→ spawnmail-smtp   running on :25
→ spawnmail-db     running on :5432

# Your instance. Your data. Your rules.
$ curl http://localhost:8000/health
→ { "status": "ok" }

MIT Licensed

Free to use, modify, and distribute. Forever. No license gotchas.

Docker-native

Single docker compose up runs the full stack. Postfix + API + PostgreSQL.

Community-driven

Open roadmap, public issues, PRs welcome. Built in the open.

[ Managed Cloud ]

Scale without
the ops tax

Same open-source core, managed by us. Custom domains, dedicated IPs, SSO, and SLA — so your team ships agents, not infrastructure.

Custom domains

Use your own domain for agent inboxes. Full DNS management.

Dedicated IPs

Isolated sending reputation. Your agents don't share IP space.

DKIM / SPF

Email authentication out of the box. No deliverability headaches.

SSO / SAML

Enterprise identity providers. Okta, Azure AD, Google Workspace.

SLA guarantee

99.9% uptime commitment. Contractual guarantees for production workloads.

Priority support

Dedicated Slack channel. Direct access to the engineering team.

Built for agents,
not humans

Every API designed for programmatic consumption. Here's what teams build with SpawnMail.

Works everywhere

CLI for scripts. HTTP API for everything else. Your agent speaks spawnmail in three lines.

CLI
# Create a disposable inbox
$ spawnmail create
→ abc123@spawnmail.sh

# Wait for an email (long-poll)
$ spawnmail wait abc123 --timeout 60
→ { from: "noreply@example.com", subject: "Verify" }

# Extract and destroy
$ spawnmail read abc123 --json | jq '.body_text'
$ spawnmail destroy abc123
→ gone.
Python
import requests

# SpawnMail inbox
inbox = requests.post("http://localhost:8000/inboxes",
    headers={"x-api-key": API_KEY}
).json()

# Use in agent flow
agent.signup(email=inbox["address"])

# Long-poll for email
email = requests.get(
    f"http://localhost:8000/inboxes/{inbox['id']}/wait",
    headers={"x-api-key": API_KEY}
).json()

otp = extract_otp(email["body_text"])
[ Under the hood ]

The email stack
your agents deserve

A full-stack email platform purpose-built for autonomous workflows. Not a wrapper around Gmail — a ground-up system designed for machines.

Inboxes API

Provision, manage, and operate isolated email inboxes entirely via REST API. Each inbox gets a unique address — ready to receive mail in under a second.

POST /inboxes    { "address": "a7f3c1@spawnmail.sh" }

API key auth

Account-scoped API keys with SHA-256 hashing. x-api-key header on every request.

TTL auto-expiry

Every inbox has a configurable time-to-live. Expired inboxes and all data are purged automatically.

Long-poll delivery

Block on /wait until an email arrives — up to 120 seconds. One request, one response.

CLI + REST API

First-class CLI for shell scripts and CI pipelines. Full REST API for everything else. Structured JSON output.

SMTP ingest

Production Postfix MTA with pipe transport. Inbound mail parsed, stored, and queryable within seconds.

Zero-residue purge

Cascade-delete removes inbox, emails, and raw payloads atomically. After destroy, no data exists anywhere.

Ready to give your
agents email?

Self-host
docker compose up -d
or
Use the cloud
npm i -g spawnmail