Skip to content
DMARC Pulse

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 Email in Quick Find and select Deliverability. In Salesforce Classic, enter Email 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 in bnc.salesforce.com. SPF then cannot align with your From domain.

Steps

  1. 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.

  2. If you already have a record, edit it. Add the include before the final ~all or -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:

    TXT
    v=spf1 include:_spf.google.com include:_spf.salesforce.com ~all

    Caution: keep one SPF record on the name. A second v=spf1 record makes SPF return permerror for all mail from the domain.

  3. 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:

    TXT
    v=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 SPF softfail.

  4. 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.

  5. Set up DKIM. Follow DKIM for Salesforce. Salesforce prefers a DKIM key as the fix for alignment failures.

  6. 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

  1. Run the SPF checker again. You want one SPF record, _spf.salesforce.com among its includes and 10 lookups or fewer.
  2. 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.
  3. Paste the message headers into the Email Header Analyzer and read the Authentication-Results line.

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.

Check it now

Validate SPF and count DNS lookups

Frequently asked questions

What is the SPF record for Salesforce?
Add include:_spf.salesforce.com to the SPF record your domain already has. If you have none, Salesforce's shortest sample is v=spf1 mx include:_spf.salesforce.com ~all. Keep mx only if the hosts in your MX records also send mail.
Why does Salesforce mail pass SPF but fail DMARC?
With Activate bounce management or Enable compliance with standard email security mechanisms selected, Salesforce changes the envelope sender to an address ending in bnc.salesforce.com. SPF then evaluates that domain, which does not align with your From domain. Set up DKIM, or clear both settings once SPF and DKIM are configured.
Do I need the Salesforce SPF include if DKIM is set up?
DMARC needs only one of the two to pass and align, and Salesforce prefers a DKIM key for alignment. Salesforce still recommends publishing both SPF and DKIM records for your sending domain.
How many DNS lookups does _spf.salesforce.com use?
Two, as published on 2026-11-09: the include and one exists mechanism inside it. SPF allows 10 across the whole check, so count your other senders too.
Can I use spf.salesforce.com without the underscore?
Use _spf.salesforce.com. The name without the underscore exists in DNS, but Salesforce says it is not the officially recommended and supported record for use in DNS.
Does this include cover Marketing Cloud or Pardot?
Salesforce scopes it to mail sent from the Salesforce application. For Pardot and Marketing Cloud, it points to SPF and DKIM documentation for each product.

Sources consulted

RFC 7208 §4.1 Arguments
checked 2026-11-09
RFC 7208 §4.6.2 Mechanisms
checked 2026-11-09
RFC 7208 §5.4 mx
checked 2026-11-09
RFC 7208 §5.7 exists
checked 2026-11-09
RFC 8601 §2.7.2 SPF
checked 2026-11-09

Related pages

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.