Introduction
One of the most common misconceptions in IT is:
"If I can spoof an email address that easily, what's the point of email security?"
The truth is that email was designed long before modern security expectations existed. SMTP (Simple Mail Transfer Protocol) was created in the early 1980s when the Internet was largely based on trust. Because of this, email addresses are surprisingly easy to fake.
Modern protections such as SPF, DKIM, and DMARC were added later to help verify the legitimacy of messages.
This article explains:
- How email spoofing works
- How to read email headers
- What SPF, DKIM, and DMARC actually do
- How to identify the real sender
- What indicators should be trusted during investigations
How Email Spoofing Works
Consider a physical letter.
Anyone can write this on the envelope:
Code:
From:
President of the United States
1600 Pennsylvania Ave
Washington, DC
The postal service does not verify whether the sender actually lives there.
SMTP originally worked in a similar manner.
A sending server can literally say:
Code:
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
And inside the email:
Code:
From: [email protected]
Subject: Urgent Request
Originally, receiving mail systems simply accepted this information without verifying ownership of the domain.
As a result:
The visible From address is not proof that the message actually came from that sender.
SPF (Sender Policy Framework)
SPF answers one question:
"Is this mail server allowed to send email for this domain?"
Example DNS record:
Code:
your-company-name.com
TXT
v=spf1 include:spf.protection.outlook.com -all
This tells the world:
"Only Microsoft's mail servers are authorized to send mail for your-company-name.com."
When a message arrives claiming to be from:
Code:
The receiving system checks:
- What server actually sent the message?
- Is that server authorized by the SPF record?
Possible results:
Code:
SPF = PASS
SPF = FAIL
SPF = SOFTFAIL
SPF = NONE
Easy way to remember SPF:
SPF validates the SERVER.
DKIM (DomainKeys Identified Mail)
DKIM works differently.
Instead of validating the sending server, DKIM validates the message itself.
The sending system cryptographically signs the email.
Headers may contain:
Code:
DKIM-Signature:
d=your-company-name.com;
s=selector1;
The receiving server retrieves the public key from DNS and verifies the signature.
This confirms:
- The message was authorized by the domain.
- The message was not altered after being sent.
Possible results:
Code:
DKIM = PASS
DKIM = FAIL
Easy way to remember DKIM:
DKIM validates the MESSAGE.
DMARC (Domain-based Message Authentication, Reporting and Conformance)
DMARC is the policy layer.
It answers the question:
"What should happen if SPF and/or DKIM fail?"
Example:
Code:
_dmarc.your-company-name.com
v=DMARC1; p=reject;
Possible policies:
- p=none = Monitor only
- p=quarantine = Send suspicious mail to Junk/Spam
- p=reject = Reject the message outright
Easy way to remember DMARC:
DMARC defines the POLICY.
The SPF / DKIM / DMARC Cheat Sheet
Code:
SPF = Is this server allowed to send mail?
DKIM = Has this message been cryptographically validated?
DMARC = What should happen if SPF/DKIM fail?
Or even simpler:
Code:
SPF = Server
DKIM = Message
DMARC = Policy
How to Read Email Headers
When investigating email, most people immediately look at:
Code:
From:
To:
Subject:
Unfortunately, these are often the least trustworthy fields.
Instead, focus on:
- Received
- Authentication-Results
- Return-Path
- Sender
- Message-ID
Received Headers
Received headers document every hop the email took.
Example:
Code:
Received: Server C
Received: Server B
Received: Server A
The actual path was:
Code:
Server A -> Server B -> Server C
NOT:
Code:
Server C -> Server B -> Server A
Important:
Read Received headers from the bottom up.
The lowest Received header is generally closest to the true origin of the message.
Authentication-Results
This is often the fastest way to understand whether Microsoft trusted the message.
Typical examples:
Code:
spf=pass
dkim=pass
dmarc=pass
Good sign.
Or:
Code:
spf=fail
dkim=none
dmarc=fail
Very suspicious.
When available, Authentication-Results should be one of the first headers reviewed.
Sender vs From vs Return-Path
This is one of the most useful concepts to understand.
Code:
From: What the sender wants you to see
Sender: Who actually sent it on behalf of the From address
Return-Path:Where non-delivery reports and bounces go
Example:
Code:
From: [email protected]
Sender: [email protected]
That mismatch should immediately raise suspicion.
In many phishing investigations, the Sender and Return-Path fields reveal far more than the visible From address.
Case Study: Your-Company-Name Phishing Email
Interesting header:
Code:
Received: from wfbtqzvd.outbound-mail.sendgrid.net
(159.183.78.141)
This tells us:
- The email travelled through SendGrid infrastructure.
- The email did not originate from Microsoft Teams.
- The email was delivered to Microsoft 365 through SendGrid.
Another important finding:
Code:
From: Your-Company-Name <[email protected]>
Sender: AP <[email protected]>
Visible sender:
Code:
Actual sending entity:
Code:
That discrepancy is a major red flag and should immediately prompt further investigation.
What Headers Should You Trust?
Generally Trust:
- Received
- Authentication-Results
- SPF Results
- DKIM Results
- DMARC Results
- Return-Path
- Sender
- Message-ID
Do Not Trust By Themselves:
- Display Name
- Visible From Address
- Subject Line
- Company Branding
- Email Signatures
- Logos
- Microsoft Teams Branding
Anyone can create an email that says:
Code:
Microsoft Teams
CEO
HR Department
IT Help Desk
Accounting
None of these prove legitimacy.
Common Investigation Process
When reviewing a suspicious email:
- Confirm the recipient.
- Review the From field.
- Review the Sender field.
- Review the Return-Path.
- Read Received headers from bottom to top.
- Review Authentication-Results.
- Check SPF results.
- Check DKIM results.
- Check DMARC results.
- Review embedded URLs.
- Review Message-ID.
If the visible sender claims to be:
Code:
but you find:
Code:
Sender: [email protected]
or
Code:
Return-Path: [email protected]
the email is likely spoofing or impersonating another sender.
Quick Reference / Memory Aid
When you inevitably forget all of this while reviewing an email for legitimacy, just remember:
Code:
SPF = Server
DKIM = Message
DMARC = Policy
And remember:
The From address is what the sender wants you to believe. The headers tell you what actually happened.
Likely with enough troubleshooting and experience, you'll eventually stops trusting the From field. And that's usually when email investigations finally start making sense.[/I]