Email integration for SaaS, CRMs and AI agents

The self-hosted email API for Gmail, Microsoft 365 and IMAP

Read, send and sync your users' Gmail, Microsoft 365 and IMAP email through one REST API. Run EmailEngine on your own infrastructure, with unlimited mailboxes for one flat annual fee.

Free for 14 days. No sign-up or credit card. Activate the trial on your own server.

$1,450 or €1,200 per year · Unlimited mailboxes. Prices exclude VAT.

Six years in production at 200+ companies across 38 countries.

Incoming email, pushed to your app
// EmailEngine POSTs this to your app the instant a message
// arrives in a connected mailbox. No IMAP, no polling.

{
  "event": "messageNew",
  "account": "nina",
  "path": "INBOX",
  "date": "2026-07-24T09:14:32.000Z",
  "data": {
    "from": { "name": "Jane Smith", "address": "jane@acme.com" },
    "subject": "Re: Invoice #4021",
    "text": { "plain": "Payment sent, receipt attached." },
    "attachments": [
      {
        "filename": "receipt.pdf",
        "contentType": "application/pdf"
      }
    ]
  }
}

Point it at any Gmail, Outlook or IMAP mailbox, and inbound mail arrives parsed, in real time. The same API sends, too, and doubles as a tool surface for AI agents.

Built and maintained by the author of Nodemailer, the email library your stack probably already depends on.

16.7M Nodemailer downloads per week
788M Yearly npm downloads across the Nodemailer email libraries
200+ Companies running EmailEngine in production
380+ Releases since 2020, a new one every few days

Build email into your product

CRM and sales platforms

Sync your users' correspondence with their contacts, and let them send from their own address without leaving your app. Connect your users' mailboxes.

Support and shared inboxes

Turn support@ into tickets, track conversations across a team, and reply with stored templates. Receive email events.

Regulated industries

Banking, healthcare, legal and public sector teams that need control over where mailbox data is processed. Review the security architecture.

Email hosting and webmail

Build a modern webmail or mobile client on top of your existing hosting without implementing IMAP and MIME yourself.

AI products and agents

Give an agent structured, permissioned access to your users' mailboxes, or your own, to read, summarise, draft and send. How agent access works.

Enterprise integration

Bridge legacy applications that only speak IMAP and SMTP to OAuth2-only Microsoft 365 and Google Workspace tenants.

Pricing

One annual subscription covers your company, your instances and unlimited connected mailboxes.

$1,450€1,200 / year

Renews annually. Prices exclude VAT where applicable.

  • Unlimited connected mailboxes
  • Unlimited instances for production, staging and development
  • Unlimited API calls and webhooks
  • As many licence keys as you need
  • All updates while your subscription is active
  • Support directly from the developer who wrote the code
  • Serve your customers from instances you manage, they never need a licence of their own

Enterprise

The same software on different payment terms. For procurement rules the annual plan doesn't fit, and for deployments where an expiring licence would be an operational risk.

  • A perpetual licence, paid once, instead of a subscription
  • Verified offline: no licence checks, nothing phones home
  • Payment by invoice or wire transfer
  • Net terms rather than payment up front
  • Custom contract and licence terms

Same features and support. A perpetual licence removes the risk of an expired renewal interrupting instances you manage on customer hardware.

Running in about ten minutes

EmailEngine plus a Redis database, on your own machine. No account to create, no data to hand over.

  1. Install it

    The shipped Compose file brings up EmailEngine together with a correctly configured Redis. Single binaries, an npm package and an installer script are also available.

    curl -LO https://go.emailengine.app/docker-compose.yml
    docker compose up -d
  2. Activate the trial

    Open your instance's own dashboard, click Start a 14-day trial, generate an access token. No account to create, no email to hand over.

    open http://127.0.0.1:3000
  3. Connect a mailbox

    Register an account over the API, or send your user to a hosted authentication form and let EmailEngine handle the OAuth2 dance.

    POST /v1/authentication/form

Download EmailEngine

Every install can activate its own 14-day trial from the dashboard. Full functionality, no sign-up, no credit card.

Connect Gmail, Microsoft 365 and IMAP accounts

Send your user to a hosted authentication form, they sign in with Google or Microsoft, and they land back in your app with the account already connected. Or register accounts directly over the API if you'd rather own the flow.

  • Gmail and Google Workspace
  • Microsoft 365 and Outlook.com
  • Any IMAP server
EmailEngine hosted authentication form

Managed OAuth2

EmailEngine stores and refreshes tokens for you, or calls your own authentication server if you already hold them.

Service accounts

Google Workspace domain-wide delegation and Workload Identity Federation; Microsoft 365 app-only access with no user login.

Shared and delegated mailboxes

Microsoft 365 shared mailboxes, delegated accounts and Government Cloud tenants.

Set up OAuth2 for Google and Microsoft

Webhook configuration in EmailEngine

Receive email webhooks for Gmail, Outlook and IMAP

EmailEngine holds an open connection to every account and pushes a webhook when mail arrives, is read, moved, flagged or deleted. Every delivery is signed, deduplicated and retried.

  • New mail
  • Flag and folder changes
  • Signed payloads

Webhook routes

Filter and reshape events with small JavaScript functions, then fan one event out to Slack, Discord, Zapier, n8n or your own endpoint.

Search

Query by sender, recipient, subject, body, date, header and thread, plus Gmail labels and Outlook categories.

Attachments and calendar invites

Download attachments, inline images as data URIs, and parse ICS invites out of incoming messages.

Explore email webhooks and delivery options

Send through your users' own mail servers

Post JSON, get a queued message. EmailEngine builds the MIME, sends it over the account's own SMTP or provider API, uploads it to Sent Mail and sets the threading headers so replies stay in the conversation.

  • Saved to Sent Mail
  • Correct threading
  • Bounce detection
A sent message as it appears in a mail client

Templates and mail merge

Stored templates with variables, and one API call that fans out into personalised messages with their own Message-IDs.

Scheduling and idempotency

Queue a message for a future time, and use an idempotency key so a retried request never sends twice.

Bounces and suppression

Bounce and complaint parsing with ML-assisted classification, automatic blocklists and RFC 8058 one-click unsubscribe.

Explore sending, replies and templates

EmailEngine asking an operator to approve an MCP client, showing the four instance-management levels it can be granted

A self-hosted email MCP server for AI agents

Agent frameworks come with web search and code execution, but not with a way into a mailbox. EmailEngine ships an MCP server, currently in beta: turn on the endpoint, point any MCP client at it, and the agent can search the history, read the thread, file the message, draft the reply or send it, across every Gmail, Microsoft 365 and IMAP account you have connected.

  • Model Context Protocol
  • Mail access off by default
  • Revocable in one click

A curated tool set

Listing and searching mail, reading a message or its attachments, flagging and moving it, drafting a reply, sending. Message bodies come back sanitized, with the quoted history marked, so the model can tell the new text from the thread under it.

You approve what it may do

Connecting a client is a consent screen, not a config file. What it may manage and how much mail it may touch are two separate choices, mail starting at no access at all, and you can bind it to a single mailbox. The exact tools it walks away with are listed before you approve.

Every tool call is an API call

Tools are not a second implementation. Each one runs the REST route behind it with the caller's own token, so scopes, account binding, IP restrictions, rate limits and the audit log apply exactly as they do to the API.

Start with the MCP documentation, or hand your agent the OpenAPI specification and the machine-readable capabilities manifest directly.

An admin UI you can hand to support

Every connected account and its sync state in one place, with the live message and webhook queues alongside. Browse a mailbox, work out why an account stopped syncing, or pull an account's protocol log, all without opening a terminal.

  • Account health at a glance
  • Message browser
  • Dark mode
EmailEngine dashboard showing connected accounts and recent activity
Grafana dashboard showing EmailEngine metrics

Built to be operated, not just installed

A Prometheus endpoint and a ready-made Grafana dashboard, live queue inspection, and optional per-account logging of the raw IMAP conversation, so you can see exactly what the mail server said.

  • Prometheus
  • Grafana
  • Opt-in IMAP logs

