An email message looks instant, but it actually passes through a dozen servers and several protocols before it lands in the recipient's inbox. This article breaks down the path of a letter step by step: from pressing "Send" to appearing in a mail client, and explains the role of the mail domain, MX records, and authentication checks. Understanding this chain helps find the cause faster when a letter does not arrive or lands in spam.
The path of a letter from sender to recipient
When you send a message, the mail client does not deliver it directly to the addressee. The message passes through a chain of servers, each responsible for its own part of the route, and at every step there is a point where delivery can be delayed or interrupted.
- The mail client hands the letter to the sender's outgoing server (MTA).
- The outgoing server queries DNS for the recipient's mail domain MX record.
- The letter is transferred over SMTP to the recipient server named in the MX record.
- The recipient server checks authenticity and places the letter into the addressee's mailbox.
Mail domain and MX records
The mail domain is the part of the address after the "@" sign: for info@example.com the mail domain is example.com. Every mail domain has one or more MX records in its DNS zone — they indicate which server accepts mail for that domain, and in which order servers are tried if the primary one is unavailable. Without an MX record a domain can still serve web traffic, but mail will not reach it. The detailed setup order is described in the article how to configure MX records for mail.
The SMTP protocol: transfer between servers
Transfer of a letter between servers happens over SMTP (Simple Mail Transfer Protocol). The sending server opens a connection to the receiving server and exchanges plain-text commands with it: who the sender is, who the recipient is, and finally the content of the letter itself.
HELO mail.example.com
MAIL FROM: sender@example.com
RCPT TO: recipient@example.org
DATA
Subject: Letter subject
Letter body.
.
QUIT
For receiving mail a server listens on port 25, while for sending with authentication clients more often use port 587 with STARTTLS encryption. Setting up your own server on Postfix is described in the article configuring Postfix for SMTP.
Authentication checks: SPF, DKIM, DMARC and PTR
Before placing a letter in the mailbox, the receiving server checks whether the sender is forged, and this check matters more today than a filter on keywords in the subject line. An SPF record in DNS lists the servers allowed to send mail on behalf of a domain. DKIM adds a digital signature to the letter that can be verified with a public key from DNS. DMARC explains what to do with a letter if SPF or DKIM checks fail. Separately, the reverse DNS record (PTR) of the sending server IP address is checked — it should match the server name, otherwise many mail services treat the letter as suspicious. The reverse zone setup order is in the article configuring a reverse PTR record.
Comparing the stages of letter delivery
| Stage | What happens | Technology |
|---|---|---|
| Submission | The client hands the letter to the outgoing server | SMTP, port 587 |
| Route lookup | The server queries the recipient domain MX record | DNS, MX record |
| Transfer between servers | The letter moves to the recipient server | SMTP, port 25 |
| Authentication check | SPF, DKIM, DMARC and PTR are checked | DNS records |
What to do if letters are not arriving
- Check that the domain MX record points to a working mail server.
- Make sure DNS has a correct SPF record covering your sending server.
- Check whether outgoing letters are signed with a DKIM key.
- Check whether the reverse PTR record of the server IP address matches its name.
- Check the queue on the outgoing server — a letter can get stuck because of a temporary error on the recipient side.
Frequently asked questions
Why does a letter arrive with a delay of several minutes?
Between servers a letter can be temporarily held in a queue if the receiving server is unavailable or responds slowly: the sender retries on a schedule, and a delay of several minutes is normal behavior, not an error.
Can mail be received without running your own mail server?
Yes, a domain MX record can point to an external mail service, so the whole letter processing is handled by a third-party platform while the domain stays yours.
What is the difference between SPF and DKIM?
SPF checks which IP address a letter came from by matching it against a list of allowed servers, while DKIM checks that the letter content has not changed in transit, using a digital signature.