Resend Inbound Alternative: An Address per API Call, Signed Events
A Resend inbound alternative in TypeScript: an address per API call, signed message.received events, mail read over REST and encrypted on arrival.

Resend receives mail on your account’s <id>.resend.app subdomain, or on a domain you add with an MX record, and fires an email.received webhook that you answer by fetching the email from its API. If you already think in those terms, Mailcycle will feel familiar: a small signed event, a read by id, an SDK for TypeScript. This guide covers the part that changes when you look for a Resend inbound alternative, which is the address itself. On Mailcycle each address is an object your code creates, with its own id, its own retention and its own encryption key, and every event names the address it arrived at.
The code is TypeScript with Hono, since many teams on Resend write TypeScript. The same calls exist in eight more SDKs.
Every statement about Resend below comes from Resend’s documentation and pricing page, read on 28 November 2026. The table at the end lists the page for each one.
How Resend receiving works
Resend’s receiving introduction gives every account a managed <id>.resend.app subdomain, found in the dashboard under Emails, on the Receiving tab.
Receiving on your own domain with an MX record
For your own domain, Resend’s custom domains page has you verify the domain, then copy an extra MX record from the Domains page into your DNS. Domains that already send through Resend get an Enable Receiving toggle. The page recommends a subdomain if the root domain already has MX records.
The email.received event
When mail lands, Resend posts an email.received event with type, created_at and a data object. Resend’s own note says that “webhooks do not include the email body, headers, or attachments, only their metadata”. The fields this guide maps are data.email_id, from, to, subject, message_id, created_at and the attachments list with each file’s id, filename, content_type and content_id.
Fetching the received email
The body comes from GET https://api.resend.com/emails/receiving/{id}, which returns text, html, reply_to, the sender’s display name in headers.from, and the attachment list. Attachment files come from the list attachments endpoint as a download_url, which the attachments guide says is valid for one hour.
Signatures and retries
Resend signs webhooks through Svix, with svix-id, svix-timestamp and svix-signature headers, and its verification page shows resend.webhooks.verify checking them against the raw body. Failed deliveries are retried on a published schedule, and the Webhooks page can replay a message by hand.
The Mailcycle model for a Resend developer
Three calls carry the whole flow. mc.addresses.create() returns a working address on a shared Mailcycle domain. A message.received event, signed with that webhook’s own secret, carries a messageId and the inboxId of the address. mc.messages.get(messageId) returns the message with every field opened in your process, attachments listed and ready to fetch.
If you are used to Resend’s event and then a fetch, nothing about the rhythm changes. What you gain is that the address is a first-class object: you can label it, give it a retention between 1 and 90 days, rotate its key or delete it, one address at a time.
An address per API call, on a domain that already receives
Creating user addresses in TypeScript
import { Mailcycle } from 'mailcycle-sdk';
export const mc = await Mailcycle.withApiKey({
apiKey: process.env.MAILCYCLE_API_KEY!,
phrase: process.env.MAILCYCLE_PHRASE!,
});
export async function provisionInbox(user: { id: string; handle: string; name: string }) {
const address = await mc.addresses.create({
prefix: user.handle,
label: user.name,
retentionDays: 30,
});
await db.users.update(user.id, { inboxId: address.id, inboundEmail: address.emailAddress });
return address.emailAddress;
}
The server appends a short random ending to prefix, so a handle like nadia becomes something like nadia-q4m8@ on a shared domain. The address is live the moment the promise resolves, with no DNS record to add and nothing to wait on. The label is sealed on your machine before the request leaves it, so the user’s name travels encrypted.
Why an address object beats a username convention
When the address is a record, routing is a lookup. Your code never builds a username format or parses one back out of the recipient: the address exists because you created it, and the event tells you exactly which one received the message. Deleting a user’s address ends their inbound mail in one call, with nothing left to filter.
The same pattern covers environments. A preview deployment can create a handful of addresses on start-up and delete them on teardown, and an integration test can create a fresh one per run, all under one API key.
Signed webhooks you create from code
Resend developers tend to keep infrastructure in code, and Mailcycle webhooks can live there too. A deploy script creates the webhook and receives its whsec_ secret once:
const { webhook, secret } = await mc.webhooks.create({
url: 'https://api.example.com/inbound/mailcycle',
events: ['message.received'],
name: 'production inbound',
});
await secrets.put('MAILCYCLE_WEBHOOK_SECRET', secret);
console.log('webhook', webhook.id);
An account holds up to 10 webhooks, each with its own URL, event list and secret, so production, staging and a local tunnel can each get one. If your receiver sits behind a gateway that wants a token, pass header: { name: 'Authorization', value: 'Bearer ...' } and Mailcycle sends it with every delivery. Its value is never returned by the API after you set it.
What a delivery carries
Each delivery is a POST with a JSON body of id, type, createdAt and a payload holding messageId and inboxId. The headers add Mailcycle-Signature, Mailcycle-Event-Id, Mailcycle-Event-Type and Mailcycle-Delivery-Id. The signature reads t=<unix seconds>,v1=<hex>, an HMAC-SHA256 of the timestamp, a full stop and the raw body.
A Hono receiver
import { Hono } from 'hono';
import { verifyWebhookSignature } from 'mailcycle-sdk';
const app = new Hono();
app.post('/inbound/mailcycle', async (c) => {
const raw = await c.req.text();
const ok = await verifyWebhookSignature(
process.env.MAILCYCLE_WEBHOOK_SECRET!,
raw,
c.req.header('Mailcycle-Signature'),
);
if (!ok) return c.body(null, 401);
const event = JSON.parse(raw);
if (event.type === 'message.received') {
await jobs.add('inbound', {
eventId: c.req.header('Mailcycle-Event-Id'),
inboxId: event.payload.inboxId,
messageId: event.payload.messageId,
});
}
return c.body(null, 204);
});
export default app;
c.req.text() hands you the body exactly as it was signed, which is what the helper needs. The check runs in constant time and rejects a timestamp more than five minutes from your clock. Reply within 10 seconds and let the job queue do the reading. The webhook hub post, Receive email with a webhook, covers the production details shared by every receiver: deduplication, Express, Next.js and FastAPI variants, and local testing.
Reading mail over REST
The job reads the message by id. GET https://api.mailcycle.email/messages/:id returns it sealed, and the SDK opens it with the address’s key:
export async function handleInbound(job: { eventId: string; inboxId: string; messageId: string }) {
if (!(await db.events.claim(job.eventId))) return;
const user = await db.users.findByInboxId(job.inboxId);
const message = await mc.messages.get(job.messageId);
if (!user) return db.unrouted.insert({ messageId: message.id, from: message.from });
const note = await db.notes.create({
userId: user.id,
title: message.subject,
body: message.text,
sender: message.fromName || message.from,
});
for (const file of message.attachments) {
if (file.mimeType.startsWith('image/')) {
const bytes = await mc.messages.attachment(message, file.index);
await storage.put(`notes/${note.id}/${file.filename}`, bytes);
}
}
}
mc.messages.attachment returns the file as bytes, already opened, whenever your job asks for it during the address’s retention. A job that runs from a queue an hour later, or a retry the next morning, reads the same file with the same call.
Listing mail at an address
Every message stays at its address for that address’s retention, 7 days by default and up to 90. mc.messages.list(inboxId) returns the newest first with a cursor for the next page, so a user-facing inbox view, a backfill or a nightly reconciliation job reads straight from the API whether or not a webhook fired.
Resend received email fields and their Mailcycle names
| Resend field | Mailcycle (TypeScript SDK) |
|---|---|
data.email_id |
payload.messageId in the event, id on the message |
to |
to, and inboxId names the receiving address |
from |
from |
display name in headers.from |
fromName |
reply_to |
replyTo, which falls back to the sender when none was set |
subject |
subject |
text |
text |
html |
html, plus safeHtml with remote images and embeds removed for display |
message_id |
messageId, ready for threading a reply |
created_at |
receivedAt |
attachments[].id |
attachments[].index, passed to mc.messages.attachment |
attachments[].filename, content_type, content_id |
filename, mimeType, contentId, plus size |
Mail encrypted on arrival
Mail is encrypted the moment it arrives, with keys from your account’s 12-word recovery phrase, and each address has its own key pair. Your server holds the phrase with its other secrets, and withApiKey derives the keys when the process starts. An event that passes through your load balancer, a tunnel or a request logger holds two ids and nothing a reader could use. Remote trackers are stripped in safeHtml, so an in-app view of a user’s mail renders without tracking pixels.
When the step after the webhook is a no-code tool, the decrypt Worker runs in your own Cloudflare account, opens one address’s mail and hands the parsed message to n8n, Make, Zapier or Pipedream. Encryption in the docs describes where the keys are made.
Retries and the delivery log
A delivery that gets no 2xx within 10 seconds is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 12 hours, eight attempts across roughly 36 hours. Each delivery stays in the log for 30 days with its attempt count and last response code, and the same API key that reads mail can replay them:
const hookId = process.env.MAILCYCLE_WEBHOOK_ID!;
let cursor: string | null = null;
do {
const page = await mc.webhooks.deliveries(hookId, { status: 'failed', limit: 200, cursor });
for (const delivery of page.deliveries) await mc.webhooks.redeliver(hookId, delivery.id);
cursor = page.nextCursor;
} while (cursor);
A redelivery keeps the original event id, so the claim in your job skips anything it already handled. This loop belongs in your incident runbook, next to the deploy that fixed the receiver.
SDKs in nine languages
The TypeScript SDK is one of nine, alongside Python, Go, Rust, Java, .NET, PHP, Ruby and Swift, all under Apache-2.0. Each has address creation, a webhook signature helper and a message read, so a Laravel app, a Rails app or a Go service handles inbound mail in its own language. Install lines are on the SDK pages, and each language has a tutorial for the read side:
- Receive email in Node.js, Python and Go
- Receive email in Ruby, PHP and C#
- Receive email in Java, Rust and Swift
The MCP server for agents
Developers building on an email API are often building agents too: an assistant that completes a sign-up, reads a confirmation code or answers a customer. On Scale, you create addresses for the agent, and mailcycle-mcp, running on the agent’s own machine, gives it tools to list its addresses, read messages, wait for new mail and read attachments. It works with Claude Code, Claude Desktop, Cursor, Codex, VS Code or any other MCP client, and an agent starts reply-only.
Pairing is one command, npx -y mailcycle-mcp pair. The email MCP server guide walks through it, and AI agent email inbox shows an agent and a webhook handler sharing one account.
Your own domain and replies on Scale
When users should write to notes@example.com or support@example.com, Scale adds 10 of your own domains and lets you choose the whole local part. You add the domain in the app, prove it with one TXT record and point its nameservers at Mailcycle, which then sets up receiving for you. Scale also sends from the API, so the handler above can answer from the address that received the mail:
await mc.messages.send({
from: user.inboundEmail,
to: message.replyTo,
subject: `Re: ${message.subject}`,
text: 'Saved to your notes.',
replyTo: message,
});
Passing the original as replyTo fills in the threading headers. The own domains guide has the domain steps, and Role addresses on your own domain shows support@ and billing@ set up this way.
Operator or Scale for a Resend inbound workload
Prices are on pricing and limits on plans and limits.
| Your inbound workload | Plan | Price a month | Includes |
|---|---|---|---|
| Inbound for your app on shared domains, read by webhook and API | Operator | $15 | 250 addresses, 250,000 received messages, API keys and 10 webhooks |
| Inbound with replies, your own domains or agent inboxes | Scale | $19 | 1,000 addresses, 750,000 received messages, 10 domains, sending from the API, agent inboxes |
Operator is the match for an app that receives and processes mail. Choose Scale when the same flow answers by email, when addresses must sit on your domain, or when an agent reads the inbox.
Porting a Resend inbound handler, step by step
- List the usernames or patterns your app hands out on the
resend.appsubdomain or your receiving domain, and the records each one belongs to. - Create one Mailcycle address per record with
mc.addresses.createand saveaddress.idbeside it. - Create a
message.receivedwebhook withmc.webhooks.createand store the secret. - Replace the Svix check with
verifyWebhookSignatureon the raw body. - Replace the fetch of the received email with
mc.messages.get, and the attachment download withmc.messages.attachment, using the field table above. - Hand out the new addresses in your app’s settings page, reply-to headers, docs and test fixtures.
- Run both handlers side by side for a few days, compare what each one stored, then switch receiving off on the old domain. Move your own domain to Scale last.
Add inbound email to your SaaS builds a full feature on this pattern, with tickets, threading and reply by email.
Testing the receiver
During development, point a Cloudflare Tunnel or ngrok URL at the Hono app and create a webhook for it. mc.webhooks.test(webhookId) sends a webhook.test event through your signature check, and Send test in the web app does the same from the API screen.
For tests that should not depend on a public URL, mc.messages.waitFor({ inboxId }) resolves with the next message at an address, opened. A Vitest case can create an address, send mail to it from your app, await the message and assert on the subject. The event stream carries the same events over a WebSocket for a long-running worker.
Troubleshooting the port
The signature never matches
Something parsed and re-serialised the body first, often a JSON middleware mounted before the route. Read it with c.req.text() in the handler, pass that string to verifyWebhookSignature, and call JSON.parse afterwards.
messages.get returns opened: false
The client was created without the phrase, or with a different account’s phrase. Pass the same MAILCYCLE_PHRASE the addresses were created under to withApiKey.
A user’s mail lands in the unrouted table
The address was created but its id was not saved, often because provisioning ran outside the sign-up transaction. Save inboxId in the same write that creates the user, and review the unrouted table after each deploy.
Related reading
- Receive email with a webhook, the production receiver every port shares
- SendGrid Inbound Parse alternative, Mailgun inbound Routes alternative and Postmark inbound alternative, the same move from other providers
- CloudMailin alternative, the same pattern in Ruby on Rails with Active Job
- Send email from TypeScript, for the Scale reply path
- Run an n8n workflow on every new email
- Webhooks guide, reading mail and the developer overview
Sources and dates
Each Resend statement above was read on 28 November 2026 on these pages:
| What | Page |
|---|---|
Managed <id>.resend.app subdomain, Receiving tab |
https://resend.com/docs/dashboard/receiving/introduction |
| Extra MX record, Enable Receiving toggle, subdomain advice | https://resend.com/docs/dashboard/receiving/custom-domains |
email.received fields, metadata only in the webhook |
https://resend.com/docs/webhooks/emails/received |
| Received email endpoint and its fields | https://resend.com/docs/api-reference/emails/retrieve-received-email |
Attachment list endpoint and download_url |
https://resend.com/docs/api-reference/emails/list-received-email-attachments |
download_url valid for one hour |
https://resend.com/docs/dashboard/receiving/attachments |
Svix headers and resend.webhooks.verify |
https://resend.com/docs/webhooks/verify-webhooks-requests |
| Retry schedule and replays | https://resend.com/docs/webhooks/retries-and-replays |
Mailcycle figures come from https://mailcycle.email/pricing and https://docs.mailcycle.email/concepts/plans-and-limits/. Resend is a trademark of its owner. We are not affiliated with Resend.
FAQ
What is a good alternative to Resend inbound email?
Mailcycle suits developers who want every user, project or workflow to have an address of its own. One API call creates the address on a shared domain that already receives mail, a signed message.received event names the message and the address, and your code reads the message over REST with an SDK in TypeScript, Python, Go, Rust, Java, .NET, PHP, Ruby or Swift.
How do I port a Resend email.received handler to Mailcycle?
Swap three things. Verify the Mailcycle-Signature header with verifyWebhookSignature instead of the svix headers, read payload.messageId where you read data.email_id, and call mc.messages.get(messageId) where you called the received email endpoint. The message comes back with from, to, subject, text, html and attachments already opened.
How do I know which user an inbound email belongs to?
Create one Mailcycle address per user with mc.addresses.create and save its id on the user record. Every message.received event carries that address id as inboxId, so your handler finds the user with one equality lookup and never parses the To header.
How are Mailcycle webhooks signed?
Each delivery carries a Mailcycle-Signature header of the form t=<unix seconds>,v1=<hex>, an HMAC-SHA256 of the timestamp, a full stop and the raw body, keyed with that webhook's whsec_ secret. The SDK helper checks it in constant time and refuses timestamps more than five minutes old.
Can I create the webhook from code instead of a dashboard?
Yes. mc.webhooks.create takes a URL, a list of events such as message.received and a name, and returns the webhook and its secret once. A deploy script can create a webhook per environment and write the secret straight into your secret store.
Which Mailcycle plan fits a Resend inbound workload?
Operator, at $15 a month, includes API keys, 10 webhooks, 250 addresses and 250,000 received messages a month. Scale, at $19 a month, adds 1,000 addresses, 750,000 received messages, 10 of your own domains, addresses you name yourself, sending from the API and AI agent inboxes. Plans are on https://mailcycle.email/pricing.
Do I need an MX record to receive email with Mailcycle?
On Operator, addresses are created on shared Mailcycle domains that already receive mail, so a new address takes mail as soon as the API call returns. On Scale, your own domains are proved with one TXT record, and receiving is set up for you once the nameservers point at Mailcycle.
How is inbound mail protected in Mailcycle?
Mail is encrypted the moment it arrives, with keys from your account's 12-word recovery phrase, and each address has its own key pair. Webhook events carry two ids and no content, and the SDK opens each message inside your own process.
Can an AI agent read the inbound mail directly?
Yes. On Scale, the mailcycle-mcp server runs on the agent's own machine and gives Claude Code, Claude Desktop, Cursor, Codex or any other MCP client tools to list its addresses, read messages, wait for new mail and read attachments.
Receive email in code
- AgentMail Alternative for AI Agent Inboxes (AgentMail alternative)
- CloudMailin Alternative: Inbound Email to Rails With an Address per API Call (CloudMailin alternative)
- Mailgun Inbound Routes Alternative: Route Mail by Address, Not Regex (Mailgun Routes alternative)
- Mailosaur Alternative for Email Testing and Test Inboxes (Mailosaur alternative)
- Mailparser and Parseur Alternative: Incoming Email as JSON on a Webhook (Mailparser and Parseur alternative)
- MailSlurp Alternative for Email Testing and Test Inboxes (MailSlurp alternative)
- Mailtrap Alternative for Email Testing and Test Inboxes (Mailtrap alternative)
- Postmark Inbound Alternative: Addresses by API, Signed Webhooks (Postmark inbound alternative)
- SendGrid Inbound Parse Alternative: Inbound Email by API Call (SendGrid Inbound Parse alternative)
- Testmail.app Alternative for Email Testing and Test Inboxes (Testmail.app alternative)
- Test Email Flows on Real Devices with Appium: Read Sign-Up Codes in Python (Appium)
- How to Give a Browser Use Agent an Email Address and Let It Read Its Own Verification Code (Browser Use sign-ups)
- How to Receive Email in C#: Read the Inbox, Save Attachments and Get New Mail Pushed (C# / .NET)
- How to Test Email Verification in Cypress: Receive Sign-Up Codes with cy.task (Cypress)
- Ethereal Email Alternative: Test Nodemailer Emails with an Address per Test (Ethereal Email alternative)
- Golang Receive Email: How to Receive and Read Email in Go (Go)
- How to Read Email in Java: Read the Inbox, Save Attachments and Receive Mail in Spring Boot (Java)
- How to Receive Email in PHP with an Email API: Read the Inbox, Save Attachments and Handle Webhooks (PHP / Laravel)
- How to Receive Email in Python: Read the Inbox, Save Attachments and Get New Mail Pushed (Python)
- Receive Email in Ruby and Rails: Read the Inbox, Save Attachments and Handle Webhooks (Ruby)
- How to Receive Email in Rust: Read the Inbox, Save Attachments and Handle Webhooks in Axum (Rust)
- Add Inbound Email to Your SaaS: Support Intake and Reply-by-Email (SaaS support)
- How to Verify Email in Selenium Tests: Read Sign-Up Codes with Python and pytest (Selenium)
- How to Handle Email Verification in a Stagehand Browser Agent: Create an Address, Wait for the Code, Delete It (Stagehand sign-ups)
- How to Receive Email in Swift: Read the Inbox, Save Attachments and Handle Vapor Webhooks (Swift)
- Test Accounts for Security Testing: a Separate Email Address per Program (Test accounts for security testing)
- How to Automate Email Verification in Tests with Playwright: OTP Codes, Magic Links and Password Resets (Testing email verification)
- How to Receive Email in Node.js: Read the Inbox, Save Attachments and Handle Webhooks (TypeScript / Node.js)
- How to Receive Email with a Webhook: Inbound Email to Your HTTP Endpoint (Webhooks)