Email routing is the process of directing an email message from its sender to the correct receiving mail server, mailbox, application, or workflow. It begins with domain-level DNS lookups such as MX records, continues through SMTP delivery between servers, and may include rules that forward, store, filter, reject, or send inbound mail to an application endpoint.
What is email routing?
At its simplest, email routing answers one question: where should this message go next? For an outbound message, routing determines which receiving server should accept mail for the recipient domain. For inbound email, it can also determine whether a message should land in a shared inbox, be forwarded to another address, trigger a support ticket, enter a database, or be delivered to an application over HTTP.
That distinction matters because people use the term in more than one way:
- Internet email routing is the domain-to-domain process used to deliver a message through SMTP.
- Inbound email routing is the rule-based handling of messages after a receiving service accepts them.
- Outbound traffic routing is the sender-side choice of infrastructure, IP pool, region, or provider connection used to transmit a message.
- Mailbox routing is the receiving organization’s internal decision about which mailbox, group, archive, security system, or application should receive a message.
SMTP is the foundational protocol for transferring email between mail systems. A sending mail transfer agent uses the recipient domain to determine where to attempt delivery, then connects to an appropriate receiving server and submits the message using SMTP commands and responses. (datatracker.ietf.org)
A useful way to picture the process is a postal network. The address after the @ sign identifies the destination domain, DNS provides the delivery-office lookup, SMTP transports the envelope, and receiving rules decide whether the message goes to a person, a team queue, an archive, or an automated process.
Email routing is not itself a deliverability metric. There is no universal "email routing rate" comparable to bounce rate or complaint rate. Instead, it is infrastructure and policy: a chain of routing decisions that can create or prevent delivery failures, delays, loops, duplicate processing, authentication issues, and poor campaign outcomes.
Why email routing matters for deliverability
Correct routing is a prerequisite for delivery. A beautifully designed lifecycle email with a valid recipient address still cannot arrive if the sender cannot locate a usable destination server, if the destination server rejects the SMTP transaction, or if a forwarding rule sends the message into a loop.
For marketing and transactional senders, routing affects deliverability in several practical ways.
It determines whether a receiver can be reached
When a sender delivers mail to person@example.net, the sending server needs routing information for example.net. In ordinary direct-to-MX delivery, it queries DNS for that domain’s MX records. MX records identify mail exchangers and assign each a preference value; lower values are preferred. If no MX record exists, SMTP specifications describe a fallback to the domain’s address record in some circumstances, although relying on that behavior is rarely a sensible operational design. (datatracker.ietf.org)
A malformed, missing, stale, or unreachable DNS destination can produce deferrals or permanent failures. From a sender’s perspective, that may look like a domain-level delivery problem rather than a problem with the individual recipient.
It changes the path where policy is enforced
Every additional routing hop can add another system that evaluates the message. A gateway may scan for malware, enforce attachment limits, check authentication, rewrite headers, apply data-loss-prevention policies, or reject suspicious content. A forwarder may also change the path enough to complicate sender authentication checks.
This is especially important for domain-based authentication. Gmail’s sender guidance requires all senders to use SPF or DKIM, while bulk senders to personal Gmail accounts must use SPF, DKIM, and DMARC. Gmail also explains that indirect messages, including forwarded or mailing-list messages, can be treated differently for DMARC alignment purposes. (support.google.com)
The practical lesson is not that forwarding is inherently bad. It is that a message’s route affects the evidence a receiving provider uses to decide whether that message is legitimate.
It influences delivery speed and customer experience
A transactional email is often useful only inside a narrow time window. A password-reset link delivered 25 minutes late is not merely inconvenient; it can create support tickets, duplicate requests, and security concerns. Likewise, a delayed order confirmation can cause customers to wonder whether their payment succeeded.
Routing reliability therefore supports campaign performance as well as operational correctness. If messages repeatedly defer because a route is unavailable, a sender may see delayed delivery, lower time-sensitive conversion, and noisier engagement data. A campaign might appear to have weak opens or clicks when the real issue is that a portion of its audience received the message long after the offer was relevant.
It can preserve or fragment reputation signals
Recipient systems evaluate mail using many signals, including authentication, sending domain, IP reputation, content, user feedback, and traffic patterns. Routing architecture does not replace sound sending practices, but it can make reputation management harder when messages are sent unpredictably across unrelated domains, IPs, or providers.
For example, a company that sends receipts through one authenticated domain, password resets through an unaligned third-party address, and marketing mail through an unmonitored legacy relay creates three different operational paths to audit. A simpler route design makes failures easier to identify and makes authentication and reputation monitoring more coherent.
How email routing works from sender to inbox
A typical message travels through a sequence of systems rather than moving directly from an application to a recipient’s inbox.
- An application creates a message and hands it to a sending service or SMTP server.
- The sender accepts the message for delivery and examines the envelope recipient, such as
customer@example.net. - The sender looks up DNS records for the recipient domain to identify the next-hop mail server.
- The sender establishes an SMTP connection to a receiving server and attempts delivery.
- The receiving service applies its own security, policy, and mailbox-routing rules.
- The message is accepted into a mailbox, forwarded internally, quarantined, routed to an application, or rejected.
The visible To: header is important to the recipient, but SMTP routing is based on envelope recipients supplied during the SMTP transaction. Those two values can differ. A message may be addressed in a visible header to one person while the envelope contains multiple recipients, a blind-copy recipient, or a service address that routes the message into a system.
MX records: the public routing map
An MX record is a DNS record that says which host receives email for a domain. Consider this simplified example:
example.net. 3600 IN MX 10 mx1.example.net.
example.net. 3600 IN MX 20 mx2.example.net.
The numbers 10 and 20 are preference values. A sender normally tries the lower-preference destination first, then uses another eligible destination when necessary. The hostnames must in turn resolve to IP addresses through address records.
MX records are for receiving mail. They do not authorize a domain to send mail, and they do not replace SPF, DKIM, or DMARC. Confusing these DNS roles is a common setup error. An MX record directs inbound mail; an SPF TXT record identifies authorized sending infrastructure; DKIM publishes a public key used to validate signatures; and DMARC publishes a policy and alignment instructions for receivers.
SMTP routing: the server-to-server handoff
Once the sender identifies a destination, it attempts an SMTP conversation. At a high level, the sender introduces itself, supplies the envelope sender, supplies one or more recipients, and transmits the message data if the recipient server accepts the transaction.
A response code matters. A 2xx response generally indicates success at that stage. A 4xx response usually means the sender should defer and retry later. A 5xx response generally indicates a permanent failure for that transaction or recipient. The exact meaning depends on the server’s enhanced status code and explanatory text, so operations teams should retain full SMTP responses rather than reporting only a generic "failed" event.
This is one reason an email API should expose useful event data. Engineering teams need to distinguish an accepted message, a delayed message, a hard bounce, a complaint, and an application-level inbound-routing failure. For implementation details such as SMTP setup and sending patterns, consult the email API reference and setup guides.
Routing after acceptance
The first receiving server is not necessarily the final destination. A company may receive mail at a secure gateway, send it to a cloud mailbox provider, and then apply internal rules that place it in a mailbox or group.
Inbound email platforms can add programmable routing on top of this. A route can match an incoming recipient, header, or broad catch-all condition and then perform an action. Mailgun, for example, documents routes that match expressions and can forward a message to an HTTP endpoint or another email address, store it temporarily, or stop later routes from being processed. Its route filters support recipient and header matching, including regular expressions. (documentation.mailgun.com)
Amazon SES uses a related but differently named model for receiving mail: receipt rules apply actions when a recipient address or domain matches. Its documentation describes rule sets and receipt rules as ordered, with rules containing ordered actions. (docs.aws.amazon.com)
Inbound email routing for applications
Inbound routing lets an application treat email as an input channel. Rather than giving every workflow a manually monitored mailbox, a company can accept messages at a domain or subdomain and route them to software.
Common examples include:
- Sending
reply@updates.example.comreplies into a customer-support platform. - Receiving invoices at
ap@example.comand passing attachments to an accounts-payable workflow. - Routing
anything@reply.example.cominto a product database while preserving the recipient local part as an identifier. - Sending security reports such as
dmarc-reports@example.comto an archive and parser. - Receiving partner submissions at a dedicated address and forwarding structured message data to a webhook endpoint.
Recipient-based routing
Recipient-based routing is usually the safest starting point because it is explicit. For example, a business might define these logical rules:
billing@example.com -> finance ticket queue
support@example.com -> support platform webhook
security@example.com -> monitored security mailbox
*@replies.example.com -> reply-processing service
The last rule is a catch-all pattern. It can be useful, but it should be designed carefully. A catch-all accepts mail sent to misspelled or guessed addresses, which may create unwanted traffic, abuse opportunities, or confusing application behavior.
A better pattern is to combine a catch-all with validation inside the receiving application. If the local part is expected to contain a signed token, order ID, or known conversation ID, reject or safely quarantine messages whose identifiers do not validate.
Header-based routing
Some inbound services allow matching based on headers such as From, Subject, or custom application headers. This can support workflows such as directing messages tagged with a project identifier to a particular queue.
However, headers supplied by external senders are not inherently trustworthy. Do not use an ordinary From: header as the sole authorization mechanism for a sensitive workflow. Sender addresses can be spoofed, display names are easy to imitate, and forwarded messages can alter what an application sees.
For sensitive inbound actions, combine routing with independent controls:
- Verify a webhook signature from the receiving provider.
- Authenticate users through a separate product workflow before changing account data.
- Validate tokens embedded in recipient addresses or message headers.
- Scan attachments before storing or processing them.
- Limit message size, attachment types, and parser execution time.
- Log the route rule, provider event ID, recipient, and final action for auditability.
Webhook routing and retries
When inbound mail is forwarded to an HTTP endpoint, delivery becomes a distributed-systems problem. The email platform has accepted the SMTP message, but your application still needs to accept, validate, process, and acknowledge the webhook request.
Your endpoint should respond quickly, treat requests as potentially duplicated, and put slow work on a queue. A robust design validates the provider signature, writes an idempotency key, stores raw message metadata safely, and returns success before performing expensive attachment extraction or language processing.
Avoid a route that forwards production mail directly to a development server or an endpoint with no monitoring. If the endpoint is unavailable, messages may be retried, delayed, discarded after a provider-specific retention period, or processed multiple times depending on the platform and configuration.
Outbound email routing and sending architecture
When people discuss deliverability, they often mean outbound routing: the path from an application through a sending platform to recipient domains. This can include an API connection, SMTP relay, region selection, dedicated versus shared IPs, domain configuration, and fallback behavior.
The application normally should not perform direct MX delivery itself unless the team is prepared to operate mail infrastructure. Reliable outbound delivery requires queue management, retry handling, TLS, DNS behavior, bounce processing, abuse controls, feedback-loop handling where available, authentication, IP reputation operations, and observability.
Separate message streams before they need different treatment
A sound architecture separates traffic by purpose, not merely because it is convenient for developers. Password resets, receipts, product alerts, newsletters, and prospecting campaigns have different urgency, expected engagement, unsubscribe requirements, and risk profiles.
A practical segmentation model might be:
- Transactional: password resets, verification links, receipts, invoices, critical service notices.
- Lifecycle: onboarding messages, trial reminders, re-engagement sequences, product education.
- Marketing: newsletters, launches, promotions, event invitations.
- Operational inbound: replies, support intake, automated reports, machine-generated messages.
Segmentation does not mean every stream requires a separate domain and IP address from day one. It means you should be able to measure and control them independently when their behavior diverges. At minimum, use distinct tags, event categories, or sending domains where appropriate, and ensure every stream has clear ownership.
Avoid accidental provider or domain switching
A common routing mistake occurs during a migration or incident: an application sends some messages through a new API, some through an old SMTP relay, and some through a framework default that nobody realized was active. The results can include duplicate sends, inconsistent DKIM signatures, broken unsubscribe headers, mismatched return paths, and fragmented reporting.
Create a routing inventory that lists every application, environment, domain, subdomain, sender identity, provider credential, webhook, and fallback behavior. Then test the route intentionally. A message trace should answer these questions:
- Which application created the message?
- Which credential or API key submitted it?
- Which sending domain and DKIM selector signed it?
- Which infrastructure accepted it for delivery?
- Which recipient domain received it?
- What final SMTP or mailbox outcome was recorded?
Email routing and authentication
Routing and authentication are separate controls, but they interact constantly. A route tells a system where to send a message; authentication helps a receiver decide whether the message is legitimately associated with the sender domain.
SPF and forwarded messages
SPF evaluates whether the IP address that delivered a message is authorized to send for the envelope-sender domain. When a message is forwarded, the forwarder’s IP—not the original sender’s IP—may be the system that connects to the final mailbox provider. That can cause SPF to fail unless the forwarding system uses a mechanism designed to preserve or communicate authentication results.
This is why a sender should not assume that an SPF pass at the first receiving server guarantees a pass everywhere else. DKIM is often more resilient across ordinary forwarding because the signature can survive if signed content is not modified, although mailing lists and gateways may alter messages enough to invalidate it.
DKIM, DMARC, and aligned identities
DKIM signs selected message components using a private key, while the corresponding public key is published in DNS. DMARC evaluates whether SPF or DKIM passes and aligns with the visible From: domain. Google’s current guidance for bulk senders includes SPF, DKIM, and DMARC requirements, making alignment and consistent domain usage operationally important. (support.google.com)
For route design, the takeaway is straightforward: do not casually rewrite the visible From: address, envelope sender, or signing domain across different message paths. If a transactional system sends from notify.example.com and a campaign platform sends from an unrelated domain, recipients and mailbox providers see a less consistent identity.
Reverse DNS and transport security
Large-volume senders should also make sure sending IP addresses have valid forward and reverse DNS records and use secure transport where supported. Gmail includes valid PTR records and TLS among its bulk-sender guidance. (support.google.com)
These are not routing rules in the application sense, but they affect whether a receiver trusts the infrastructure participating in the route. A technically reachable server is not necessarily a trusted one.
Common email routing problems and their causes
When routing fails, the visible symptom may be a bounce, delay, missing inbound webhook, or messages arriving in the wrong system. The right fix depends on where the route broke.
Missing or incorrect MX records
A domain may have no MX record, point to a retired provider, include a typo, or reference hostnames that do not resolve. In some cases, the domain may intentionally not accept email, but application teams often discover the issue only after campaign sends produce a concentration of domain-specific failures.
How to fix it: review the authoritative DNS zone, verify each MX hostname resolves, confirm that the destination service is configured to accept mail for the domain, and allow for DNS propagation after changes. Do not add an MX record that points to a service unless that service is actually prepared to receive mail for the domain.
Wrong priority or rule order
Routing systems often evaluate rules in priority order. A broad catch-all placed before a specific route can consume a message before the intended rule sees it. Mailgun documents that route priority is ordered, with a smaller number handled first, and that later routes continue to be evaluated unless a stop() action runs. (documentation.mailgun.com)
How to fix it: put the most specific routes first, explicitly decide which routes may fan out to multiple actions, and stop processing when only one destination should receive a message. Test both positive and negative cases: the address that should match and a similar address that must not.
Forwarding loops
A loop occurs when one route forwards mail to an address that eventually routes it back to the original system. Loops can happen across aliases, help desks, shared mailboxes, gateways, and catch-all rules.
How to fix it: map every forwarding hop, set maximum hop or loop protection where the system supports it, avoid forwarding a catch-all domain back into itself, and use distinct subdomains for programmatic replies. Review Received: headers in a test message to see the actual route.
Inbound webhook failures
The email provider may receive the message correctly, but the configured endpoint may return an error, time out, reject the request, or fail signature validation. This is an application-delivery failure, not necessarily an SMTP failure.
How to fix it: monitor webhook response codes and latency, use a highly available public endpoint, validate the provider’s signing method precisely, queue work asynchronously, and create alerts for retry exhaustion or unexpected drops in inbound event volume.
Authentication failures after routing changes
A team may introduce a new relay, a forwarding service, or a different sending domain without updating SPF, DKIM, and DMARC. Messages can still be transmitted, but acceptance and inbox placement may worsen.
How to fix it: authenticate every active sending domain, inspect actual delivered headers at major mailbox providers, confirm DKIM passes for the intended domain, and verify DMARC alignment against the visible From: address. Google Postmaster Tools provides dashboards for reputation, authentication, spam rate, and delivery errors for eligible traffic. (support.google.com)
Overly broad catch-all routing
Catch-all routes are attractive because they reduce setup effort. They also make it easy for spam, typoed addresses, and unrecognized reply tokens to enter an application pipeline.
How to fix it: use explicit recipient addresses when possible. If you need wildcard addressing, make the recipient local part structured and verifiable, reject unknown tokens safely, rate-limit processing, and monitor inbound volume by recipient pattern.
How to improve email routing reliability
Improving email routing is less about one setting and more about designing a controlled path from message creation to final outcome.
Build a route map
Document the complete path for each email stream. Include the originating service, sending domain, return-path domain, DKIM selector, provider, recipient domain behavior, inbound destinations, and failure owner.
A route map turns vague questions such as "Why did this email not arrive?" into a traceable investigation. It also exposes risky hidden dependencies, such as a legacy forwarding rule or an application that still uses a retired SMTP credential.
Use purpose-built subdomains
Subdomains make routing and identity clearer. For example:
mail.example.com -> transactional sending identity
news.example.com -> marketing sending identity
replies.example.com -> inbound reply processing
inbound.example.com -> application-specific receiving routes
This does not automatically improve inbox placement. Its value is operational separation: DNS records, authentication, inbound MX configuration, logs, and ownership are easier to understand when each function has a defined namespace.
Test routing with realistic scenarios
A successful API response only proves that your sending platform accepted the request. It does not prove that a recipient mailbox accepted the message, that a forwarding rule triggered correctly, or that your webhook processed the payload.
Test at least these cases before relying on a route in production:
- A valid recipient that should reach the intended destination.
- An invalid recipient that should be rejected or handled safely.
- A message with an attachment.
- A reply to a transactional message.
- A duplicate webhook delivery.
- A temporarily unavailable webhook endpoint.
- A recipient address that could accidentally match a catch-all.
- A message sent through each production and fallback path.
For outbound lists, validate addresses before high-volume sends. A free address verification tool can help catch malformed or risky addresses before they become avoidable hard bounces, though verification should complement—not replace—ongoing bounce and engagement suppression.
Monitor the right events
Monitor routing as a funnel, not as a single success count. For outbound traffic, track submission, provider acceptance, delivery, deferral, hard bounce, soft bounce, complaint, unsubscribe, and engagement events. For inbound traffic, track SMTP acceptance, route match, forwarding attempt, webhook response, processing success, and final application outcome.
Alert on changes, not only absolute failures. A sudden increase in deferrals to one recipient domain, a drop in inbound webhook volume, or a spike in unmatched recipients often identifies a routing change before customers report it.
A practical email routing example
Imagine a software company named Northstar that sends product mail from example.com.
It uses these domains and paths:
alerts.example.com transactional notifications
news.example.com newsletter campaigns
replies.example.com inbound reply handling
support@example.com human support mailbox
A customer receives a password-reset email from security@alerts.example.com. Northstar’s application submits the message through its email provider. The provider signs the message with DKIM for the sending identity and attempts SMTP delivery to the MX records for the customer’s mailbox domain.
When the customer replies, the reply is addressed to a tokenized address such as r-8f3c91@replies.example.com. The MX records for replies.example.com direct the message to Northstar’s inbound email service. An inbound route matches the replies.example.com domain and forwards the parsed message to Northstar’s webhook endpoint.
Northstar’s application validates the provider signature, checks that 8f3c91 maps to a real conversation, stores the message, and adds it to the relevant support thread. If the token is unknown, the application records the event and places the message in a safe review queue rather than automatically attaching it to an account.
This design separates sending from receiving, makes reply routing observable, and limits the blast radius of an unknown recipient. It also prevents a reply-processing catch-all from being treated as a trusted authorization mechanism.
Email routing best-practice checklist
Use this checklist when designing or reviewing an email route:
- Publish MX records only for domains and subdomains that should receive email.
- Verify that every MX hostname resolves and that the destination service accepts the domain.
- Keep recipient-based rules specific; place broad catch-alls after specific rules.
- Understand whether multiple route actions run or whether processing stops after a match.
- Authenticate every outbound sending domain with the required SPF, DKIM, and DMARC records.
- Keep visible
From:domains, DKIM identities, and return paths intentional and consistent. - Use separate streams for transactional, lifecycle, marketing, and inbound operational traffic.
- Treat inbound webhooks as authenticated, retryable, idempotent integrations.
- Retain SMTP status codes, provider event IDs, and routing logs for troubleshooting.
- Test failures deliberately, including DNS mistakes, endpoint timeouts, duplicate events, and loop scenarios.
- Review routing after provider migrations, domain changes, acquisitions, and major application releases.
Conclusion
Email routing is the delivery logic behind every message: DNS identifies where a domain receives mail, SMTP moves the message between systems, and receiving rules determine what happens next. It is not a rate to optimize in isolation, but a foundational part of reliable sending, secure inbound processing, and deliverability.
The strongest routing designs are explicit, authenticated, observable, and simple enough for an engineer to trace end to end. Use clear domain boundaries, narrowly scoped rules, tested fallback behavior, and event-level monitoring. When a message takes an unexpected path, the goal should be to identify exactly where that path changed—and fix the route rather than guessing at the inbox outcome.
FAQ
Is email routing the same as email forwarding?
No. Email forwarding is one possible routing action: a receiving system accepts a message and sends it onward to another address or endpoint. Email routing is broader and includes MX lookup, SMTP next-hop delivery, mailbox rules, gateways, application webhooks, and forwarding.
Is email routing a deliverability metric?
No. Email routing is not a standardized metric like bounce rate, complaint rate, or delivery rate. It is the technical path and rule set that determines how email moves. Routing failures can contribute to bounces, delays, or authentication problems that affect deliverability.
What does an MX record do in email routing?
An MX record tells other mail servers which host or hosts receive email for a domain. Senders use those records to choose a destination server for SMTP delivery. MX records do not configure outbound authorization; SPF, DKIM, and DMARC serve different authentication purposes.
Can a catch-all email route hurt deliverability?
A catch-all inbound route does not directly determine how your outbound marketing mail lands in inboxes. But it can create operational issues by accepting spam, typoed addresses, and unwanted traffic, and it can introduce loops or unreliable reply handling if it is poorly designed.
How do I troubleshoot an email routing issue?
Start by identifying whether the failure is outbound SMTP delivery, DNS resolution, inbound rule matching, forwarding, or application webhook processing. Check the recipient domain’s MX records, retain the complete SMTP response, inspect message headers, verify authentication results, and review route-rule order plus webhook logs.