Loading content...
When you receive an email claiming to be from your bank, your CEO, or a government agency, how do you know it's genuine? The uncomfortable truth is that, at the protocol level, you often can't.
Email spoofing is the creation of email messages with forged sender addresses, exploiting the fundamental design of the Simple Mail Transfer Protocol (SMTP) which includes no native sender authentication. Attackers can make emails appear to originate from any address they choose—your company's CEO, a trusted vendor, a financial institution, or even your own email address.
This vulnerability has made email the primary vector for phishing attacks, business email compromise (BEC), malware distribution, and social engineering campaigns that cost organizations billions of dollars annually.
By the end of this page, you will understand SMTP's architecture and why it enables spoofing, the different levels at which email addresses can be forged, how spoofed emails enable sophisticated attacks, and the comprehensive authentication framework (SPF, DKIM, DMARC) that modern email systems use to combat sender forgery.
To understand why email spoofing is possible, we must examine the Simple Mail Transfer Protocol (SMTP) and its historical design choices.
SMTP's Trust Model:
SMTP was designed in 1982 (RFC 821) for a small, trusted Internet of academic and research institutions. Like many early protocols, it assumed good faith among participants. The protocol allows any sending server to claim any sender address with no verification—the receiving server simply trusts the claimed identity.
The Two-Layer Address System:
Critically, email has two different sender addresses that can be manipulated independently:
Envelope Sender (MAIL FROM): Used in SMTP transaction; invisible to recipients (usually). This is the address used for delivery failures (bounces) and is processed by mail servers.
Header Sender (From:): Displayed to recipients in email clients. This is what users see and trust. It's just text in the email body that can be set to anything.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
# SMTP Transaction demonstrating the separation of envelope and headers# Connect to mail server on port 25 $ telnet mail.example.com 25 220 mail.example.com ESMTP readyEHLO attacker.com250-mail.example.com Hello attacker.com250-SIZE 50000000250-AUTH PLAIN LOGIN250-STARTTLS250 HELP # ENVELOPE SENDER - Used for routing and bounces# This can be spoofed but may be checked by SPFMAIL FROM:<realaddress@attacker.com>250 OK # ENVELOPE RECIPIENT - Where to deliverRCPT TO:<victim@company.com>250 OK # Begin message dataDATA354 Start mail input # EMAIL HEADERS - What recipient sees in email client# These are completely unverified by basic SMTP! From: CEO Name <ceo@company.com>To: victim@company.comSubject: Urgent Wire Transfer RequiredReply-To: attacker@gmail.comDate: Mon, 15 Jan 2024 10:00:00 -0500Message-ID: <fake-message-id@attacker.com>MIME-Version: 1.0Content-Type: text/plain; charset="UTF-8" This is an urgent request. I need you to wire $50,000 to the following account immediately. I'm in a meeting and cannot talk. Account: XXXXXXRouting: YYYYYY Please confirm when done. - CEO Name .250 OKQUIT221 Bye # Result: Victim receives email appearing to be from ceo@company.com# But it was sent by attacker with different MAIL FROMKey Observation:
In the SMTP transaction above, there are actually three different addresses involved:
realaddress@attacker.com (MAIL FROM command)ceo@company.com (From: header)attacker@gmail.com (where responses are directed)Traditional SMTP checks none of these for authenticity. The receiving server has no way to verify that:
This separation is the root cause of email spoofing vulnerabilities.
Email clients typically only show the Header From address to users. A recipient sees 'From: CEO Name ceo@company.com' with no indication that the actual sending server was unauthorized. Even examining message headers requires technical knowledge most users lack, and headers themselves can be partially forged.
Email spoofing manifests in several forms, each with different technical requirements and detection difficulty.
| Type | Mechanism | Detection Difficulty | Use Case |
|---|---|---|---|
| Display Name Spoofing | Set From: "CEO Name" attacker@gmail.com | Easy (address visible) | Low-effort phishing, relies on display name only |
| Lookalike Domain | Send from ceo@c0mpany.com (zero instead of 'o') | Medium (domain looks similar) | Sophisticated phishing, bypasses simple filters |
| Legitimate Domain Spoofing | Forge From: header to exact victim domain | Hard without SPF/DKIM/DMARC | Most dangerous—exact impersonation |
| Subdomain Spoofing | Use real.company.com.attacker.com or uncontrolled subdomain | Medium | Exploits subdomain confusion |
| Cousin Domain | Register companyy.com or company-secure.com | Medium-Hard | Typosquatting with email capability |
| Reply-To Manipulation | From: legitimate, Reply-To: attacker | Medium (hidden attack path) | Capture responses to legitimate-appearing mail |
| Free Email Impersonation | ceo.company@gmail.com | Easy | Social engineering via recognizable name |
Lookalike Domain Techniques:
When exact domain spoofing is blocked by email authentication, attackers register convincing lookalike domains:
exampel.com, examle.com (common typos)exаmple.com (Cyrillic 'а' instead of Latin 'a')examplee.com, exampe.comexample.co, example.net, example.ioexample-support.com, ex-ample.comexample-security.com, myexample.com, example-online.comThese domains can actually be registered by attackers and configured with proper SPF/DKIM, making them appear legitimate to authentication systems. Defense requires domain monitoring and user awareness.
Internationalized Domain Names (IDN) enable homoglyph attacks using characters from different scripts that appear identical: Latin 'a' vs Cyrillic 'а', Latin 'o' vs Greek omicron 'ο'. Modern email clients and browsers display IDN domains in punycode (xn--...) format to reveal these attacks, but protection varies by software and settings.
Email spoofing enables some of the most financially devastating cyber attacks. Business Email Compromise (BEC) has become a billion-dollar crime category where attackers use spoofed or compromised email to manipulate business processes.
FBI Statistics (IC3 2022 Report):
1234567891011121314151617181920212223242526272829303132333435363738
# Example BEC Email (for awareness training purposes)# Note the psychological manipulation techniques From: "John Smith - CEO" <jsmith@company-exec.com> # Note: Lookalike domain, not company.comTo: accountspayable@company.comSubject: Confidential - Urgent Wire Transfer Hi Sarah, I need you to process an urgent wire transfer today. I'm finalizing a confidential acquisition and cannot discuss this over the phone. Amount: $47,500Bank: First National BankRouting: 021000089Account: 4829501837Beneficiary: Strategic Partners LLC This is time-sensitive and must be completed before 3 PM today.Please confirm by email once done. Do not discuss this with othersas it's confidential until the deal closes. Thanks for your help on this.John ---John SmithChief Executive OfficerCompany Inc. # Red Flags in this email:# 1. Urgency and time pressure# 2. Request to not verify through normal channels# 3. Unusual payment request bypassing procedure# 4. "Confidential" framing to prevent questions# 5. Slight domain difference (company-exec.com vs company.com)# 6. Generic wording that could apply to any businessIn 2020, a Puerto Rico government agency lost $2.6 million to a BEC attack using spoofed vendor emails. In 2019, Toyota's European subsidiary lost $37 million to a BEC scam. Norfund, Norway's sovereign wealth fund, lost $10 million in 2020. These aren't small businesses—sophisticated organizations fall victim when email authentication and procedural controls are lacking.
Sender Policy Framework (SPF) is the first layer of email authentication, allowing domain owners to specify which mail servers are authorized to send email for their domain.
How SPF Works:
1234567891011121314151617181920212223242526272829303132333435363738394041
# SPF Record Structure and Examples # Basic SPF syntaxv=spf1 [mechanisms] [modifiers] # Mechanisms (in order of checking):# ip4:x.x.x.x/yy - Allow this IPv4 address/range# ip6:xxxx::/yy - Allow this IPv6 address/range# a - Allow IPs from domain's A record# mx - Allow domain's mail exchangers# include:domain - Include another domain's SPF# exists:domain - Advanced: check domain exists# all - Match all (usually at end) # Qualifiers:# + Pass (default)# - Fail (reject)# ~ SoftFail (accept but mark)# ? Neutral (no assertion) # Example 1: Small company using Office 365v=spf1 include:spf.protection.outlook.com -all # Example 2: Google Workspace with additional serversv=spf1 include:_spf.google.com ip4:203.0.113.10 -all # Example 3: Complex enterprise setupv=spf1 mx ip4:192.0.2.0/24 include:_spf.google.com include:sendgrid.net -all # Example 4: Publishing domain (no email should be sent)v=spf1 -all # Viewing SPF records$ dig +short TXT company.com | grep spf"v=spf1 include:_spf.google.com ~all" # SPF record limitations:# - 10 DNS lookup limit (include, a, mx, exists, redirect)# - Only checks envelope sender (MAIL FROM), not header From# - Forwards break SPF (forwarding server's IP fails check)# - Must be combined with DKIM/DMARC for header From protection| Result | Meaning | Recommended Action |
|---|---|---|
| Pass | Sender IP is authorized | Accept message |
| Fail (-all) | Sender IP explicitly not authorized | Reject message |
| SoftFail (~all) | IP probably not authorized, testing mode | Accept but flag/quarantine |
| Neutral (?all) | No assertion made | Accept, no conclusion |
| None | No SPF record exists | Accept, domain doesn't use SPF |
| TempError | DNS lookup failed temporarily | Accept or defer |
| PermError | SPF record syntax error | Accept, log error for domain owner |
SPF has critical limitations: it only validates the envelope sender (MAIL FROM), not the header From that users see. An attacker can pass SPF by using their own domain in MAIL FROM while spoofing the header From. SPF also breaks with email forwarding because the forwarding server's IP isn't in the original domain's SPF. DKIM and DMARC address these limitations.
DomainKeys Identified Mail (DKIM) adds cryptographic authentication to emails, allowing the sending domain to digitally sign messages and proving they haven't been modified in transit.
How DKIM Works:
123456789101112131415161718192021222324252627282930313233343536373839404142
# DKIM Signature Header (found in email headers) DKIM-Signature: v=1; a=rsa-sha256; # Signing algorithm c=relaxed/relaxed; # Canonicalization (header/body) d=company.com; # Signing domain s=selector1; # Selector (key identifier) h=from:to:subject:date:message-id; # Headers included in signature bh=abc123...; # Body hash (base64) b=xyz789...; # Signature (base64) # Breaking down the components:# v=1 : DKIM version# a= : Algorithm (rsa-sha256 recommended)# c= : Canonicalization (how to normalize before signing)# relaxed = ignore minor formatting differences# simple = exact match required# d= : Domain that signed (critical for authentication)# s= : Selector - allows multiple keys per domain# h= : List of headers included in signature# 'from' header MUST be included# bh= : Hash of message body# b= : The actual signature value # Viewing DKIM public key in DNS$ dig +short TXT selector1._domainkey.company.com"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ..." # DKIM key record fields:# v=DKIM1 : DKIM version# k=rsa : Key type (rsa is standard)# p= : Public key (base64 encoded)# t=y : Testing mode (optional)# t=s : Strict mode - 'd=' must exactly match From: domain # Verifying DKIM with OpenDKIM tools$ opendkim-testkey -d company.com -s selector1 -vvv # Multiple selectors enable key rotation:# selector1._domainkey.company.com (current key)# selector2._domainkey.company.com (new key during rotation)# google._domainkey.company.com (Google Workspace)DKIM Advantages Over SPF:
DKIM Limitations:
DKIM by itself doesn't prevent header From spoofing—an attacker could sign mail with their own DKIM key (d=attacker.com) while spoofing the From header (ceo@company.com). The signature validates, but the domains don't match. DMARC addresses this by requiring 'alignment' between the signing domain and the header From domain.
Domain-based Message Authentication, Reporting, and Conformance (DMARC) is the policy layer that ties SPF and DKIM together, specifying how receivers should handle authentication failures for the domain that users see (the header From domain).
The Critical Innovation:
DMARC introduces identifier alignment—requiring that the domain in the header From (what users see) matches either:
This closes the loophole where SPF and DKIM could pass for different domains than the visible From header.
123456789101112131415161718192021222324252627282930313233343536373839404142434445
# DMARC Record Published at _dmarc.domain.com # DMARC syntaxv=DMARC1; p=[policy]; [optional tags] # Policies:# p=none : Monitor mode - no action, just reporting# p=quarantine: Mark as spam/suspicious# p=reject : Reject failing messages outright # Example 1: Monitoring mode (start here)v=DMARC1; p=none; rua=mailto:dmarc-reports@company.com; ruf=mailto:dmarc-forensics@company.com # Example 2: Quarantine mode (intermediate step) v=DMARC1; p=quarantine; pct=50; rua=mailto:dmarc@company.com # Example 3: Full enforcement (goal)v=DMARC1; p=reject; rua=mailto:dmarc@company.com; adkim=s; aspf=s # Tag explanations:# v=DMARC1 : Version (required, must be first)# p= : Policy for domain (none/quarantine/reject)# sp= : Subdomain policy (if different from p=)# pct= : Percentage of messages to apply policy (0-100)# rua= : Aggregate report destination (XML reports)# ruf= : Forensic report destination (individual failures)# adkim= : DKIM alignment mode (r=relaxed, s=strict)# aspf= : SPF alignment mode (r=relaxed, s=strict)# fo= : Failure reporting options# rf= : Report format# ri= : Reporting interval (seconds) # Strict vs Relaxed alignment:# Relaxed (r): Subdomains align (mail.company.com aligns with company.com)# Strict (s) : Exact match required (mail.company.com does NOT align) # View DMARC record$ dig +short TXT _dmarc.company.com"v=DMARC1; p=reject; rua=mailto:dmarc@company.com; pct=100; adkim=s; aspf=s" # DMARC deployment progression:# Phase 1: p=none (monitoring) - 2-4 weeks# Phase 2: p=quarantine pct=10 - Gradual increase to 100%# Phase 3: p=reject pct=10 - Gradual increase to 100%# Goal: p=reject pct=100 - Full protection| Step | Check | Requirement for DMARC Pass |
|---|---|---|
| 1 | SPF Check | SPF passes AND domain aligns with header From |
| OR | ||
| 1 | DKIM Check | DKIM passes AND d= domain aligns with header From |
| 2 | Policy Lookup | Receiving server queries _dmarc.headerfromdomain.com |
| 3 | Policy Application | If Step 1 fails, apply policy (none/quarantine/reject) |
| 4 | Reporting | Send aggregate/forensic reports to domain owner |
DMARC Reporting:
DMARC provides unprecedented visibility into email authentication:
Aggregate Reports (rua=): XML files sent daily by receiving servers, showing authentication results for all messages claiming your domain. Reveals unauthorized senders, misconfigured services, and attack attempts.
Forensic Reports (ruf=): Detailed reports on individual authentication failures, including message headers. Privacy concerns limit adoption—many receivers don't send these.
Third-party DMARC report analyzers (dmarcian, Valimail, Agari) help parse aggregate reports into actionable insights, essential for organizations with complex email infrastructure.
Never deploy DMARC at p=reject without monitoring first. Start with p=none and analyze reports for weeks to identify all legitimate email sources (marketing platforms, CRM, etc.). Add them to SPF and configure DKIM. Gradually increase enforcement (p=quarantine with increasing pct=) before reaching p=reject. Rushing enforcement breaks legitimate email.
Defending against email spoofing requires implementing email authentication, but goes beyond just SPF/DKIM/DMARC to include user awareness, procedural controls, and technical safeguards.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
# Email Authentication Verification Checklist # Check SPF$ dig +short TXT company.com | grep spf# Expected: "v=spf1 ... -all" (not ~all) # Check DKIM (need to know selector)$ dig +short TXT selector._domainkey.company.com# Expected: "v=DKIM1; k=rsa; p=..." # Check DMARC$ dig +short TXT _dmarc.company.com# Expected: "v=DMARC1; p=reject; ..." (eventually) # Online verification tools:# - mxtoolbox.com/SuperTool.aspx# - mail-tester.com (send test email)# - dmarcian.com/dmarc-inspector/ # Send test email and verify headers:# Look for these headers in received message:# Authentication-Results: dkim=pass; spf=pass; dmarc=pass# Received-SPF: pass# DKIM-Signature: v=1; ... # DMARC Aggregate Report Analysis:# Reports arrive as XML, typically gzip compressed# Contain authentication results from receiving servers# Key data points:# - Source IPs sending as your domain# - SPF/DKIM pass/fail rates # - Disposition (delivered/quarantined/rejected) # Sample aggregate report structure:<feedback> <policy_published> <domain>company.com</domain> <p>reject</p> </policy_published> <record> <row> <source_ip>192.0.2.1</source_ip> <count>1542</count> <policy_evaluated> <disposition>none</disposition> <dkim>pass</dkim> <spf>pass</spf> </policy_evaluated> </row> </record></feedback>Even perfectly authenticated email can be malicious. An attacker's domain with valid SPF/DKIM/DMARC is still an attacker's domain. Email authentication prevents domain spoofing but not lookalike domains or social engineering. Defense must combine authentication with content analysis, user training, and procedural controls.
Email spoofing exploits SMTP's lack of authentication to enable phishing, business email compromise, and social engineering attacks that cost organizations billions annually. Modern email authentication provides strong defenses when properly implemented.
What's Next:
Having explored the major spoofing attack categories—IP, ARP, DNS, and email—the next page synthesizes this knowledge into comprehensive countermeasures. We'll examine how organizations build layered defenses against spoofing attacks at every network layer.
You now understand email spoofing comprehensively: SMTP vulnerabilities, attack categories, business email compromise patterns, and the SPF/DKIM/DMARC authentication framework. This knowledge is essential for securing organizational email infrastructure against increasingly sophisticated impersonation attacks.