Queue visibility

Inspect, retry and cancel messages and webhook deliveries while they are still in the queue.

Per-account logs

Switch on protocol logging for one account while you chase a problem, then download the transcript.

Scoped access tokens

Issue tokens limited to one account, one scope, an IP range or a rate limit. Tokens are stored only as hashes.

Read the logging and troubleshooting guide

Everything else it does

The parts that do not need a section of their own, and usually turn out to be the reason a build-it-yourself estimate was wrong.

  • Autodiscovery resolves IMAP and SMTP settings from an email address, so users only type their credentials.
  • Send-only accounts register Gmail or Outlook for sending alone, with no mailbox syncing and no IMAP connection.
  • IMAP and SMTP proxy lets legacy clients that only speak password auth reach OAuth2-only accounts.
  • MIME parsing that copes with real mailboxes: legacy character encodings, inline images, malformed headers.
  • Signed webhooks carry an HMAC-SHA256 signature, a stable event ID and an attempt counter on every delivery.
  • Open and click tracking with an optional pixel and link rewriting, filtering known security scanners out of the results.
  • Deliverability testing returns SPF, DKIM, DMARC, BIMI and ARC results, plus which Gmail tab the message landed in.
  • SMTP gateways route selected messages through an external relay while keeping the account's own identity.
  • AI processing can run incoming mail through an LLM for summaries, sentiment, extracted events and a phishing risk score, with your prompt and your API key.
  • Bulk export writes a mailbox to compressed NDJSON for archival, migration or legal discovery, resumable and encrypted at rest, and currently in beta.
  • Proxy support for HTTP and SOCKS, globally or per account, with outbound IP pinning.
  • Error reporting into your own self-hosted Sentry, configured from the admin UI.
  • White labelling rebrands the hosted authentication pages and runs them in seven languages.
  • Authentication audit trail records every admin sign-in, failed attempt and passkey change to the application log, ready to ship into your SIEM.

The email API reference documents every endpoint behind these, and capabilities.json is the machine-readable version.

EmailEngine or a hosted email API?

Both approaches are legitimate. They differ in who holds the data and how the bill scales.

EmailEngine Hosted email APIs
Where mail is processed Your infrastructure The vendor's cloud
Pricing model Flat annual fee, unlimited mailboxes Typically per connected mailbox
Who runs it You (a server and Redis) The vendor
Uptime and scaling Yours to own; several thousand mailboxes per instance Vendor SLA, scales past that for you
Compliance certifications Inherited from your own environment Vendor holds SOC 2, ISO 27001 and similar
Best fit Teams with somewhere to run it, data-residency requirements, or many mailboxes Teams with no ops capacity and a small number of mailboxes

Weighing a specific vendor? See how EmailEngine compares with Nylas and with Unipile, including where each of them is the stronger choice, with feature-by-feature versions in the documentation.

EmailEngine vs building your own email integration

Plenty of teams do, and for a single mailbox over plain IMAP that is the right call. It usually stops being the right call at the second provider, because the hard part was never the protocol. It is everything around it.

Every provider is different

Gmail exposes labels as folders, so one message lives in several at once. Microsoft throttles on its own terms. Plenty of IMAP servers advertise capabilities they do not honour. The RFC is the easy part.

OAuth2 that keeps working

Google and Microsoft each expire and refresh tokens their own way, with service accounts, delegated access and tenant policies on top. Getting the first token is a tutorial. Keeping thousands of them valid is the actual job.

Connections that stay up

Thousands of persistent IMAP connections holding IDLE, reconnecting cleanly, and staying inside each provider's limits. This is the part that pages you at three in the morning.

EmailEngine has been maintained since 2020. Explore the release history and email API reference to see what your team can build on.

Trusted by 200+ companies

CRM, SaaS and AI businesses across 38 countries run EmailEngine in production

When self-hosting is the requirement

EmailEngine processes email on infrastructure you control and connects directly to your email providers. Postal Systems has no access to your mailboxes. Your team chooses where it runs and which external services receive data. See the security and deployment overview for storage, outbound connections and operational requirements.

