How do you read a message's Received header chain, and which Received entries can a receiving organisation actually trust?
answer
- every hop prepends, nothing is rewritten
- oldest hop at the bottom
- EHLO name versus the TCP address
- your own boundary's entries
- counting entries to catch loops
basics
~20 sEach SMTP hop prepends a Received field, so the chain reads bottom-up with the oldest hop last. Trust only the entries your own servers added, and in your edge server's entry, the connecting IP address it took from the TCP connection.
solid answer
~50 sRFC 5321 §4.4 requires every server that receives a message for delivery or further processing to **prepend** a `Received` field. No server may change, delete or reorder earlier ones, so the newest hop is on top and the origin is at the bottom. Each entry records `from` (the name the client gave in `EHLO`, plus an address literal the server took from the TCP connection), `by` (the server writing it), `with` (`ESMTP`, `ESMTPS` for TLS, `ESMTPSA` after authentication), `id`, an optional `for`, and a timestamp with a numeric offset. To trust the chain, find the entry your inbound edge wrote. Its connecting address is the one hard fact about where the message came from, and everything below it was written by systems outside your control. Counting the entries is also how MTAs stop loops: RFC 5321 §6.3 suggests a threshold of at least 100, and Postfix's `hopcount_limit` defaults to 50.
go deeper
Remember the direction: servers add Received fields on top, so the bottom one is the oldest hop and the top one is your own server's delivery.
Explain each clause (from, by, with, id, for, date) and say which values come from the TCP connection and which come from the client's EHLO.
Draw the trust line at your inbound edge. Use the address it recorded for reputation and abuse work, treat lower entries as claims, and read timestamp gaps to find the hop that delayed a message.
Decide what your outbound trace may reveal about internal hosts, weighed against RFC 5321's rule against deleting entries and the diagnostic value the entries give your own operators.
## Why the chain exists and how it grows The `Received` field is SMTP's **trace** record. RFC 5321 §4.4 says that when an SMTP server receives a message for delivery or further processing, it **MUST** insert a `Received` field at the beginning of the message content. Three rules make the chain readable: - Servers **prepend** their entry. They MUST NOT insert it anywhere else. - An Internet mail program **MUST NOT change or delete** an existing `Received` field, and servers MUST NOT reorder them. - At final delivery the server adds a `Return-Path` line above them, carrying the envelope `MAIL FROM`. The result is a stack. The top entry is the last hop and the bottom entry is the first, so you **read it bottom-up** to follow the message from origin to mailbox. ## Anatomy of one entry | Clause | What it records | Who supplies the value | |---|---|---| | `from` | The client's `EHLO` name, and an address literal for the client | The name comes from the client; the address from the TCP connection | | `by` | The server writing the entry | That server | | `with` | The protocol: `SMTP`, `ESMTP`, `ESMTPS` (TLS), `ESMTPA` or `ESMTPSA` (authenticated) | That server | | `id` | That server's own queue or message identifier | That server | | `for` | One recipient path, if present | That server, from `RCPT TO` | | date-time | When the server received the message, with a numeric offset such as `-0800` | That server's clock | RFC 5321's grammar marks the address literal as information derived from the TCP connection, not from the client's `EHLO`. That distinction is the whole basis of trust. The `EHLO` name is whatever the client chose to say, while the address is what the server actually saw. ## Reading a chain: a worked example A message delivered to `[email protected]` carries these entries, top to bottom: 1. `Received: from mx1.example.com (mx1.example.com [192.0.2.10]) by store.example.com with ESMTP id 9F2A; Tue, 6 Oct 2026 09:14:07 +0200` 2. `Received: from out.example.net (out.example.net [198.51.100.7]) by mx1.example.com with ESMTPS id 41BC; Tue, 6 Oct 2026 09:14:05 +0200` 3. `Received: from build-host (unknown [203.0.113.40]) by out.example.net with ESMTPSA id 77D0; Tue, 6 Oct 2026 07:13:58 +0000` Bottom-up, an application host that called itself `build-host` authenticated to `out.example.net` (`ESMTPSA`). That relay passed the message over TLS (`ESMTPS`) to `mx1.example.com`, which handed it to the internal store. The timestamps, converted through their offsets, show nine seconds from end to end. A large gap between two adjacent entries shows which hop held the message, and that is why the RFC asks for numeric offsets rather than time-zone names. ## The trust boundary Every entry is a claim made by the server that wrote it. That leads to a simple rule: - **Trust the entries your own servers added.** In the example, those are entries 1 and 2. - **In your edge's entry, trust the connecting address.** `198.51.100.7` in entry 2 is what `mx1.example.com` saw on the socket. It is the starting point for reputation checks, blocklist lookups and abuse reports. - **Treat everything below as unverified.** Entry 3 was written by `out.example.net`. It may be accurate, but a sending system can place any text it likes below its own hop, including fabricated earlier entries. - **Treat names with care.** A `from` name that does not match the address's reverse lookup is common and proves nothing on its own. Think of passport stamps: each border post adds its stamp to the next page, and the pages read in time order. You can vouch for the stamps your own border applied. Earlier pages could have been filled in by anyone before the traveller reached you. ## Loops: counting Received fields Because every hop adds an entry, a message caught in a routing loop collects them fast. RFC 5321 §6.3 says simply counting `Received` fields is an effective, though rarely optimal, way to detect loops. Servers that use it **SHOULD** set a large threshold, **normally at least 100** entries, and every server **MUST** contain some provision for detecting and stopping trivial loops. Postfix's `hopcount_limit` defaults to **50** and bounces a message that exceeds it, which is below the RFC's suggested floor. In a looping message you see the same two or three hosts repeating up the chain, and the bounce shows where the cycle closed. ## What the chain does not tell you - It is **not authentication**. Which domains passed SPF, DKIM or DMARC is recorded in `Authentication-Results`, covered with envelope and headers. - It is **not the tenant's log**. A mail service's message-trace records live outside the message and are covered with mailbox and SaaS audit trails. - It can **disclose internal names**. RFC 5321 §7.6 notes that entries can reveal internal host names, and that a `for` clause can reveal blind-copy recipients when there are several recipients.
- May an organisation strip its internal Received entries before mail leaves?RFC 5321 §4.4 says a mail program MUST NOT change or delete an existing `Received` field. §7.6 accepts that entries may disclose internal host names, and says sites with special concerns should be aware of it. Some operators remove internal entries at the outbound edge anyway. That departs from the RFC and costs them the trace they need when a delivery goes wrong.
- What does ESMTPSA in the with clause of the bottom entry tell you?RFC 4954 says a server SHOULD write `ESMTPA`, or `ESMTPSA` when TLS was also used, after a client authenticates. So that hop received the message from a client that logged in over an encrypted session. It is evidence of an authenticated submission, as reported by that server, so it is only as trustworthy as the server that wrote it.
- A message bounced with a hop-count error. What do you look for in its Received fields?Look for the same hosts repeating up the chain. A pair that alternates, for example a gateway and the internal server, means each one believes the other is the next hop for the domain. Fix the routing so that one of them treats the domain as final destination. Raising the hop limit only lets the loop run longer.
Passport stamps: each border post adds its stamp to the next page and the pages read in time order, but you can vouch only for the stamps your own border applied; earlier pages could have been filled in by anyone before the traveller reached you.
- Read Received fields top-down; the top one is where the message started.
- The EHLO name in a Received field proves who the sending host was.
- Every Received field in a message deserves the same level of trust.
- A relay may reorder Received fields to keep the header tidy.
- RFC 5321 fixes the loop limit at exactly 50 Received fields.