Skip to main content

Reading Email Headers: Where a Message Really Came From

A practical guide for finance and SOC teams: export headers from Gmail and Outlook, read the Received chain bottom-up, interpret Return-Path, Message-ID, SPF, DKIM, DMARC and ARC results, and parse headers with Python before you pay or escalate.

· By UserSearch Team · 14 min read

Disclaimer: This article is for education and for lawful, authorised professional research. Use these methods only where you have a legitimate purpose and a lawful basis, and follow the laws and platform terms that apply to you, including data protection law such as the UK GDPR and EU GDPR. See our Terms of Service.

TL;DR

  • In email header analysis, the From line is only what the sender typed. The header fields your own mail server added, especially the lowest Received line it wrote and its Authentication-Results, are the facts you can rely on.
  • Read Received lines from the bottom up, find the hop where the message entered your organisation, and treat everything below that hop as a claim.
  • SPF, DKIM and DMARC prove which domain a message is tied to, not that the sender is honest. A lookalike domain can pass all three.
  • Export the full original message (.eml), not a pasted snippet, if you want to re-check DKIM signatures or keep evidence.
  • UserSearch helps you take the domains, addresses and IPs you pull from a header and check them across many data sources in one Case.

The Email That Looks Exactly Like Your Supplier

Email header analysis is the practice of reading the technical fields that mail servers add to a message, such as Received lines and Authentication-Results, to establish where it really came from and whether it was authenticated. The message arrives on a Tuesday morning. It comes from your regular supplier's accounts address, quotes a real invoice number and explains, politely, that their bank details have changed. The display name is right. The signature block is right. Your finance team has paid this supplier forty times.

Nothing in the visible email tells you whether it is genuine. The answer, or most of it, sits in the part of the message nobody reads: the header. Every mail server that handles a message adds a record of what it saw, and the receiving server adds its verdict on whether the message was authenticated. Read properly, those lines tell you which server really handed the message to you, which domains it was signed by, and whether the address in the From line matches any of them.

This guide is written for finance teams checking supplier emails and for security operations (SOC) analysts triaging reported messages. It covers how to export headers from Gmail and Outlook, how to read the Received chain bottom-up, what Return-Path, Message-ID and Authentication-Results really mean, where ARC and X-Originating-IP fit, which free tools help, and how to parse headers with Python.

What Does an Email Header Actually Record?

An email is two things: an envelope used by servers to deliver it, and a message with header fields and a body. The header format is defined in RFC 5322, the Internet Message Format. Some fields are written by the sender's software (From, To, Subject, Date, Message-ID, Reply-To). Others are added in transit by each server that relays the message (Received) or by the receiving system (Return-Path, Authentication-Results, spam scores).

That split is the key to everything that follows. Fields written by the sender can say anything. Fields written by servers you do not control can also say anything, because a sender can pre-load a message with invented Received lines. Only the fields added by your own mail system, or by a provider you trust, are reliable records. Header analysis is mostly the skill of telling those apart.

Why Do Finance and SOC Teams Need Email Header Analysis?

Payment diversion by email is one of the most expensive forms of online fraud. The FBI's 2025 Internet Crime Complaint Center report recorded 24,768 complaints in its BEC category (fraud carried out through business email accounts and lookalike addresses), with reported losses of just over $3.04 billion in 2025, up from about $2.77 billion in 2024. These are reported losses only; the real figure is higher.

Mail providers have raised the bar for senders. Since 2024 Gmail's email sender guidelines have required bulk senders to authenticate with SPF and DKIM and to publish a DMARC policy. In May 2026 the IETF published RFC 9989, the updated DMARC standard, which replaces RFC 7489: it drops the pct tag, adds np, t and psd tags, and swaps the Public Suffix List for a DNS "tree walk" to find the organisational domain. More authenticated mail means more authentication results in every header, and more reasons to read them correctly. The UK's NCSC email security and anti-spoofing guidance sets out how organisations should configure the same controls on their own domains.

For insurers and finance teams, header analysis is often the first step in a payment dispute; our insurance and fraud research workflows pick up where the header leaves off. For SOC teams, it is the core of triaging every user-reported message.

How Do You Read an Email Header Line by Line?

Export the full original message first

We always start from the original message, never a forwarded copy. Forwarding inline replaces the original header with yours. Get the raw header, or better, the whole message:

  • Gmail (web): open the message, click the three-dot More menu and choose Show original. You can copy the header or use Download original to save an .eml file. Google's full header help page covers the steps.
  • New Outlook and Outlook on the web: select More actions, then View > View message details. In classic Outlook for Windows, open the message in its own window and go to File > Properties; the header is in the Internet headers box. Microsoft's guide to viewing internet headers covers each version.
  • For evidence or DKIM checks, ask the recipient to forward the message as an attachment, or have your mail administrator export it. Copy-pasted headers from Outlook can lose line wrapping and are not the full message, so signatures will not re-verify.

