How do I connect Mailgun inbound route to nofeb?
- Copy
inbound.webhook_urls.mailgunfromGET /v1/me. It ends in/mime, which tells Mailgun to post the raw MIME message. - In Mailgun, create a route with a filter such as
match_recipient(".*@agents.example.com")orcatch_all(). - Set the action to
forward("<your nofeb Mailgun URL>"), and addstop()if no later route should see the message. - Verify the domain in nofeb so its addresses can receive.
Expression: match_recipient(".*@agents.example.com")
Actions: forward("https://api.nofeb.com/v1/inbound/mailgun/{token}/mime")
stop()
Priority: 10 How does the agent get the message?
The same three ways as any other inbound mail. Subscribe a webhook to message.received, pull the event feed, or block on wait_for_email until it arrives:
curl -X POST https://api.nofeb.com/v1/inboxes \
-H "Authorization: Bearer $NOFEB_API_KEY" -H 'content-type: application/json' \
-d '{"local_part": "signup-bot", "ttl_seconds": 3600}'
curl "https://api.nofeb.com/v1/inboxes/$INBOX_ID/wait?has_otp=true&timeout=60" \
-H "Authorization: Bearer $NOFEB_API_KEY"
# → { "message": { "subject": "Your code", "otps": [{ "code": "482913", "source": "body" }], … } } What does nofeb add to Mailgun's payload?
- One parser for every inbound path: messages from Mailgun carry the same extracted fields as mail received by nofeb's own MX.
- nofeb answers only after the message is stored, and a redelivery from Mailgun's retry schedule is delivered once.
- Recipients outside your organization's inboxes and verified domains are refused, so a route that is too broad cannot deliver someone else's mail.
What should I know about Mailgun itself?
From Mailgun's own documentation, checked .
- A Mailgun Route is a filter plus an action, and when an incoming message matches the filter expression the action is executed. source: documentation.mailgun.com
- A forwarding URL ending in json receives application/json, a URL ending in mime or raw-mime receives the raw MIME message, and other URLs receive parsed form fields. source: documentation.mailgun.com
- If a forwarded POST fails, Mailgun retries after 10 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours and 4 hours for a total of 8 hours, and a 406 response stops all retries. source: documentation.mailgun.com
- The store() action keeps a message on Mailgun's servers for up to 3 days. source: documentation.mailgun.com
- Inbound routes are capped at 1 on the Free plan and 5 on the Basic plan; Foundation and Scale include unlimited routes. source: mailgun.com
Frequently asked questions
Why must the Mailgun URL end in /mime?
Mailgun chooses the payload from the URL: a URL ending in mime gets the raw message. nofeb parses the raw message itself, so the agent gets the same fields from every inbound path.
Can one route serve many agent inboxes?
Yes. Route the whole domain, or a pattern, to nofeb; nofeb delivers each message to the inbox named by its recipient, and an inbound.resolve hook can create inboxes on demand for addresses that do not exist yet.
Does this replace Mailgun's parsed fields?
Yes. Instead of stripped text and form fields, the agent reads reply_text and safe_body, extracted one-time codes and links, and attachment text from nofeb.
Status of everything on this page
Every capability named above, with its status as reconciled against the engine.
| Capability | What it does | Status |
|---|---|---|
| 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 |
| Inbound routed by envelope recipient | Mail is delivered to the inbox named in the SMTP envelope, not the To: header, whichever way it arrives, and redelivery is idempotent. | 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 |
| One-time code and link extraction | Verification codes and classified links are pulled out of every message and returned as fields. | Shipped |
| Attachment text | Attachments are listed with their extracted text and can be downloaded byte-exact. | Shipped |
| Wait for an email | Long-poll an inbox for up to a minute until a message matching sender, subject or has-a-code arrives. | Shipped |
| 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 |
| HTTPS hooks in the pipeline | Signed HTTPS callouts that change what happens: create or reject an inbox for an unknown recipient, accept, reject or quarantine a message before delivery, and allow, deny or hold a send, each with a timeout and a fail-open or fail-closed mode. | Shipped |