Skip to main content

How email works: the path of a message

Hosting & cPanel · 13.10.2026 · 5 min read
Illustration for “How email works: the path of a message”

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

StageWhat happensTechnology
SubmissionThe client hands the letter to the outgoing serverSMTP, port 587
Route lookupThe server queries the recipient domain MX recordDNS, MX record
Transfer between serversThe letter moves to the recipient serverSMTP, port 25
Authentication checkSPF, DKIM, DMARC and PTR are checkedDNS records

What to do if letters are not arriving

  1. Check that the domain MX record points to a working mail server.
  2. Make sure DNS has a correct SPF record covering your sending server.
  3. Check whether outgoing letters are signed with a DKIM key.
  4. Check whether the reverse PTR record of the server IP address matches its name.
  5. 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.

Was this article helpful?
← Back to Knowledge Base Ask Support