Receiving email
Receive mail at your project's address or on your own domain, get an email.received webhook, then read the message, its attachments and the raw file through the API.
exx.sh can receive mail for your application: replies to your emails, support inboxes,
anything sent to an address you hand out. Each message is stored for your project, a
email.received webhook tells your application it arrived, and the API gives you its
content, its attachments and the original file. The shapes are Resend's, so Resend's SDKs
read received mail from exx.sh unchanged.
Pick an address
Your project's address (nothing to set up)
Every project receives mail at <anything>@<project-slug>.in.exx.sh, on by default: any
local part works, so support@…, replies+123@… and invoice-42@… all reach the same
project. The dashboard's Receiving page shows the address to copy.
Your own domain or subdomain
To receive at you@acme.com (or better, a subdomain such as inbound.acme.com that has no
mailbox elsewhere), add the domain to the project and turn on receiving, on the domain's
page in the dashboard or with PATCH /domains/{id}:
curl -X PATCH "https://api.exx.sh/domains/$DOMAIN_ID" \
-H "Authorization: Bearer $EXX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"capabilities": {"receiving": "enabled"}}'The domain's records then list a Receiving MX record at the domain itself: publish
MX <Receiving of="priority" /> <Receiving of="mx" /> at your DNS provider. exx.sh checks
it like the sending records and shows receiving_status; mail is accepted once it is
verified and the domain itself is verified. A domain whose name servers you delegated
to exx.sh gets the record published for you.
An MX record sends all of that name's mail to exx.sh, so do not point the MX of a domain whose mailboxes live elsewhere (your team's Google Workspace or Microsoft 365, for example) at us: use a subdomain. Turning receiving off removes only the MX; your sending records stay.
exx.sh refuses mail for an address nobody receives at (an unknown project, a domain without receiving) while the sender is still connected, so no stray bounces are sent. Receiving is never a relay: mail is stored for your project, not passed on.
Get notified
Subscribe a webhook to email.received:
curl -X POST https://api.exx.sh/webhooks \
-H "Authorization: Bearer $EXX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"endpoint": "https://acme.com/webhooks/exx", "events": ["email.received"]}'The event carries the message's metadata only, as Resend's does:
{
"type": "email.received",
"created_at": "2026-11-21T09:30:00.412Z",
"data": {
"email_id": "019a4c7e-3b1d-7f00-9c2e-5b8f1d2a3c4e",
"created_at": "2026-11-21T09:30:00.398Z",
"from": "customer@example.com",
"to": ["support@acme.com"],
"cc": [],
"bcc": [],
"received_for": [],
"message_id": "<CAF=abc@mail.example.com>",
"subject": "Where is my order?",
"attachments": [
{
"id": "019a4c7e-3b1e-7a10-8d3f-0c1e2f3a4b5c",
"filename": "receipt.pdf",
"content_type": "application/pdf",
"content_disposition": "attachment",
"content_id": null
}
]
}
}A webhook limited to some domains gets the mail received on those domains; mail to the
project's address reaches webhooks without a domain list.
Read the message
Fetch the body and headers with
GET /emails/receiving/{id}, using the
email_id of the event:
import { Resend } from "resend";
const resend = new Resend(process.env.EXX_API_KEY, { baseUrl: "https://api.exx.sh" });
const { data: email } = await resend.emails.receiving.get(event.data.email_id);
console.log(email.subject, email.text, email.headers["in-reply-to"]);The answer has text, html, headers (by lower-case name), reply_to, cc,
received_for and authentication: the SPF, DKIM and DMARC verdicts exx.sh computed when
the message arrived (pass, fail, gray, processing_failed), never what the message
claims about itself. exx.sh adds spam_score, quarantined and authentication_results
(every check in detail).
Treat html as hostile: it was written by whoever sent the mail. Never show it on your own
site's origin without sanitizing it or isolating it in a sandboxed frame. Inline images are
cid: references (html_format is always cid); each matches the content_id of an
attachment.
GET /emails/receiving lists received
mail, newest first, 20 at a time (limit up to 100, after/before to page), and filters
by recipient (to, comma-separated) and date (start_date, end_date).
Download attachments and the raw message
GET /emails/receiving/{id}/attachments
lists the attachments, each with a download_url that needs no API key and works for
1 hour; list them again for fresh links.
const { data: attachments } = await resend.emails.receiving.attachments.list({
emailId: event.data.email_id,
});
for (const file of attachments.data) {
const body = Buffer.from(await (await fetch(file.download_url)).arrayBuffer());
// store or process `body` (file.filename, file.content_type)
}Files are always served as downloads, never displayed by the browser. The email's raw
field holds a link to the original message as an .eml file, the way it reached us, with
our Received and Authentication-Results lines on top.
Quarantine
When the virus scan cannot give a verdict on a message, exx.sh keeps it but holds it for
review: it is listed and readable with quarantined: true, sends no webhook, and its
attachments and raw file stay closed (403 exx_email_quarantined) until our team releases
it. A released message sends its email.received then; one found harmful is deleted.
Infected mail is refused before it is stored.
Limits and retention
- A message may be at most 10 MiB, to at most 100 recipients in one delivery.
- Received mail counts toward the monthly receiving budget of your plan, separate from your sending quota: mail from strangers never uses up your sending.
- Received mail, its attachments and the raw file are kept for 30 days on every plan, then deleted.
- Reading received mail needs a full access API key; a sending key cannot.
Webhooks
Receive a signed event for every delivery, bounce and complaint. Set up an endpoint, verify signatures, handle retries and rotate the signing secret.
Forwarding received mail
Send mail received at your project's address or your domain on to another inbox, once its owner confirms, without spoofing the sender or opening a relay.