IMAP To Webhook

Turn an IMAP inbox into JSON webhooks

MailWebhook connects to an IMAP mailbox, monitors the folder you choose, normalizes new messages, and delivers signed JSON webhook events to your application.

Built for IMAP-to-webhook, IMAP email webhook, email inbox to webhook, and app-password mailbox automation workflows.

IMAP to webhook pipeline
IMAP mailbox folder
  -> UID-based polling
  -> raw MIME ingest
  -> normalized email event
  -> mapped JSON payload
  -> signed webhook POST
POST /webhooks/imap-email
{
  "schema": { "name": "mailwebhook.generic", "version": "1" },
  "event": {
    "id": "6ff49aa1-7050-4ad1-95d9-2711f2ca7e88",
    "route_id": "2f3713bf-88cc-46c6-aaa3-ea9d6e9d20f3",
    "created_at": "2026-06-27T10:14:32Z"
  },
  "message": {
    "message_id": "<invoice-1042@vendor.example>",
    "subject": "Invoice 1042",
    "date": "2026-06-27T10:13:59Z",
    "from": [{ "email": "billing@vendor.example", "name": "Vendor Billing" }],
    "to": [{ "email": "ap@company.com", "name": "Accounts Payable" }]
  },
  "body": {
    "text": "Please review invoice 1042.",
    "attachments": []
  },
  "meta": {
    "source": "imap",
    "raw_size_bytes": 26546,
    "received_at": "2026-06-27T10:14:32Z"
  }
}

Can IMAP trigger a webhook?

IMAP does not natively POST email to arbitrary webhook URLs. MailWebhook provides the managed path: connect an IMAP mailbox, choose the folder to monitor, ingest new messages with a UID cursor, normalize each email, and send structured JSON to your webhook endpoint. This covers IMAP to webhook, IMAP webhook, email inbox to webhook, and IMAP email webhook workflows.

This is useful when your mailbox provider supports IMAP, when an app password is the simplest connection method, or when legacy systems still send important workflow email to an existing inbox.

See the payload example

From IMAP folder to signed webhook

A managed pipeline that takes IMAP mailbox email from connection setup to a signed webhook event your application can trust. New mailboxes seed the UID cursor from the current highest UID, so historical email is handled through the explicit backfill workflow.

  1. 01

    Connect the mailbox

    Enter the IMAP username, password or app password, host, port, SSL/TLS setting, and folder.

  2. 02

    Auto-discover when available

    For providers with IMAP SRV records, MailWebhook can fill in server settings automatically.

  3. 03

    Test and save

    Run a connection test before saving the mailbox so setup problems are caught early.

  4. 04

    Poll new UIDs

    MailWebhook monitors the configured folder and fetches messages with UIDs after the stored cursor.

  5. 05

    Normalize and map

    Message headers, people, bodies, attachments, timestamps, and extracted fields become stable JSON.

  6. 06

    Deliver the webhook

    Send the payload to your endpoint with X-MailWebhook-Signature and X-Idempotency-Key headers.

Create your first IMAP route

An IMAP email event your app can process

MailWebhook sends your endpoint the pipeline output directly. For the generic JSON mapper, IMAP messages use the same documented payload contract as other providers, with meta.source set to imap.

{
  "schema": {
    "name": "mailwebhook.generic",
    "version": "1"
  },
  "event": {
    "id": "6ff49aa1-7050-4ad1-95d9-2711f2ca7e88",
    "project_id": "dca29061-c4a7-4687-a8dd-24d2f26548c7",
    "route_id": "2f3713bf-88cc-46c6-aaa3-ea9d6e9d20f3",
    "created_at": "2026-06-27T10:14:32Z"
  },
  "message": {
    "message_id": "<alert-7741@legacy.example>",
    "message_id_type": "original",
    "subject": "Nightly import failed",
    "date": "2026-06-27T10:13:59Z",
    "from": [
      {
        "email": "alerts@legacy.example",
        "name": "Legacy Importer"
      }
    ],
    "to": [
      {
        "email": "ops@company.com",
        "name": "Operations"
      }
    ],
    "headers": {
      "message-id": "<alert-7741@legacy.example>",
      "content-type": "text/plain"
    }
  },
  "body": {
    "text": "The nightly customer import failed at step validate_rows.",
    "attachments": []
  },
  "meta": {
    "source": "imap",
    "raw_size_bytes": 26546,
    "received_at": "2026-06-27T10:14:32Z"
  }
}

Need a custom payload shape? Map IMAP email fields with custom JSON.

View webhook payload docs

Built for existing inbox workflows

Purpose-built for IMAP evaluators: connection setup, SRV auto-discovery, UID cursoring, and explicit backfill for the mailboxes your team already runs.

Custom-domain mailboxes

Connect a mailbox hosted by a provider that exposes IMAP access.

App-password mailboxes

Use IMAP when a provider supports app passwords instead of a dedicated OAuth integration.

Folder-scoped monitoring

Monitor a specific IMAP folder such as INBOX or a dedicated workflow folder.

UID-based incremental ingest

Track the mailbox UID cursor so new messages can be fetched without reprocessing the whole folder.

Message preview and backfill

Preview route output for mailbox messages and backfill IMAP email that arrived before the mailbox was connected.

Signed webhook delivery

Send events with deterministic idempotency and HMAC signature headers.

