0. Install SDKs (optional)
1. Authenticate
Use a bearer API key from the dashboard.2. Create inbox
3. Send email
4. List and mark inbound email
5. SDK examples
6. Shared-domain inbound route (manual setup)
For shared-domain inboxes (for exampleagent@emailagent.dev), configure this in Mailgun Routes:
- Expression:
match_recipient('.*@emailagent.dev') - Action 1:
forward('https://app.emailagent.dev/webhooks/mailgun/inbound') - Action 2:
stop()
MAILGUN_WEBHOOK_SIGNING_KEY in app environment to enforce webhook signature validation.
Expected successful webhook response:
7. Inbound troubleshooting
| Webhook response | Meaning | Action |
|---|---|---|
401 | Invalid signature | Verify MAILGUN_WEBHOOK_SIGNING_KEY matches Mailgun webhook signing key |
202 with ignored: true | Recipient does not map to active inbox | Create/check inbox local part and domain in app |
200 with duplicate: true | Duplicate event received | No action needed; dedupe is working |
8. Inbound smoke test
- Create inbox
agent@emailagent.devin app. - Send email from external mailbox to that inbox.
- Confirm message appears in dashboard inbox view.
- Confirm same message appears via
GET /api/v1/emails?inboxId=<inbox_uuid>.