Why it matters
Gmail's sender guidelines, in force since 1 February 2024, require every sender to set up SPF or DKIM, and senders of more than 5,000 messages a day to Gmail to set up both, plus DMARC. Without them, your invoices and newsletters are more likely to land in spam.
A few rules from the standard, RFC 7208, cause most problems:
- One record only. The record is a DNS TXT record starting with "v=spf1". If a domain has more than one, the check returns an error.
- Ten lookups at most. Each "include:" and similar term costs a DNS lookup, and a record that needs more than 10 fails.
- It checks the envelope sender. SPF tests the hidden "MAIL FROM" and HELO identities, not the From address people see. DMARC is what links the two.
Example
A shop sends staff email through Google Workspace and its newsletter through an email marketing service. Its single SPF record starts with "v=spf1 include:_spf.google.com", adds one "include:" for the marketing service, and ends with "~all". When it starts using another sending service, it adds that service to the same record instead of creating a second one.