Salesforce
Salesforce SPF record: how to add _spf.salesforce.com
The Salesforce SPF record is one entry, include:_spf.salesforce.com, in your existing SPF TXT record. How to add it and when SPF aligns for DMARC.
Before you start
The Salesforce SPF record is a single entry, include:_spf.salesforce.com, that you add to the SPF record your domain already publishes.
- Access. You need to edit the DNS zone of your users' From domain, and to open Salesforce Setup for the bounce settings.
- How the mail leaves. This entry covers mail sent from the Salesforce application. Salesforce says Send through Gmail and Send through Office 365 need no extra SPF setup, but only for mail sent from the Lightning Email Composer and certain API emails. Workflow, trigger and system emails still go through Salesforce or Email Relay, so they still need this entry or your relay authorized. Email Relay routes mail through your company's mail service, so your record has to authorize that service.
- Two Deliverability settings. From Setup, enter
Emailin Quick Find and select Deliverability. In Salesforce Classic, enterEmail Administration. Look at Activate bounce management and Enable compliance with standard email security mechanisms. Either one changes the envelope sender, the return address that SPF checks, to an address ending inbnc.salesforce.com. SPF then cannot align with your From domain.
Steps
-
Find your current record. Run the SPF checker on the domain your users send from. SPF reads the domain in the envelope sender, so a subdomain needs its own record.
-
If you already have a record, edit it. Add the include before the final
~allor-all, and leave that ending as it is. Salesforce tells you to put other mail servers' includes before its own. For a domain that also uses Google Workspace:TXTv=spf1 include:_spf.google.com include:_spf.salesforce.com ~all
Caution: keep one SPF record on the name. A second
v=spf1record makes SPF returnpermerrorfor all mail from the domain. -
If you have no record, create one. Add a TXT record on the domain you checked in step 1 (host
@for the root, the subdomain's name for a subdomain) with this value:TXTv=spf1 include:_spf.salesforce.com ~all
Caution: first list every other service that sends as this domain. With
~all, any sender you leave out gets an SPFsoftfail. -
Save and wait. Receivers can use the old record until its TTL, the cache time set on the record, runs out. Salesforce's steps end with the DNS record and list no activation in Setup.
-
Set up DKIM. Follow DKIM for Salesforce. Salesforce prefers a DKIM key as the fix for alignment failures.
-
Clear the two settings if you want SPF to align. Skip this step if you want to keep bounce processing: for that case Salesforce recommends DKIM. Once SPF and DKIM are configured, Salesforce's knowledge base says to turn off both settings on the Deliverability page. Then click Save. Caution: do this only after the include is live, because your own domain becomes the envelope sender and mail will not pass SPF if Salesforce is missing from the record. Undelivered-mail notices then go to each sender's own address.
Confirm it worked
- Run the SPF checker again. You want one SPF record,
_spf.salesforce.comamong its includes and 10 lookups or fewer. - Send a test from Salesforce to a mailbox at another provider. Use production. Salesforce says new and refreshed sandboxes default to System email only, which allows only automatically generated mail.
- Paste the message headers into the Email Header Analyzer and read the
Authentication-Resultsline.
If you cleared both settings, success is spf=pass with smtp.mailfrom on your domain. If smtp.mailfrom ends in bnc.salesforce.com, one of the two settings is still on and SPF cannot align. That is fine when dkim=pass shows header.d on your domain.
Common problems
SPF passes and DMARC still fails. DMARC needs SPF or DKIM to pass on a domain aligned with the From address. RFC 9989 counts only the MAIL FROM domain for SPF. With either setting on, that domain belongs to Salesforce. Set up DKIM or clear both settings.
Too many lookups. SPF allows 10 per check. On 2026-11-09, _spf.salesforce.com published v=spf1 exists:%{i}._spf.mta.salesforce.com -all, so the entry costs 2: the include and the exists. If your total passes 10, see too many DNS lookups.
The wrong entry. Salesforce says to use only _spf.salesforce.com, and that its other salesforce.com SPF records aren't relevant to mail sent from the application. You also don't need ip4: entries for Salesforce, because the include authorizes its sending IPs dynamically.