Your infrastructure, your controls

Message bodies are fetched on demand from the original mailbox. Only sync metadata is cached, in Redis you control.

Encrypted at rest

AES-256-GCM encryption for every stored credential, OAuth2 token and secret.

SSO and strong auth

OpenID Connect against any provider, Okta, passkeys and TOTP, with group-based authorisation and SSO-only mode.

FAQ

What does EmailEngine actually do?

It keeps an open connection to every email account you register and exposes them all through one unified email API. You call REST endpoints with JSON; EmailEngine translates that into IMAP, SMTP, Gmail API or Microsoft Graph calls, and sends you webhooks when anything changes.

Is EmailEngine a mail server?

No. It connects to email accounts that already exist. It does not host mailboxes, create addresses or replace your email provider.

Where does the email data live?

On your infrastructure, and in the original mailbox. EmailEngine caches only metadata in your own Redis: message IDs, flags and folder structure. Message content is fetched on demand from your email provider. Your app controls any onward storage or processing. We have no access to your instance, data or credentials.

Does EmailEngine help with GDPR, HIPAA or data residency?

Self-hosting lets your team choose where EmailEngine processes mailbox data and stores credentials. You also control the connected providers, webhook destinations and optional AI services. Compliance depends on your deployment and operating practices. The security overview explains the architecture and its limits.

Does EmailEngine keep a history of messages and webhook deliveries?

No, and that is deliberate. EmailEngine is a gateway, not a datastore. Everything lives in Redis, so it holds live queues and sync metadata and discards jobs once they have completed or permanently failed. There is no sent-mail archive and no webhook delivery log. Webhooks are retried up to ten times with exponential backoff, and you can raise the job history limit if you want failed jobs to stick around for inspection. For anything longer-lived, record events on your side as they arrive.

How much does EmailEngine cost?

$1,450 or €1,200 per year. One subscription covers unlimited instances, unlimited connected mailboxes and unlimited API calls, including your development and staging environments. There is no per-mailbox or per-message metering.

Can I build EmailEngine into a product I sell?

Yes, with an active subscription, as long as you keep direct management of the EmailEngine instances. Your customers use your product as end users and never need a licence of their own, so a CRM serving a thousand companies still runs on one subscription. What they cannot do is run their own instances or build their own services on top of EmailEngine.

What do I need to run it?

A server and Redis. EmailEngine ships as a single binary, a Docker image, an npm package and an installer script. Redis is used as a database rather than a cache, so it must run with the noeviction policy. Low latency between the two matters more than raw CPU.

How many mailboxes can one instance handle?

Several thousand. EmailEngine scales vertically; past that you shard across instances, each with its own Redis. Several instances sharing a single Redis database is not supported, and running multiple copies against one database will cause every instance to sync every account.

Which protocols are supported?

IMAP and SMTP for any provider, plus native Gmail API and Microsoft Graph integrations. POP3, ActiveSync and Exchange Web Services are not supported.

Can AI agents use EmailEngine to work with email?

Yes, two ways. EmailEngine ships an MCP server (currently in beta, and off until you turn it on): point any MCP client at the endpoint and it gets a tool set for listing, searching, reading, filing, drafting and sending mail. Anything that cannot speak MCP uses the plain REST API instead, with the OpenAPI specification loaded as tool definitions and webhooks pushing incoming mail to your agent runtime as parsed JSON. Either way the agent holds an access token you can scope to a single account and revoke at any time, never mailbox credentials, and it can send directly or file drafts for a person to review. Because EmailEngine is self-hosted, message content reaches only the model you choose to call.

Is there a trial?

Yes. 14 days, full functionality, started from the dashboard of your own instance. No sign-up, no credit card. When it expires EmailEngine stops processing accounts, but your data stays where it is and activating a licence picks up where you left off.

Is EmailEngine open source?

It is source available. You can read, audit and build the code, but running it beyond the trial requires a subscription. The licence spells out what is and isn't permitted.

Something else?

The documentation covers most of it, and the support channels are listed there too.