Skip to content
Signet
Blog

How email is delivered: MX records, SMTP and the checks in between

When you press send, your message passes between several mail servers before it reaches the recipient. This post follows it step by step: submission, the DNS lookup, the SMTP handover, the receiving server’s checks, and delivery.
Updated 5 min read
  • Delivery
  • Transport

How does email get from sender to recipient?

Delivery happens in five steps:

  1. Submission: your mail client hands the message to your provider’s server.
  2. Lookup: that server asks DNS which server receives mail for the recipient’s domain.
  3. Transfer: it connects to that server and passes the message over with SMTP.
  4. Checks: the receiving server decides whether to accept the message and where to file it.
  5. Delivery: the message is stored in the recipient’s mailbox, where their mail client reads it.

What happens when you press send?

Your mail client does not deliver the message itself. It signs in to your provider’s submission server, normally on port 587, and hands the message over (RFC 6409). Signing in lets your provider confirm the message really comes from your account before it sends it on to other servers.

How does a mail server find the recipient’s server?

The sending server takes the domain after the @ in the recipient’s address and looks up its MX records in DNS. Each MX record names a mail server and a preference number. Servers with lower numbers are tried first.

MX records for a domain
example.org.  MX  10 mx1.mail.example.net.
example.org.  MX  20 mx2.mail.example.net.

Two edge cases are worth knowing. If a domain publishes no MX records, the sending server treats the domain’s own address record as its mail server (RFC 5321, section 5.1). A domain that receives no mail at all can publish a null MX, a single MX record pointing at ., so that senders stop trying (RFC 7505).

How do two mail servers transfer a message?

Servers transfer mail with SMTP on port 25, as a short exchange of plain-text commands. The sending server introduces itself, gives the envelope sender and recipients, sends the message, and waits for a reply code that says whether it was accepted.

An SMTP conversation, abbreviated
S: 220 mx1.mail.example.net ESMTP
C: EHLO mail.example.com
S: 250-STARTTLS
C: STARTTLS
   (the connection is now encrypted)
C: MAIL FROM:<[email protected]>
C: RCPT TO:<[email protected]>
C: DATA
   (headers, blank line, body)
S: 250 OK: queued

The encryption step, STARTTLS, is optional (RFC 3207). The receiving server offers it, and the sender uses it if it can. That made it easy to roll out, but it also means an attacker on the network path can strip the offer out. The two servers then continue without encryption, and neither reports a problem. The RFC itself describes this weakness.

MTA-STS addresses it (RFC 8461). The receiving domain publishes a policy over HTTPS stating that its listed mail servers always support TLS with a valid certificate. A sending server that has fetched the policy will refuse to deliver over an unencrypted connection.

What does the receiving server check?

Before accepting a message, the receiving server runs three authentication checks, each on a different part of the message:

  • SPF checks whether the connecting server’s IP address is one the MAIL FROM domain has authorised (RFC 7208).
  • DKIM verifies any signatures in the headers against public keys published in DNS (RFC 6376).
  • DMARC checks whether SPF or DKIM passed for the same domain as the visible From address, and reads that domain’s policy for what to do if not (RFC 9989).

The receiver then applies its own judgement: the sender’s reputation, the content, and how the recipient has treated similar mail before. Passing authentication does not guarantee the inbox. Failing it makes the inbox much less likely, and Gmail, Yahoo and Outlook.com now require it of bulk senders.

How can you see the route an email took?

Each server that accepts the message adds a Received header at the top, recording which server handed it over, from which IP address, and when (RFC 5321, section 4.4). Reading these headers from the bottom up gives you the message’s route.

Received headers, newest first
Received: from mail.example.com (mail.example.com [198.51.100.25])
        by mx1.mail.example.net with ESMTPS id 4Xyz;
        Mon, 5 Oct 2026 09:14:03 +0000
Received: from [10.0.0.12] (laptop.example.com [10.0.0.12])
        by mail.example.com with ESMTPSA id 9Abc;
        Mon, 5 Oct 2026 09:14:02 +0000

Only the top header was written by a server you trust, your own provider’s. Every line below it was written by servers you do not control, and a sender can forge them. A careful receiver therefore relies only on the header its own server added. Our message check works the same way. To see your domain’s MX servers, MTA-STS policy and authentication records together, scan your domain.

Questions people ask

What is an MX record?
An MX (mail exchanger) record is a DNS record that names the server that receives email for a domain, with a preference number. Sending servers try the lowest number first. A domain with no MX records falls back to its address record, and a domain that receives no mail can publish a null MX.
Is email encrypted in transit?
Usually, but not by guarantee. Servers use STARTTLS to encrypt the connection when both sides support it. Because STARTTLS is optional, an attacker in the network path can remove it. MTA-STS lets a receiving domain require encryption with a valid certificate.
How can I see the route an email took?
Open the message's full headers and read the Received lines from the bottom up. Each server that handled the message added one. Only the top Received header, added by your own provider, is fully trustworthy, because earlier lines were written by servers outside your control.
Does passing SPF, DKIM and DMARC guarantee inbox placement?
No. Authentication tells the receiver who sent the message. The receiver also weighs sender reputation, content and how the recipient has treated similar mail. Failing authentication, though, makes the inbox much less likely, and Gmail, Yahoo and Outlook.com require it of bulk senders.

Sources

  1. RFC 6409: Message Submission for Mail
  2. RFC 5321: Simple Mail Transfer Protocol
  3. RFC 7505: A "Null MX" No Service Resource Record
  4. RFC 3207: SMTP Service Extension for Secure SMTP over TLS (STARTTLS)
  5. RFC 8461: SMTP MTA Strict Transport Security (MTA-STS)
  6. RFC 7208: Sender Policy Framework (SPF)
  7. RFC 6376: DomainKeys Identified Mail (DKIM)
  8. RFC 9989: DMARC

See it on your own domain. The scan reads all twelve record types in one lookup, free and without an account.

Scan a domain