How to Trace a Message From Its Email Headers
A line-by-line method for tracing a message: capturing the original, reading the Received chain from the bottom, and checking SPF, DKIM and DMARC alignment.

A supplier emails your finance assistant to say their bank details have changed. The address is right, the signature is right, the thread even quotes a real purchase order. Finance forwards it to you with the subject line "is this genuine?" and the body pasted into the message, which means the one piece of evidence that would answer the question has already been thrown away.
Headers are the only part of an email that records the delivery rather than the content. They are not hard to read. They are just written in an order that makes no sense until someone explains why, and padded with forty lines nobody needs. This is the order to work through them in.
Step 0: Get the original, not a copy of it
Everything below depends on having the message as it arrived. A pasted body, a screenshot, or an inline forward all lose the headers, because an inline forward wraps the old message inside a new one and only the new one's trace fields survive.
Use one of these:
- Ask for a forward as an attachment. In Outlook, Forward as Attachment produces a .msg or .eml the recipient can open intact. Train your reporters to use the report button instead, which keeps the original by design.
- Read it in the client. In classic Outlook for Windows, open the message in its own window, then File, Properties, and read the Internet headers box. In Outlook on the web and new Outlook, open the message, then More actions, View, View message source.
- Pull it from the platform. In Microsoft 365, the user reported message is already in your reporting mailbox or on the User reported tab of the Submissions page, with the headers untouched.
Save the file somewhere with a case reference in the name before you start annotating. If this turns into an incident, the raw .eml is evidence, and the rules for handling it are in our guide to preserving evidence before you clean up.
Step 1: Read the Received chain from the bottom
RFC 5322 defines trace fields as being prepended. Each mail server that handles the message adds its Received line at the top. So the newest hop is first and the oldest is last, which is the opposite of how you want to read it.
Start at the bottom. A typical line looks like this:
fromfollowed by the HELO or EHLO name the connecting server announced about itself, which is a free text claim- a bracketed reverse DNS name and the connecting IP address, which the receiving server looked up itself
byfollowed by the receiving hostwithand the protocol, thenidand a queue identifier- a semicolon and the timestamp with its UTC offset
Now the part that matters most. Only the Received lines added by infrastructure you control or trust are reliable. A sender can write any number of invented Received lines before the message ever leaves their machine, complete with plausible corporate hostnames, and they will appear at the bottom of your chain looking exactly like the genuine origin. So do not ask "what is the lowest line". Ask "what is the lowest line written by my own filtering service or mail platform". The IP address in that line is the host that actually connected to deliver the message. Everything beneath it is a claim.
In Microsoft 365 you get a shortcut. The X-Forefront-Antispam-Report header carries CIP:, the connecting IP address as the service saw it, along with PTR: for its reverse DNS and H: for the HELO string. When the CIP disagrees with the lowest Received line, believe the CIP.
Step 2: Look up the connecting IP
Three questions, in this order.
- Who owns it? A WHOIS or ASN lookup tells you whether this is the supplier's own range, their mail provider, a bulk sending platform, a cloud host or residential broadband. A finance email from a supplier whose previous messages all came from a well known mail provider, now arriving from a virtual server in a different country, is most of your answer.
- Does reverse DNS match the claim? Compare the PTR record against the HELO string and against the sending domain. Mismatches are common even in legitimate mail, so treat this as a weight rather than a verdict.
- What does the geography say? The
CTRY:field gives the country derived from the connecting IP. Microsoft's own documentation notes this may differ from the true originating sender, because the last hop is not always the first.
Step 3: Parse the Authentication-Results header properly
This is the single most misread line in email. The header is defined in RFC 8601 and in Microsoft 365 it looks roughly like spf=pass (sender IP is 192.0.2.10) smtp.mailfrom=example.com; dkim=pass (signature was verified) header.d=example.com; dmarc=pass action=none header.from=example.com; compauth=pass reason=100.
Read it as three separate tests with three separate subjects:
- spf checks whether the connecting IP is authorized to send for the domain in
smtp.mailfrom, the envelope sender from the SMTP transaction. That domain is often not the one the user sees. SPF is defined in RFC 7208. - dkim checks a cryptographic signature against a public key published by the domain in
header.d. A dkim=pass means someone holding that domain's private key signed the message, which is a far stronger statement than an SPF pass. RFC 6376 has the detail. - dmarc is the one that connects the tests to what the reader sees. Under RFC 7489 it requires that SPF or DKIM passes and that the passing domain aligns with the domain in
header.from.
So spf=pass smtp.mailfrom=mail.suspicious-domain.test alongside header.from=yourbank.example is not a reassurance. It is the shape of an ordinary impersonation: valid authentication for a domain the attacker owns, attached to a From header that reads like someone else. Always compare the three domains before you form a view.
Two Microsoft specific values are worth knowing. dmarc=bestguesspass means the sending domain has no DMARC record but would have passed if it had one, so it is weaker than a real pass. And compauth is Microsoft's composite verdict evaluated against the From domain, with a three digit reason code: the 1xx range means it passed, 000 and 001 mean it failed explicit or implicit authentication, and 601 flags self-to-self spoofing where the sending domain is one of your own accepted domains. That last one is the signature of someone forging your own staff.
Step 4: Check whether a forwarder got in the way
If the message passed through a mailing list, a group alias or an auto-forward, SPF will usually fail because the last hop was not authorized by the original domain. The ARC headers exist for that case. Look for ARC-Authentication-Results, ARC-Message-Signature and ARC-Seal, defined in RFC 8617: they preserve the authentication result from the earlier hop and seal the chain. Microsoft also summarizes chain validation in the ARC field of the antispam report, where the cv= tag reads none, pass or fail.
A legitimate forwarded message with a good ARC chain and a failed SPF is a very different finding from a message that failed SPF with no forwarding in sight. Checking this is what stops you quarantining your own HR distribution list.
Step 5: Compare the identity headers against each other
Four fields claim to say who sent the message, and attackers rely on readers only seeing one of them.
- From is what the mail client displays. The display name is arbitrary text, so "Accounts Payable" can sit in front of any address at all, and on a phone the address is often hidden entirely.
- Reply-To is where a reply actually goes. A From at the real supplier domain with a Reply-To at a lookalike is the classic invoice redirect.
- Return-Path carries the envelope sender that SPF was tested against.
- Sender appears when a third party sent on behalf of someone, legitimately or otherwise.
Then check the Message-ID. It is generated by the sending system and its right hand side is normally the sending host's domain. A message claiming to come from a large mail provider but carrying a Message-ID whose domain is a small hosting company is worth a second look. Note the X-Mailer or User-Agent too, when present: bulk phishing tooling leaves recognizable strings, and a human in Outlook does not.
Finally, scan the timestamps. Compare the offset in the earliest trusted Received line against the sender's supposed location, and look for an unexplained multi-hour gap between hops, which usually means the message sat in a queue on a host that was sending a great deal of mail.
Step 6: Use a parser, then verify the parse
Two free tools do the tedious part. Microsoft's Message Header Analyzer lays out the hops, delays and authentication results in a table, and Google's Admin Toolbox Messageheader does the same job with a different presentation. Paste the headers into one, then go back to the raw text and confirm the two or three fields your conclusion rests on. Parsers normalize, and normalization sometimes hides the mismatch you were looking for.
Step 7: Answer the question the headers cannot
Headers describe one copy of one message in one mailbox. They do not tell you who else got it. In Microsoft 365, take the Network Message ID from the headers and run a message trace in the Defender portal under Mail flow, Message trace. That gives you every recipient, the delivery action for each, and whether copies are still sitting in inboxes waiting to be clicked. That is the information your containment decision actually needs, and it feeds straight into triaging the reported message.
Need a second opinion on a link or message? Paste the message or link into CyberWatch AI Scan for a free check.
Write it down in a form someone else can check
Record, in this order: Message-ID and Network Message ID; the connecting IP with its reverse DNS and owning network; the HELO string; From, Reply-To and Return-Path; the spf, dkim, dmarc and compauth results with the domain each applied to; the first and last timestamps; and a one sentence verdict. Ten lines, and a colleague can reach the same conclusion without repeating your work.
Two habits make this faster every time. Keep a saved set of headers from your own legitimate senders, so you know what normal looks like for your estate before you have to judge an abnormal one. And if your tenant's SPF, DKIM and DMARC records are not themselves in order, fix that first, because you cannot interpret authentication results in an environment where failures are routine. The configuration side of that is covered in our walkthrough on securing a Microsoft 365 tenant, and the wider picture in our email security guide.
Finally, remember what you are usually looking at. A changed bank detail, a quoted real purchase order and a lookalike Reply-To is business email compromise, not spam, and it is better understood through the complete guide to phishing than through any single header. If you want a shorter version of this to hand to a colleague who is not an administrator, our article on reading email headers without being a techie covers the same ground in plainer terms.
Frequently asked questions
Which Received line shows the real sender?
The lowest one added by a server you trust. Read the chain from the bottom up and find the first hop that your own mail platform or your filtering provider wrote. The IP address in that line is the host that actually connected to deliver the message. Everything below it was supplied by the sender and can be invented wholesale.
Why does my phishing message show spf=pass?
Because SPF validates the envelope sender, not the From address the user sees. An attacker can register their own domain, publish a perfectly valid SPF record for it, and send mail that passes SPF while the visible From header reads something else. The question that matters is whether the passing domain aligns with the From domain, which is what DMARC checks.
How do I get the headers without destroying them?
Never ask the user to copy and paste the message or to forward it inline, because both discard the original headers. Ask them to forward it as an attachment, or pull the .eml or .msg file yourself from the reporting mailbox or from the mail platform. In Outlook on the web you can also use More actions, then View, then View message source.
What is compauth and should I trust it?
Composite authentication is Microsoft's own verdict, combining SPF, DKIM, DMARC and other signals, evaluated against the From domain. It appears in the Authentication-Results header with a three digit reason code. It is a genuinely useful shortcut, and like all verdicts it is a summary, so read the underlying spf, dkim and dmarc results before you quote it in a write-up.
Can headers be faked?
The trace fields are prepended by each hop, so a sender can write as many fake Received lines as they like before the message reaches you. They cannot alter the lines your own infrastructure adds afterwards. Nor can they forge a valid DKIM signature for a domain whose private key they do not hold, which is why DKIM is the strongest single thing in a header.
What does the X-Forefront-Antispam-Report header tell me?
In Microsoft 365 it records how the message was processed. CIP is the connecting IP address, PTR is its reverse DNS, H is the HELO string the sender announced, CTRY is the country derived from the connecting IP, and CAT is the threat category applied, with values such as PHSH, HPHISH or SPOOF. CAT and DIR tell you more about the verdict than SCL does.
Do I still need a message trace if I have the headers?
Yes, for a different question. Headers describe one copy of one message. A message trace in the Defender portal tells you every recipient who received it, what the delivery action was, and whether copies are still sitting in mailboxes. Use the Network Message ID from the headers as your search key.
Is the originating IP address worth reporting to anyone?
Sometimes. Look up its owning network and reverse DNS first. If it belongs to a hosting provider or a mail service, their abuse contact can act. If it is residential broadband it is usually a compromised machine or a proxy, and the useful artifacts are the sending domain, the landing page URL and the recipient addresses rather than the IP alone.
What should the final write-up contain?
The Message-ID and Network Message ID, the connecting IP with its reverse DNS and owning network, the HELO string, the From, Reply-To and Return-Path values, the spf, dkim, dmarc and compauth results with their domains, the timestamps of the first and last hops, and your conclusion in one sentence. That set lets someone else reach the same verdict without rerunning your work.
Sources
- View internet message headers in Outlook, Microsoft Support
- Anti-spam message headers, Microsoft Learn
- RFC 5322: Internet Message Format, IETF
- RFC 8601: Message Header Field for Indicating Message Authentication Status, IETF
- RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1, IETF
- RFC 6376: DomainKeys Identified Mail (DKIM) Signatures, IETF
- RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC), IETF
- RFC 8617: The Authenticated Received Chain (ARC) Protocol, IETF
- Message Header Analyzer, Microsoft
- Message trace in the Microsoft Defender portal, Microsoft Learn