Handle exports as personal data. They contain names, addresses and sometimes IP addresses. Store them in the case file, not in chat threads.

Read the Received chain from the bottom up

Every server that relays a message adds a new Received: line at the top. So the top line is the last hop (your own system) and the bottom line claims to be the first. Here is a shortened example for a fictional company, Example Retail, receiving mail at example.com:

Received: by 2002:a05:6a10:1234 with SMTP id abc123;
        Tue, 15 Sep 2026 09:42:18 -0700 (PDT)
Received: from mail.example.net (mail.example.net. [203.0.113.25])
        by mx.example.com with ESMTPS id x12si345
        for <[email protected]>
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 15 Sep 2026 09:42:17 -0700 (PDT)
Received: from [198.51.100.7] (unknown [198.51.100.7])
        by mail.example.net (Postfix) with ESMTPSA id 4F2A1C0001
        for <[email protected]>; Tue, 15 Sep 2026 16:42:15 +0000 (UTC)

Each line reads "from [the server that connected] by [the server that received] with [protocol]; [time]". Work upwards:

  • Bottom line: a client at 198.51.100.7 handed the message to mail.example.net. ESMTPSA means an authenticated submission: someone logged in to that server to send it. This line was written by mail.example.net, which you do not control.
  • Middle line: your inbound server mx.example.com accepted it from mail.example.net at 203.0.113.25. This is the handoff, the first line your own infrastructure wrote. The IP in brackets is the address your server actually saw connecting. It is the single most reliable fact in the header.
  • Top line: internal delivery inside your provider.

Everything below the handoff is a claim made by the sending side. Usually it is honest, but invented Received lines are easy to add, so never base a conclusion on them alone. Look for a mismatch between the hostname a server gave (mail.example.net) and the reverse DNS of the IP your server saw, and look at the timestamps: convert them to UTC and check they run in order. Gaps of seconds are normal. A lower hop timed after a higher one points to clock errors or invented lines.

Return-Path, Reply-To and Message-ID

Return-Path is added by the final receiving server and records the envelope sender (the SMTP MAIL FROM), where bounces go. It is often a bulk mail service's bounce domain for legitimate newsletters, so a mismatch with From is not suspicious on its own. It matters because SPF checks this domain, not the From domain.

Reply-To is where replies will go. In payment diversion emails it is the field to check first: a From address that matches your supplier with a Reply-To at a free mailbox or a lookalike domain is a classic pattern.

Message-ID is a unique ID created by the sending system, in the form <unique-part@domain>. The right-hand side often reveals the platform that generated it. Compare it with earlier genuine emails from the same supplier. If their real messages always carry Microsoft 365 style IDs and this one carries an ID from a small Postfix server, you have a lead worth following.

Authentication-Results: SPF, DKIM and DMARC

The receiving server records its checks in an Authentication-Results field, defined in RFC 8601. Only trust instances whose first value (the authentication service ID) is your own mail system or your provider's; ignore any that arrived already written into the message.

Authentication-Results: mx.example.com;
       spf=pass (domain of [email protected] designates 203.0.113.25 as permitted sender) [email protected];
       dkim=pass [email protected] header.s=s1 header.b=abc123;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=example.org
  • spf=pass ... smtp.mailfrom=: the connecting IP is listed in the SPF record of the envelope domain, here bounce.example.net. It says nothing about example.org in the From line.
  • dkim=pass [email protected] header.s=s1: the message carries a valid signature from example.net using the key published under selector s1. The signing domain (the d= value) is what counts.
  • dmarc=fail ... header.from=example.org: DMARC asks whether SPF or DKIM passed for a domain aligned with the From domain. Neither did. p=NONE shows the From domain's owner has asked receivers to take no action on failures, which is why the message still arrived.

Microsoft 365 adds a compauth value (composite authentication) that combines these checks with its own signals, plus an X-Forefront-Antispam-Report field whose CIP: value is the connecting IP. Microsoft's anti-spam message header reference explains every value.

ARC for forwarded and mailing-list mail

Forwarding and mailing lists often break SPF and DKIM on messages that were genuine when first sent. ARC, described in RFC 8617 (an Experimental RFC), lets each intermediary record the authentication results it saw and seal them. You will see sets of ARC-Seal, ARC-Message-Signature and ARC-Authentication-Results fields numbered i=1, i=2 and so on. A cv=pass on the latest seal means the chain is intact. ARC results are only as good as the intermediary that wrote them, so give weight to seals from providers you recognise and treat unknown sealers as claims.

X-Originating-IP and other provider fields

Some webmail services and mail servers add X-Originating-IP or similar fields recording the address of the device that submitted the message. Many large providers no longer include the client's address, and Gmail does not add it for messages sent from its web interface, so its absence tells you nothing. Where it is present, it was written by the sender's provider, not by you. Treat it as a lead for IP research and record which provider added it.