Compare mailbox options

Use an IMAP inbox as an application input

IMAP inbox webhooks power legacy intake, finance, operations, and integration workflows across technical and operations teams.

Legacy system intake

Turn email from older systems into webhook events for modern HTTP workflows.

Vendor and invoice mailboxes

Extract sender, subject, body, and attachment metadata before webhook delivery.

Operations alerts

Route mailbox alerts from infrastructure tools, SaaS systems, or custom applications into internal systems.

Customer intake

Move structured fields from recurring email workflows into CRMs or back-office tools.

AI inbox workflows

Let agents receive mailbox events without making the agent runtime own IMAP credentials.

Provider workaround

Use IMAP when a mailbox provider lacks a native MailWebhook OAuth connector but supports IMAP access.

IMAP access is simple. A production webhook pipeline is not.

A basic IMAP script can fetch messages. A production IMAP-to-webhook workflow still needs connection validation, app-password handling, folder selection, UID cursor seeding, duplicate handling, MIME storage, attachment policy, payload shaping, webhook signing, retries, delivery logs, and backfill.

Custom IMAP poller

  • Store host, port, TLS, folder, username, and password safely
  • Discover or document provider server settings manually
  • Decide how to seed cursors without backfilling old mail accidentally
  • Fetch RFC822 MIME and parse edge cases
  • Build idempotency, HMAC signatures, retries, and logs

MailWebhook

  • Configure an IMAP mailbox through the product flow
  • Use SRV-based auto-discovery when providers publish records
  • Seed from the current highest UID and use explicit backfill for history
  • Receive normalized JSON payloads
  • Use signed webhook delivery and delivery attempt tracking

Where MailWebhook fits in an IMAP stack

MailWebhook is the operational layer on top of IMAP access: polling, normalization, JSON mapping, and signed webhook delivery for the workflows your application depends on.

Compared with IMAP scripts

Scripts can work for one mailbox. MailWebhook packages polling, normalization, route matching, webhook delivery, and backfill.

Compared with Gmail or Microsoft 365 connectors

Use provider connectors when you want OAuth-specific workflows. Use IMAP when the mailbox provider is best reached by host, port, TLS, folder, and credentials.

Compared with forwarding rules

Forwarding moves email somewhere else. MailWebhook turns mailbox messages into route events and webhook payloads.

Compared with no-code automations

No-code workflows are useful for simple routing. MailWebhook focuses on developer-ready JSON payloads, signatures, and endpoint delivery.

Compared with parser inbox tools

Parser tools often depend on parser-specific inboxes. MailWebhook can connect an existing IMAP mailbox folder.

Designed for webhook receivers that need predictable events

  • Signed webhook delivery so your endpoint can verify the sender.
  • An X-Idempotency-Key header so duplicate delivery can be handled safely.
  • Structured payloads so downstream code does not depend on raw email quirks.
  • Route-level configuration so different IMAP workflows can produce different payloads.
  • Message preview so teams can inspect route output before wiring automation into production.
  • IMAP backfill for messages that arrived before the mailbox was connected.
  • Connection tests and IMAP target validation help catch setup errors before production use.
Read webhook security docs

Start free, scale when you need to

The Free plan includes 300 emails/month at no cost. Paid plans start at $29/per month with a 30-day free trial.

  • HMAC-signed webhook delivery
  • Automatic retries with backoff
  • Event inspector and replay
  • Idempotency keys for safe dedupe

IMAP to webhook FAQ

Can IMAP trigger a webhook?
Yes, with MailWebhook. IMAP itself does not provide arbitrary webhook delivery. MailWebhook connects to an IMAP mailbox, monitors the configured folder, normalizes email content, and delivers JSON to your webhook endpoint.
Is this a native IMAP webhook?
No. IMAP is a mailbox access protocol, not a native webhook delivery system. MailWebhook provides a polling-based IMAP-to-webhook workflow.
Which IMAP settings do I need?
You need the mailbox username, password or app password, host, port, SSL/TLS setting, and folder. If the provider publishes IMAP SRV records, auto-discovery can fill in server settings.
Can I monitor a folder other than INBOX?
Yes. MailWebhook's IMAP setup includes a folder field, with INBOX as the common default.
Can I backfill IMAP messages?
Yes. MailWebhook's public mailbox docs list IMAP as a supported provider for message backfill, subject to plan day caps and one backfill job at a time.
Can I preview an IMAP message before delivering it to my webhook?
Yes. MailWebhook mailbox preview can run a specific message through a selected route and show the JSON delivered to the endpoint. Preview does not include attachments.
Do I need to change MX records?
No. For IMAP workflows, MailWebhook connects to an existing mailbox through IMAP settings.
Can I use an app password?
Yes, when your mailbox provider supports app-password IMAP access. The public docs specifically recommend app passwords as one workaround for OAuth providers that do not yet have a native MailWebhook connector.
Can I send a custom JSON shape to my webhook?
Yes. You can use the generic normalized payload or map IMAP email fields into a custom JSON payload for the receiving system.
What happens if the same email event is delivered twice?
Webhook receivers remain idempotent by using the X-Idempotency-Key header to detect and safely ignore duplicate processing.

Turn IMAP mailbox messages into webhook events

Connect an IMAP mailbox, choose the folder, and deliver structured email events to your application without building another mailbox poller.