Email headers: how they work
How email headers work: fields written by the sender’s program and fields added by servers, Received lines read from the bottom up, envelope and visible headers, SPF, DKIM, DMARC and ARC, Italian certified email headers, what can be forged.
Two different hands
Headers are written by two hands. The sender’s program fills in From, To, Subject, Date and usually the Message-ID. The servers the message passes through each add a Received line at the top. That is why Received lines are read from the bottom up: the lowest is the oldest, the top one was written by the server that delivered the message.
| Field | Who writes it | Reliability |
|---|---|---|
| From, To, Subject | Sender’s program | Forgeable |
| Date | Sender’s program, using the device’s clock | Indicative |
| Message-ID | Sending program or server | Useful for comparisons, but forgeable |
| Top Received lines | Recipient’s server | Reliable |
| Lower Received lines | Earlier servers, including the sender’s | To be verified: they can be invented |
| Return-Path | Recipient’s server, from the address used in delivery | Shows the technical address for error messages |
| Authentication-Results | Recipient’s server | Records the outcome of checks on arrival |
| DKIM-Signature | Sending domain’s server | Verifiable with the domain’s public key |
Envelope and letter
Like a letter, an email has an envelope, the addresses servers use during delivery, and a sheet, the visible headers. They do not always match: the envelope sender ends up in Return-Path, the visible one in From. SPF checks the former, not the latter; DMARC checks that the From domain is aligned with the one checked by SPF or signed by DKIM. When a message goes through forwarding or a mailing list, which may modify it, ARC preserves the results of checks made by earlier servers.
Italian certified email
An Italian certified email (PEC) message arrives inside a transport envelope signed by the provider, containing the original message and a file with the certification data. Headers such as X-Trasporto and X-Ricevuta indicate the type of envelope or receipt; for its legal value see the entry PEC.
Email headers: analysis procedure
The procedure for analysing email headers: acquiring the original message, computing the hash, extracting the headers, reconstructing the route, converting times, verifying DKIM and preserving the key, checking identifiers and addresses, comparing with other copies, writing the report.
The pages of this topic
Back to the overviewEmail headers: tools
The tools for reading and verifying email headers: mail program features, header analysers, command-line DKIM verification, DNS queries, IP address registries, caution with online services.
Email headers: mistakes to avoid
The most common mistakes in header analysis: trusting From, reading Received lines from the top, believing every line, ignoring time zones, working on printouts or forwards, verifying DKIM too late, mistaking SPF for authenticity, treating a failed DKIM as proof of forgery.
Email headers: value in court
The value of email headers in proceedings: original file and printouts, disowning, proof of integrity through DKIM, results of checks on arrival, certified email receipts, limits in attributing a message to a person, provider data.
Email headers: a case
A guided case: in a commercial dispute an email confirming a discount is disowned; Message-ID, Received lines, results of checks on arrival and a fresh DKIM verification show the message was sent, but its text changed after receipt.
Email headers: checklist
The checklist for the forensic analysis of email headers: acquiring the original file, reconstructing the route, DKIM verification with key preservation, checks on identifiers and addresses, conclusions and attachments.
Email headers: frequently asked questions
Short answers to the most common questions about email headers and their use as evidence.