Check the published records with dig

dig +short TXT example.org
dig +short TXT _dmarc.example.org
dig +short TXT s1._domainkey.example.net

The first returns the domain's TXT records, including its SPF record (v=spf1 ...). The second returns its DMARC policy (v=DMARC1; p=...). The third fetches the DKIM public key for selector s1 at the signing domain. Records change, so note the date you checked them.

Free Header Analysers and Their Limits

Three web tools save time on a long header. Google Admin Toolbox Messageheader parses a pasted header, lays out the hops and flags delays between them. MxToolbox's Email Header Analyzer produces a readable table with SPF, DKIM and DMARC results and relay details. Microsoft's Message Header Analyzer, available as an Outlook add-in and a standalone page, reads Microsoft 365 anti-spam fields well.

Two cautions. Pasting a header into a third-party website shares personal data with that service, so check your data protection position first and redact where you can. And analysers do not know where your trust boundary is. They will happily present an invented bottom hop as fact. We use them to read faster, not to decide.

Parsing Headers with Python

For repeat work, we prefer to parse headers ourselves. Python's standard library email parser needs no installation and handles folded lines and encoded words correctly:

import sys
from email import policy
from email.parser import BytesParser
from email.utils import parsedate_to_datetime
from datetime import timezone

with open(sys.argv[1], "rb") as fh:
    msg = BytesParser(policy=policy.default).parse(fh, headersonly=True)

for field in ("From", "Reply-To", "Return-Path", "Message-ID", "Date"):
    print(f"{field:12}: {msg.get(field)}")

hops = msg.get_all("Received", [])
print(f"\n{len(hops)} Received lines, oldest first:")
for n, hop in enumerate(reversed(hops), 1):
    text = " ".join(str(hop).split())
    stamp = text.rsplit(";", 1)[-1].strip()
    try:
        when = parsedate_to_datetime(stamp).astimezone(timezone.utc).isoformat()
    except (TypeError, ValueError):
        when = "unparsed"
    print(f"{n}. {when}  {text[:110]}")

for ar in msg.get_all("Authentication-Results", []):
    print("\nAuthentication-Results:", " ".join(str(ar).split()))

Save it as hops.py and run python3 hops.py message.eml. policy.default returns modern header objects. headersonly=True skips the body. get_all("Received") returns every hop in file order, which is newest first, so the script reverses it. The timestamp after the final semicolon is converted to UTC so hops from different time zones line up.

To re-check a DKIM signature, install dkimpy:

pip install dkimpy
dkimverify < message.eml; echo $?

dkimverify reads the full message on standard input and exits with 0 if the signature verifies, 1 if it does not. It fetches the public key from DNS today, so a failure on an old message may only mean the sender has rotated keys. The package also ships arcverify for ARC chains (install with pip install "dkimpy[ARC]"). No API keys are needed for any of this.

From Header Clues to Evidence with UserSearch

A header gives you a handful of identifiers: the From and Reply-To addresses, the Return-Path and signing domains, the Message-ID domain and the handoff IP. Each one needs checking elsewhere. When was the lookalike domain registered, and what else shares its hosting? Does the Reply-To address appear on other services? What is running on the sending IP?

UserSearch puts those checks in one place. Email Intelligence looks up addresses, Domain Intelligence covers ownership, history and favicon links (our guide to domain OSINT and WHOIS infrastructure explains how to read them), IP Intelligence and the Cyber Intelligence Shodan Modules describe the sending host, and Threat Intelligence adds context from threat data sources. OneScan runs one input across the sources you choose and merges results with source attribution, showing the Credit cost before you run, and bulk search takes up to five inputs through one Module at a time. The Domain Intelligence knowledge base covers each lookup in more detail.

Work inside a Case with Forensic Mode on, so every search and bookmark is stored with the case. Results are leads to corroborate; coverage depends on each third-party source. Our beginner's guide to running UserSearch research covers Cases and OneScan step by step.

Header Analysis in Practice: Four Workflows

Scenario: the changed bank details request

Context. Example Retail's accounts team receives the message above: From [email protected] (its real supplier, Example Supplies Ltd), asking for payment to a new account.

Actions. The analyst downloads the original and runs hops.py. The handoff hop shows mail.example.net at 203.0.113.25, not the Microsoft 365 servers that delivered the supplier's last 40 emails. SPF and DKIM pass, but for example.net; DMARC fails for example.org, delivered only because the supplier's policy is p=none. Reply-To points to [email protected]. Domain Intelligence shows example.net was registered six days earlier.

Outcome. The payment is held. The team calls the supplier on the number in its contract file, not the one in the email, and confirms no change was requested. The supplier is advised to move its DMARC policy to quarantine.

