Investigating SenderMailFromDomain in Microsoft Defender XDR.
The email appeared to come from a trusted company.
The sender looked legitimate.
The branding matched perfectly.
Yet Agent Foskett noticed something unusual.
The domain displayed to users was not the same domain used during message delivery.
Hidden behind the email was another domain entirely.
In Microsoft Defender XDR, SenderMailFromDomain helps investigators identify the SMTP domain used during mail delivery, making it valuable for SPF analysis, spoofing investigations and phishing detection.
Lesson overview
Learn how to investigate the SMTP envelope sender domain in EmailEvents and compare it with the domain shown to users.
Why SenderMailFromDomain matters
The fields used in this lesson
Step 1 — Review SenderMailFromDomain activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
EmailEvents
| where Timestamp > ago(30d)
| where isnotempty(SenderMailFromDomain)
| project Timestamp,
SenderFromDomain,
SenderMailFromDomain,
RecipientEmailAddress,
Subject
| order by Timestamp descStep 2 — Compare visible and SMTP domains
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
EmailEvents
| where Timestamp > ago(30d)
| where isnotempty(SenderMailFromDomain)
| where SenderFromDomain != SenderMailFromDomain
| project Timestamp,
SenderFromDomain,
SenderMailFromDomain,
Subject
| order by Timestamp descStep 3 — Review top SMTP domains
- 1
- 2
- 3
- 4
- 5
- 6
EmailEvents | where Timestamp > ago(30d) | where isnotempty(SenderMailFromDomain) | summarize MessageCount = count() by SenderMailFromDomain | order by MessageCount desc
Step 4 — Investigate threats by SMTP domain
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
EmailEvents
| where Timestamp > ago(30d)
| where isnotempty(ThreatTypes)
| project Timestamp,
SenderFromDomain,
SenderMailFromDomain,
ThreatTypes,
DeliveryAction,
Subject
| order by Timestamp descStep 5 — Investigate authentication issues
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails contains "fail"
| project Timestamp,
SenderFromDomain,
SenderMailFromDomain,
AuthenticationDetails,
Subject
| order by Timestamp descStep 6 — Compare domain relationships
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
EmailEvents
| where Timestamp > ago(30d)
| summarize MessageCount = count()
by SenderFromDomain,
SenderMailFromDomain
| order by MessageCount desc