NightmailDocs
Docs
Guide

Receiving

How mail reaches your domain and where it goes: addresses, routes, rules and endpoints.

What happens to an email

Mail sent to one of your addresses arrives at Nightmail through your domain’s receiving MX record. Nightmail finds the address’s route, runs its rules, then delivers it: to the address’s Inbox, and to any endpoints its route or rules name. You read it in Receiving → Inbox, over the API or from an agent.

WordWhat it isExample
AddressAn email address that receives mail. It keeps its own threads in the Inbox.support@acme.com
RouteEvery address that receives mail, and where its mail goes.support@acme.com → triage → Inbox, Slack support
RuleWhat happens to an address’s mail: post, forward, junk or label it.Post new mail to support in Slack
EndpointNamed places mail can be sent: Slack, Discord, a webhook or a forward.endpoints.support({ text: email.subject })
Catch-allWhat happens to mail for an address that doesn’t exist on the domain: store it, or create an address for it.*@acme.com
Agent inboxAn expiring address that an agent or a test creates and reads.Agent inboxes

Where your domain receives: reply.yourdomain or the domain itself

Receiving needs an MX record, and a domain can only send its mail to one place. So Nightmail suggests a free subdomain, usually reply.yourdomain.com: addresses there, such as support@reply.yourdomain.com, come to Nightmail, while mail to yourdomain.com itself keeps going to your current mailboxes.

Nightmail receives on the domain itself only when its MX record already points to Nightmail, or when you choose it on the domain’s page. Choosing the root moves all of the domain’s mail to Nightmail, so the page asks first. Onboarding and the domain’s page always show the host Nightmail chose, with the reason.

Set it up

  1. Open Domains, choose the domain and publish its Receiving MX record at your DNS provider. Nightmail turns receiving on once it resolves.
  2. In Mail routing, choose New address, for example support@reply.yourdomain.com.
  3. Send it a test email. It shows up on the address’s Mail tab within seconds.
  4. Optional: add an endpoint (Slack, a webhook…) and a rule that chooses which mail goes there.

Over the API

Create an address with createInboundAddress, list conversations with listInboundThreads and reply with replyToInboundThread. From the built-in domain, a reply goes only to members of your workspace for now; to answer anyone else, add a domain of your own. To get each message as it arrives, subscribe a URL to message.received with createInboundWebhook.