Scenario: a reported message that turned out to be genuine

Context. A SOC analyst at a fictional insurer, Example Mutual, gets a user report about an email from a trade association that "failed DMARC".

Actions. The header shows DKIM failing on arrival, but an ARC set with i=1 sealed by the association's mailing list provider records dkim=pass for the association's domain before the list added its footer, and the seal validates. The handoff IP belongs to that list provider, and earlier newsletters from the association arrived by the same route.

Outcome. The message is marked genuine, the user is thanked, and the analyst adds the list provider to the notes for future reports. In our experience, knowing when not to escalate is half the job.

Lookalike domains that pass every check

A sender who registers examp1e-supplies.example can publish perfect SPF, DKIM and DMARC records for it. Every result reads pass. Authentication proves the message came from that domain, nothing more. Always compare the authenticated domain, character by character, with the domain you expect.

When the supplier's real mailbox is sending

If a supplier's own mailbox has been taken over, the message will pass every check and match earlier Message-ID patterns. Headers cannot catch this. The clues are behavioural: a new Reply-To, unusual sending times, or a request that breaks the normal process. This is why we treat call-back verification on a known number as mandatory for any change to payment details.

Handling Headers Responsibly

Email headers contain personal data: names, addresses, and sometimes IP addresses tied to individuals. Under the UK GDPR and EU GDPR, analysing them for security or fraud prevention is usually covered by legitimate interests, but you still need to record the purpose, keep only what the case needs and set a retention period. Share headers inside your organisation on a need-to-know basis, and think before pasting them into external tools.

  • Analyse messages your organisation received or sent. For anything else, get the mailbox owner's authority.
  • Treat IP addresses in headers as infrastructure leads, not as proof of who a person is or where they are.
  • Report payment diversion attempts through your bank and your national reporting route, and keep the original .eml with the case file.
  • Record every conclusion with the header line that supports it, so a colleague can check your reasoning.

Frequently Asked Questions About Email Header Analysis

What is email header analysis?

Email header analysis is the practice of reading the fields that mail servers and sending software add to a message, such as Received, Return-Path, Message-ID and Authentication-Results, to establish which server handed the message over and which domains it was authenticated for. Finance teams use it to check supplier emails, and SOC analysts use it to triage reported messages.

How do you read Received lines in an email header?

Received lines in an email header are read from the bottom up, because every relaying server adds its line at the top. Find the handoff, the first line your own mail system wrote: the IP address in brackets there is the address your server actually saw connecting and the most reliable fact in the header. Every line below the handoff is a claim by the sending side.

What is the difference between SPF, DKIM and DMARC?

SPF checks whether the connecting IP is listed for the envelope sender's domain. DKIM checks a cryptographic signature from the signing domain named in the d= value. DMARC asks whether SPF or DKIM passed for a domain aligned with the From address, and carries the domain owner's policy for failures. None of the three proves the sender is honest; a lookalike domain can pass all of them.

How do you view full email headers in Gmail and Outlook?

In Gmail on the web, open the message, choose Show original from the three-dot More menu, then copy the header or use Download original to save an .eml file. In new Outlook and Outlook on the web, choose More actions, then View and View message details; classic Outlook for Windows shows the Internet headers box under File and Properties.

What tools are used for email header analysis?

Common free tools for email header analysis are Google Admin Toolbox Messageheader, MxToolbox's Email Header Analyzer and Microsoft's Message Header Analyzer. For repeat work, Python's standard library email parser needs no installation, dkimpy re-checks DKIM signatures, and dig reads published SPF, DMARC and DKIM records. Analysers speed up reading but do not know where your trust boundary is.

Can email header analysis show that a supplier's real mailbox was taken over?

Email header analysis usually cannot show that a supplier's real mailbox was taken over, because messages sent from the genuine account pass SPF, DKIM and DMARC and match earlier Message-ID patterns. The clues are behavioural: a new Reply-To, unusual sending times or a request that breaks the normal process. Call-back verification on a number already held should be mandatory for any change to payment details.

Turning Header Findings into a Reviewable Case

Reading a header is a disciplined habit: export the original, find the handoff hop your own server wrote, read Authentication-Results from your own system only, compare the authenticated domains with the From domain, and check Reply-To and Message-ID against known-good mail. Then take every identifier you found and test it elsewhere.

Stop guessing. Start researching with UserSearch. One UserSearch account gives you 18 Search types and access to 100+ third-party data sources, so the domains, addresses and IPs from a header can be checked in minutes. OneScan merges results with source attribution, Cases in Forensic Mode keep an audit trail your finance or security lead can review, and Teams share Cases and a common Credit pool. Our cyber security research tools are built for SOC workflows like these. Check your next suspicious email with UserSearch.

About the author

UserSearch Team
Updated on Nov 30, 2026