An agent-native, self-hosted mail server in Rust. Receive, parse, thread, search and send real SMTP mail behind a REST API and an MCP server. Agents and humans are both first-class users.
The hard part of an agent mailbox was never the API. It is the plumbing: receiving over SMTP, sending with real deliverability, parsing genuinely broken MIME, threading, storage.
Hosted agent-mail products solve that well — closed, on someone else's infrastructure. Self-hostable mail servers solve it too — with no notion of an agent: no per-agent inbox provisioning, no threads as API resources, no MCP.
OpenMail is the intersection nobody occupies: agent-native, self-hostable, permissively licensed.
Provisioned in one call. Not Unix accounts, not aliases, not a mailbox someone creates by hand.
Stitched from In-Reply-To and References. An agent asks for a conversation.
extracted_text is the new content only. An agent reading full bodies re-reads the whole thread every turn.
An agent owns and operates its mailbox as tools. Credential routes can never become tools.
Webhooks and a WebSocket stream for message.received.
Standard IMAP/SMTP is a goal, not an afterthought. Point Apple Mail at the mailbox an agent is driving.
Two implementations of mail plumbing exist under a permissive licence: Mox (MIT, Go), and Stalwart's primitives (Apache-2.0, Rust). Stalwart's server is AGPL — which is why no permissively licensed Rust mail server exists.
Building one means writing what the ecosystem is missing. These ship standalone so any Rust mail project can use them.
| Crate | What | Prior art |
|---|---|---|
| mail-dane | DANE / TLSA for SMTP (RFC 7672) | first in Rust |
| mail-mta-sts | MTA-STS policy discovery and cache (RFC 8461) | first in Rust |
| mail-dsn | Delivery Status Notifications (RFC 3464) | first in Rust |
# relay — someone else's IP reputation, inbox placement on day one provider = "ses" # or oracle, sendgrid, postmark, resend, custom region = "us-east-1" # or direct-to-MX — your reputation, MTA-STS and DANE enforced mode = "direct"
Receiving is always yours.
Oracle Cloud blocks outbound TCP/25 for tenancies created after June 2021 — inbound is unaffected. There you receive directly and relay outbound on 587. Direct-to-MX is not possible on that host at all.
OpenMail is a server you run. Not a trial of a hosted product, not an open-core teaser with the useful half behind a licence key.
Apache-2.0 means you can run it, fork it, and build a commercial product on top — including one that competes with anything we might host later. That is the intent, not an oversight.
git clone https://github.com/karti-ai/openmail cd openmail && docker compose up