Use when receiving emails with Resend - setting up inbound domains, processing email.received webhooks, retrieving email content/attachments, or forwarding received emails. Triggers on "inbound email", "receive email", "email webhook", "Resend inbound", "process incoming email", "email forwarding", "email.received", "MX records for email".
Instrucciones de origen · Vista previa de solo lectura
name
resend-inbound
description
Use when receiving emails with Resend - setting up inbound domains, processing email.received webhooks, retrieving email content/attachments, or forwarding received emails. Triggers on "inbound email", "receive email", "email webhook", "Resend inbound", "process incoming email", "email forwarding", "email.received", "MX records for email".
Resend processes incoming emails for your domain and sends webhook events to your endpoint. Webhooks contain metadata only — you must call separate APIs to retrieve email body and attachments.
This skill is context-independent — it does not use brand/ files and works identically in any project.
On Activation
Determine if the user needs a Resend-managed domain or custom domain.
Walk through domain setup and webhook configuration.
Implement webhook handler with signature verification.
Add content retrieval logic (body + attachments as needed).
Add routing logic if multiple recipients are expected.
Output: A webhook handler file with signature verification, content retrieval, and routing logic.
Quick Start
Configure receiving domain — Use Resend's .resend.app domain or add MX record for custom domain
Set up webhook — Subscribe to email.received event
Retrieve content — Call Receiving API for body, Attachments API for files
Domain Setup
Option 1: Resend-Managed Domain (Fastest)
Use your auto-generated address: <anything>@<your-id>.resend.app
No DNS configuration needed. Find your address in Dashboard → Emails → Receiving → "Receiving address".
Option 2: Custom Domain
Add MX record to receive at <anything>@yourdomain.com.
Setting
Value
Type
MX
Host
Your domain or subdomain
Value
Provided in Resend dashboard
Priority
10 (lowest number wins a conflict, but typically only multiples of 10 are used)
Critical: Your MX record must have the lowest priority value, or emails won't route to Resend.
Subdomain Recommendation
If you already have MX records (e.g., Google Workspace, Microsoft 365):
All email routes to Resend (breaks existing email)
# Example: receive at support.acme.com without affecting acme.com
support.acme.com. MX 10 <resend-mx-value>
If you set up Resend to receive email on a root domain, all traffic will be routed to Resend, not to any other mailbox. It's crucial, then, to use a subdomain with inbound emails.
For local development, use tunneling (ngrok, VS Code Port Forwarding):
ngrok http 3000
# Use https://abc123.ngrok.io/api/webhook as endpoint
Webhook Payload Structure
Important: Payload contains metadata only, not email body or attachment content.
{"type":"email.received","created_at":"2024-02-22T23:41:12.126Z","data":{"email_id":"a1b2c3d4-...","from":"sender@example.com","to":["support@acme.com"],"cc":[],"bcc":[],"subject":"Question about my order","attachments":[{"id":"att_abc123","filename":"receipt.pdf","content_type":"application/pdf"}]}}
Verify Webhook Signatures
Always verify signatures to prevent spoofed events: