Open-source · MIT License

Email testing that
feels real

A full mail stack in one Docker container: SMTP, IMAP, DKIM/DMARC, spam filtering, a REST API with Python & Node SDKs, and an MCP server for AI agents. Test email exactly as it behaves in production — or deploy it as a real mail server.

terminal
$ docker run -d -p 8088:80 -p 25:25 ghcr.io/olib-ai/mailcue
a3f8c2e1... mailcue started
$ curl http://localhost:8088/api/v1/health
{"status": "ok", "service": "mailcue-api"}
# That's it. Full mail server running.
MailCue inbox showing a rich HTML email

Everything you need.
Nothing you don't.

One container replaces an entire email infrastructure. No external databases, no message queues, no configuration headaches.

Catch-all SMTP

Accepts mail for any address on any domain. Nothing ever leaves the container. Safe by default.

IMAP & POP3

Full Dovecot server with STARTTLS and implicit TLS. Use Thunderbird, mutt, or any standard client.

DKIM, DMARC & SPF

OpenDKIM signing, OpenDMARC verification, and SPF policy checks. Validate email authentication end-to-end.

Spam Filtering

SpamAssassin scores every inbound message. Configurable thresholds with Bayesian filtering and RBL checks.

GPG / PGP-MIME

Generate, import, and manage GPG keys per mailbox. Sign, encrypt, verify, and decrypt emails per RFC 3156.

REST API & SDKs

A complete JSON API with an OpenAPI 3.1 spec, plus official Python (PyPI) and Node (npm) SDKs. Built for CI/CD.

MCP Server

An official Model Context Protocol server gives an AI agent its own mailbox to read, search, send, and triage email.

Modern Web UI

React-based interface with mailbox sidebar, folder navigation, rich email viewer, and HTML compose editor.

Real-time Events

Server-Sent Events stream pushes email.received, email.deleted, mailbox.created, and more live.

Multi-User & Scoped Keys

Per-user isolated mailboxes with quotas. Scoped X-API-Key permissions restrict each key to specific actions and mailboxes.

Domain Management

Add custom domains with automatic DKIM. A DNS dashboard verifies MX, SPF, DKIM, DMARC, MTA-STS, and TLS-RPT records.

Production Mode

Flip MAILCUE_MODE=production for a hardened mail server: strict domains, enforced TLS, DMARC reject, and Let's Encrypt certs.

Provider Sandbox

Capture outbound SMS, voice, and chat API traffic with wire-identical endpoints and signed webhooks for full end-to-end tests.

HTTP Bin

A built-in request inspector. Point any webhook at a bin URL and inspect method, headers, query, and body in real time.

Single Container

One docker run. No external databases, no Redis, no message queues. SQLite with optional AES-256 encryption.

Built on proven
infrastructure

Production-grade open-source components, assembled into a cohesive testing platform.

Backend

Python 3.12  FastAPI + Uvicorn
SQLAlchemy 2  async + aiosqlite
Alembic  database migrations
Argon2id  password hashing
JWT  HS256 authentication
python-gnupg  PGP/MIME ops

Frontend

React 19  TypeScript
Vite 8  with SWC
Tailwind CSS 4  styling
TanStack Query  server state
React Router 7  routing
Tiptap  rich text editor

Infrastructure

Postfix  SMTP :25 / :587
Dovecot  IMAP / POP3 / LMTP
OpenDKIM  DKIM signing
OpenDMARC  DMARC verification
SpamAssassin  spam filtering
s6-overlay v3  process supervisor

Designed for
automation

A comprehensive REST API with OpenAPI 3.1 spec and Postman collection included. Authenticate with JWT or scoped API keys, or reach for the official SDKs.

Emails

Send, receive, inject, bulk-inject, search, and manage emails programmatically.

GET /api/v1/emails
POST /api/v1/emails/send
POST /api/v1/emails/inject
POST /api/v1/emails/bulk-inject

Mailboxes

Create, delete, and query mailboxes with folder statistics and email listings.

GET /api/v1/mailboxes
POST /api/v1/mailboxes
GET /api/v1/mailboxes/:addr/emails

Auth & API Keys

JWT login with optional TOTP 2FA, plus API keys scoped to specific actions and mailboxes.

POST /api/v1/auth/login
POST /api/v1/auth/api-keys
GET /api/v1/auth/api-keys/scopes

GPG Keys

Generate, import, export, and publish PGP keys. Full RFC 3156 PGP/MIME support.

POST /api/v1/gpg/keys/generate
POST /api/v1/gpg/keys/import
GET /api/v1/gpg/keys/:addr/export

Domains & System

Manage email domains with DKIM, DNS verification dashboard, TLS certs, and server settings.

POST /api/v1/domains
POST /api/v1/domains/:name/verify-dns
GET /api/v1/events/stream

SDKs & MCP

Official Python and Node SDKs wrap the API, and an MCP server gives an AI agent its own mailbox.

pip install mailcue
npm install mailcue
npx mailcue-mcp

Deep Dive Guides

Learn how to configure, integrate, and deploy MailCue for testing or production environments.

Architecture →

Container layout, request flow, and deep dive into Postfix, Dovecot, and Python FastAPI stacks.

Configuration →

Configure MailCue using environment variables, network settings, and exposed ports.

API Reference →

Complete REST endpoint list, authentication methods, and scoped API key details.

Production Deployment →

Step-by-step production setup: hardened mail server mode, DNS (MX, SPF, DKIM, DMARC), and SSL certificates.

SMTP Tunnel →

Bypass port-25 blocks on cloud providers with a secure, authenticated SMTP egress tunnel.

Email Clients & TLS Trust →

Connecting email clients (Thunderbird, Mutt) over IMAP/POP3/SMTP and trusting custom CAs.

Using in CI/CD →

How to spin up MailCue in CI pipelines (GitHub Actions, GitLab CI) for end-to-end tests.

Model Context Protocol →

Official MCP server documentation to equip AI agents with mailboxes and email capabilities.

Provider Sandbox & HTTP Bin →

Mock SMS, voice, and chat APIs (like Twilio or Slack) and inspect webhooks in real time.

Sharing MailCue →

Running a single container behind a shared Docker network to communicate across multiple local projects.

Development & Contributing →

Setting up local development, running tests, linting, and the pull request workflow.

Start testing in
30 seconds

One command. No signup. No configuration. A full email server at your fingertips.

click to copy $ docker run -d -p 8088:80 ghcr.io/olib-ai/mailcue