Skip to content
nofeb

Receive email as a webhook

Create an inbox (or add your domain), subscribe a webhook to message.received scoped to that inbox, pod or organization, and fetch the message when the event arrives. Mail can reach nofeb at its own MX or through Cloudflare Email Routing, Postmark, Mailgun or SendGrid. Deliveries are signed per Standard Webhooks and retried.

Checked against the engine on .

What do you need?

  • An HTTPS endpoint
  • A nofeb API key

Steps

  1. 1. Choose where mail comes in

    Use a nofeb address, point your domain's MX at nofeb, or keep your current provider and forward with your inbound token.

  2. 2. Subscribe

    Scope is required: organization, pod or one inbox.

    Create the webhook
    curl -X POST https://api.nofeb.com/v1/webhooks -H "Authorization: Bearer $NOFEB_API_KEY" -H 'content-type: application/json' \
      -d '{"url": "https://example.com/nofeb", "scope": "inbox", "inbox_id": "inb_…", "events": ["message.received"]}'
  3. 3. Verify and fetch

    Verify the signature on the raw body, then read the message with its extracted fields.

    A handler (TypeScript)
    import { Nofeb, verifyWebhook } from "@nofeb/sdk";
    const nf = new Nofeb();
    
    export async function POST(req: Request) {
      const event = await verifyWebhook(await req.text(), req.headers, process.env.NOFEB_WEBHOOK_SECRET!);
      if (event.type === "message.received") {
        const m = await nf.messages.get(event.data.message_id);
        await handle(m.reply_text, m.otps, m.attachments);
      }
      return new Response(null, { status: 204 });
    }
  4. 4. Or pull instead

    Workers behind a firewall can read the same events oldest first from GET /v1/events with a cursor.

  5. 5. Or hold a stream open

    A live client can open a WebSocket to GET /v1/stream (subprotocol nofeb.v1) and receive the same event envelopes in feed order as they happen. Every message carries a feed cursor, so a client that reconnects with ?cursor= resumes with no gap and no duplicates.

The nofeb inbound pipeline Two entry points, nofeb's own MX and provider webhooks authenticated by an inbound token, feed the same pipeline: sender authentication and spam and virus checks at the MX, routing by envelope recipient, the inbound.resolve hook, an injection score, sender trust and typed decisions, then sender lists, the inbound.pre_deliver hook and rules, delivery to the inbox, Junk or quarantine, then a message.received event by webhook or event feed, and access over REST or MCP for the agent. Ways in nofeb MX Any mail server delivers STARTTLS offered Recipient checked at RCPT Provider webhooks Cloudflare Email RoutingPostmark inbound streamMailgun routeSendGrid Inbound ParseAny raw POST /v1/inbound/…/{token} At the door Checks before 250 OK SPF · DKIM · ARC · DMARC Spam and virus scan Refuse, accept, or Junk Pipeline One pipeline Route by envelope recipient Delivered once, even if resent inbound.resolve hook Scored and triaged injection score, sender trust decisions on every message sender lists inbound.pre_deliver hook rules quarantine, reject or file Parsed for the model reply_text · safe_body codes, links, attachments extracted metadata security verdict Inbox Agent inbox Inbox, Junk or quarantine Typed metadata on the thread Raw message kept byte-exact The agent hears message.received webhook, event feed or stream wait_for_email long-poll until it arrives Agent: REST, SDK or MCP
Mail from any sending server reaches nofeb's MX; mail already handled by Cloudflare Email Routing, Postmark, Mailgun or SendGrid is passed on with your inbound token. Both join the same pipeline, where each message is scored for injection, labelled and triaged before your sender lists, hooks and rules decide its fate, and the agent hears about it by webhook, the event feed, the stream, REST or MCP.

Frequently asked questions

How do I receive email as a webhook without a mail server?

Give the address to senders (a nofeb inbox or your domain with its MX at nofeb) and subscribe to message.received. nofeb runs the receiving server, stores the message and calls your endpoint.

What does the webhook contain?

The event names the message and inbox. Fetch the message for its bodies, reply_text, safe_body, otps, links, attachments with extracted text, headers and, for mail nofeb's MX received, the security verdict.

What if my endpoint is down?

Deliveries are retried and every attempt is kept in a delivery log. The event feed holds the same events, so a consumer can catch up from its last cursor.

Status of everything on this page

Every capability named above, with its status as reconciled against the engine.

CapabilityWhat it doesStatus
Signed webhooks with required scope Standard Webhooks signatures, retries and a delivery log. Scope (organization, pod or inbox) is required, so a subscription never silently widens to everything. Shipped
Durable event feed A pull feed of every event, oldest first after a cursor, for consumers that cannot receive webhooks. Shipped
Realtime stream A WebSocket stream of the same events as webhooks and the feed, in order, resumable from a cursor with no gap and no duplicates, and filtered by inbox, pod or event type within the credential's own reach. Shipped
Inbound mail server that checks mail at the door nofeb's own MX receives mail for the shared domain and your custom domains, with STARTTLS. It checks every recipient before accepting any data, verifies SPF, DKIM, ARC and DMARC, and scans for spam and viruses before it answers. Mail that fails a DMARC reject policy, carries a virus or is clearly spam is refused during delivery instead of bounced later; likely spam and DMARC-quarantined mail is filed into Junk. Every message carries a security verdict with its authentication, spam, virus and TLS results. Shipped
Inbound from the provider you already use Receive through Cloudflare Email Routing with an Email Worker on your own zone, a Postmark inbound stream, a Mailgun route, SendGrid Inbound Parse, or any service that can POST a raw message. Each path is authenticated by your organization's inbound token, which you can rotate at any time, and delivers only to your own inboxes and verified domains. Shipped
Reply extraction Each message carries its new text with quoted history and signature removed. Shipped
safe_body for untrusted mail The message's new text with zero-width and direction-altering characters, hidden HTML and forgeable quoted history removed, wrapped in a provenance header that tells the model whose words these are. Shipped
Attachment text Attachments are listed with their extracted text and can be downloaded byte-exact. Shipped