SPF
A DNS TXT record listing which servers may send mail using a domain in the SMTP envelope sender (MAIL FROM), defined in RFC 7208.
A receiving mail server takes the envelope sender (Return-Path / MAIL FROM) domain, looks up its v=spf1 TXT record and checks whether the connecting IP is authorised. The result (pass, fail, softfail, neutral) is recorded in the Received-SPF or Authentication-Results header.
SPF alone does not stop spoofing of the address users see: it checks the envelope sender, not the From: header, so an attacker can pass SPF with their own domain in the envelope. DMARC closes that gap by requiring alignment.
Practical traps: the 10 DNS lookup limit (each include: counts, exceeding it is a permerror), SPF breaking on forwarding, and ~all left forever instead of -all once senders are known.
example.com. TXT "v=spf1 include:_spf.google.com include:sendgrid.net ip4:198.51.100.10 -all"