Open-source email infrastructure

One API for every inbox,
calendar, and thread.

A single typed API for Gmail, Outlook, Exchange, IMAP, and CalDAV. Real-time sync, threading, webhooks, and an AI primitive set, built for the way your app actually talks to mail.

SOC 2 Type II HIPAA-eligible BYO encryption keys Apache 2.0 SDKs
live
// Connect a mailbox, subscribe to new messages.
import { MailFrom } from "mailfrom";

const mf = new MailFrom({ host: "https://mf.acme.dev" });

const inbox = await mf.grants.connect({
  provider: "google",
  scopes: ["mail.read", "calendar"],
});

for await (const msg of inbox.stream({ since: "now" })) {
  console.log(msg.subject, msg.from);
}
One API, every inbox
+ bring-your-own protocol
GGmail OOutlook 365 EExchange IIMAP/SMTP CCalDAV YYahoo ZZimbra +Fastmail
The wedge

Built on three things the closed platforms can't offer.

We watched a generation of builders pay per-account fees for an API that could be read, forked, and improved. We decided to write a better one — in the open.

"It's 2026. Your integration layer should cost $15/account/month come with the box, ship in a sealed binary run on your infra, and be a vendor meeting be a pull request."

01 / Own

Your users' mail never leaves your VPC.

Self-host the whole stack on a single Docker image, a Helm chart, or a Terraform module. Tokens, payloads, and the sync engine all live inside your perimeter — because that's the only sane place for them to live.

Single binary Helm · Terraform · Nix BYO Postgres
02 / Read

The source is the documentation.

Every provider adapter, every rate-limit strategy, every auth flow is a file you can open, read, and patch. When the Gmail API hiccups at 4am, you don't file a support ticket — you grep the repo.

MIT licensed Commonhaus governed 1,247 PRs merged
03 / Price

Flat per-call pricing. Forever.

No per-mailbox seat tax. No enterprise-tier gatekeeping on webhooks or threading. You pay for API calls like every other piece of infrastructure in your stack. Or host it yourself and pay nothing.

$0.00004 / call Self-host: free No seat pricing
What's in the box

Everything you'd build anyway,
already built.

Threading

Real conversations, not a pile of messages.

Provider-agnostic threading with canonical message IDs. Works across forwards, replies, In-Reply-To weirdness, and the dozen edge cases Microsoft invented in 2008.

Re: Q2 numbers · marta@
↳ Re: Q2 numbers · sam@ · 2m ago
↳↳ Re: Q2 numbers · marta@
Webhooks

Events that actually arrive.

Signed, versioned, at-least-once delivery with replay and dead-letter. No polling, no drift, no "did you miss the 11pm batch?"

POST/hooks/message.created200 · 38ms
POST/hooks/calendar.updated200 · 41ms
Sync

Real-time, bidirectional.

Push delta, not a full scan. Sub-second latency on Gmail & Graph.

Provider
imap://...gmail/v1
Your app
PostgresRedis
Auth

OAuth, done.

Drop-in consent flows for every provider. Token rotation, scopes, revocation — one function call.

mf.grants.connect(…)
OAuth2 · PKCE
Token refresh
Scope downgrade
Calendar

Events & availability.

Free/busy across providers. RFC 5545 compliant. ICS in, ICS out.

AI primitives

Email shaped for agents, not for humans.

Structured extraction out of the box: intent, entities, quoted reply stripping, signature detection, attachment OCR. Stream each message as tokens, JSON, or embeddings — whichever your agent eats.

intentmeeting_request
entities"Thursday 2pm", "Ana López"
reply_clean"Happy to jump on a call."
embeddingf32[1536] → pgvector
Contacts & graph

A social graph you already had.

Auto-built from headers and calendar history. Deduped, enriched, queryable. The CRM feature your PM keeps asking for — minus the CRM.

ana@acme.co · 41 sam@brr.io · 112 marta@ · 18 + 4,912 more
Self-host or Cloud

Same binary.
Your choice of gravity.

Run the open-source core on your own infra in under ten minutes. Or let us run it, with the same code, for teams that would rather not. You can switch directions with a DNS record.

Same API surface. No cloud-only features, no hidden gates.
Same SDKs. Point them at mf.acme.dev or our hosted endpoint.
Exit-ready. pg_dump at any time. Your data is a Postgres schema, not our lock-in.
Per-seat fees. Vendor calls to enable features. Redacted logs.
Your infrastructure
Your appNext / Rails / Go
SDKts · py · go · rb
Your workersconsumers
MailFrom core — one binary
API gatewayREST · GraphQL · gRPC
Sync enginedelta · push · queue
Webhook bussigned · replayable
Providers
GmailAPI v1
GraphOutlook 365
IMAPExchange · etc
Poke around

A tiny, opinionated API.
Try it before you commit a line.

GET /v1/messages
200 OK 38ms
// $ curl /v1/messages?limit=2
{
  "data": [
    {
      "id": "msg_01HZ8QK3",
      "thread_id": "thr_02A7WQ",
      "from": [{ "email": "ana@acme.co", "name": "Ana López" }],
      "subject": "Re: Q2 numbers",
      "snippet": "Happy to jump on a call Thursday…",
      "received_at": "2026-04-20T14:22:08Z",
      "folders": ["inbox"],
      "ai": { "intent": "meeting_request" }
    },
    {
      "id": "msg_01HZ8QK2",
      "subject": "Invoice #4821 — paid",
      "received_at": "2026-04-20T13:48:11Z"
    }
  ],
  "next_cursor": "eyJpZCI6Im1zZ18w…"
}
Made in the open

Built alongside the people shipping on it.

MailFrom is MIT-licensed and Commonhaus-governed. Every roadmap discussion, RFC, and postmortem lives in the open repo. You can read the sync engine today and have a PR merged by Friday.

12.4k
GitHub stars
214
Contributors
1,247
Merged PRs
99.98%
Hosted uptime · 90d
Pricing

Free if you host it.
Cheap if you don't.

No per-mailbox seat fees. No feature gates. Webhooks, threading, and AI primitives are in every tier, because they're in the repo.

Self-hosted

$0/forever
Run the OSS core on your own infra. MIT-licensed, single binary, Helm & Terraform included.
  • Unlimited mailboxes & calls
  • All providers & features
  • Community support · Discord
  • No phone-home. None.
Clone the repo →

Cloud

$0.00004/call
Same binary, run by us. Usage-based, metered to the API call. Free up to 100k/month.
  • 100k calls/mo free, then metered
  • SOC 2, HIPAA BAA, EU region
  • Managed sync engine & webhooks
  • Import from self-hosted in one command
Start building →

Enterprise

Custom
For regulated teams: dedicated VPC, BYO KMS, SAML, audit logs, support SLAs — on top of the same OSS core.
  • Dedicated single-tenant deploy
  • BYO KMS, SCIM, SAML, audit
  • 99.99% SLA · 24/7 on-call
  • Source-available commercial license
Talk to us →

Start with one install,
keep your options open.

You can run MailFrom on your laptop in 30 seconds. You can still be running it at 100M messages a day. We promise to not get in the way of either.

$ npx create-mailfrom@latest
$ docker run -p 8080:8080 mailfrom/core
Create account Read the RFCs