The problem
Email was designed without proof of sender. The From line is just text: anyone can write ceo@example.com there. Phishing relies on exactly that. Three records published in the sender's DNS let a receiving server check a message instead of trusting it.
SPF: which servers may send
SPF (Sender Policy Framework, RFC 7208) is a TXT record on the domain that lists the servers allowed to send its mail.
example.com. TXT "v=spf1 include:_spf.mailprovider.example ip4:203.0.113.10 ~all"include:adds the servers of a mail provider.ip4:allows one address, here a company's own server.~allsays: anything else is suspicious (soft fail).-allwould say: reject it.
The check uses the envelope sender (the Return-Path), not the visible From line. SPF also allows at most 10 DNS lookups; a record with more breaks.
DKIM: a signature on the message
DKIM (DomainKeys Identified Mail, RFC 6376) signs each message. The sending server adds a DKIM-Signature header; the matching public key sits in DNS under a selector.
mail2026._domainkey.example.com. TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh...IDAQAB"The signature names its domain (d=example.com) and selector (s=mail2026). If the message was changed on the way, the signature no longer verifies. Unlike SPF, DKIM survives forwarding.
DMARC: what to do when checks fail
DMARC (RFC 7489) ties the two to the visible From domain and tells receivers what the owner wants done with failures.
_dmarc.example.com. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.com"A message passes DMARC when SPF or DKIM passes and its domain matches (aligns with) the From domain.
p=noneonly asks for reports,p=quarantineasks to treat failures as spam,p=rejectasks to refuse them.rua=is where receivers send daily summary reports.
Since February 2024, Google requires SPF, DKIM and DMARC from anyone sending more than 5,000 messages a day to Gmail addresses (Google's sender guidelines).
Exercise
Use the Mailbox Provider Checker to find who receives email for your school's or university's domain.
Look up its SPF and DMARC records with any DNS lookup tool or
nslookup -type=TXT _dmarc.yourdomainin a terminal.Answer: which policy does the domain publish? What would happen to a forged message with its name in the From line?
Key terms
Envelope sender: the address the sending servers use for bounces, checked by SPF.
Selector: the label that tells a receiver which DKIM key to fetch.
Alignment: the SPF or DKIM domain matches the From domain.
