Salesforce Email Authentication Setup

Salesforce CRM with marketing and transactional email capabilities. This guide covers the complete email authentication stack for Salesforce: SPF, DKIM, and DMARC. Each section gives you the exact DNS records, step-by-step instructions, common pitfalls, and how to verify your setup.

How to Set Up SPF for Salesforce

Authorize Salesforce to send marketing and transactional email on behalf of your domain.

Quick Answer — The Record You Need

Type

TXT

Host / Name

@

Value
v=spf1 include:_spf.salesforce.com ~all

Add include:_spf.salesforce.com to your existing SPF record.

Step-by-Step Setup

1

Log in to Salesforce

Sign in to your Salesforce org.

2

Check your sending configuration

Determine if you use Salesforce for standard email, Marketing Cloud, or both. Each may have different SPF requirements.

3

Add Salesforce to your SPF record

Add include:_spf.salesforce.com to your existing SPF record.

v=spf1 include:_spf.salesforce.com ~all
4

Configure custom Return-Path (optional)

For better SPF alignment, configure a custom return-path (bounce) domain in Salesforce Setup under Email Administration.

5

Verify the record

Test by sending an email from Salesforce and checking the SPF result in the email headers.

Before & After

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

SPF Gotchas

  • Salesforce Marketing Cloud may use a different SPF include than core Salesforce. Check Marketing Cloud documentation if you use it.
  • The include is _spf.salesforce.com (with underscore prefix), not salesforce.com.
  • If you use Salesforce with a custom return-path domain, add the SPF record to that subdomain as well.

SPF FAQ

What SPF record do I need for Salesforce?

Add include:_spf.salesforce.com to your SPF record.

Is the SPF include the same for Salesforce and Marketing Cloud?

Not always. Core Salesforce uses _spf.salesforce.com. Marketing Cloud may require additional includes depending on your configuration.

Does Salesforce support custom return-path for SPF alignment?

Yes. You can configure a custom return-path domain in Salesforce Setup to improve SPF alignment for DMARC.

How to Set Up DKIM for Salesforce

Generate DKIM keys in Salesforce Setup and publish the public key in your DNS to sign outgoing email.

Quick Answer — The Record You Need

Type

CNAME

Host / Name

YOUR_SELECTOR._domainkey

Value
YOUR_SELECTOR._domainkey.yourdomain.com.sf._domainkey.salesforce.com

Salesforce generates DKIM keys in Setup. The exact CNAME records depend on your configuration.

Step-by-Step Setup

1

Log in to Salesforce Setup

Go to Setup > search for "DKIM Keys" in the Quick Find box.

2

Create a new DKIM key

Click "Create New Key". Enter your domain, choose a selector name, and set the key size (2048-bit recommended).

3

Copy the DNS records

Salesforce generates CNAME records for the DKIM key and an alternate key. Copy both.

4

Add the CNAME records to DNS

Create the CNAME records in your DNS provider as shown by Salesforce.

5

Activate the key

Return to Salesforce Setup and activate the DKIM key once DNS has propagated.

DKIM Gotchas

  • Salesforce generates both a primary and alternate DKIM CNAME record. Both should be added for key rotation support.
  • You must activate the DKIM key in Salesforce Setup after adding DNS records. It does not activate automatically.
  • If using Salesforce Marketing Cloud, DKIM setup is in a different location (Authentication settings in MC).

DKIM FAQ

Where do I generate DKIM keys in Salesforce?

Go to Setup > DKIM Keys (search in Quick Find). Click "Create New Key" to generate a key pair.

Does Salesforce support DKIM key rotation?

Yes. Salesforce provides a primary and alternate CNAME. You can rotate keys by publishing the alternate and switching the active key.

What key size should I use for Salesforce DKIM?

Use 2048-bit for maximum security. 1024-bit is acceptable if your DNS provider has record length limitations.

How to Set Up DMARC for Salesforce

Publish a DMARC record to protect your domain when sending email through Salesforce.

Quick Answer — The Record You Need

Type

TXT

Host / Name

_dmarc

Value
v=DMARC1; p=none; rua=mailto:[email protected]; ruf=mailto:[email protected]; fo=1

Configure SPF with custom return-path and DKIM in Salesforce before enforcing.

Step-by-Step Setup

1

Set up SPF and DKIM in Salesforce

Ensure both SPF and DKIM are configured. Use a custom return-path domain for SPF alignment.

2

Test alignment

Send test emails from Salesforce and verify SPF and DKIM pass with alignment in the email headers.

3

Create the DMARC record

Add a TXT record at _dmarc.yourdomain.com.

v=DMARC1; p=none; rua=mailto:[email protected]; ruf=mailto:[email protected]; fo=1
4

Monitor reports

Analyze DMARC aggregate reports for several weeks to confirm alignment.

5

Enforce gradually

Move from p=none to p=quarantine to p=reject.

DMARC Gotchas

  • Salesforce email may not achieve SPF alignment without a custom return-path domain. DKIM alignment is the more reliable path for DMARC with Salesforce.
  • If you use both core Salesforce and Marketing Cloud, both need to be authenticated for DMARC to pass.
  • Automated Salesforce emails (workflow rules, process builder) use the same authentication as standard emails.

DMARC FAQ

Does Salesforce support DMARC alignment?

Yes. DKIM provides alignment when keys are configured. SPF alignment requires a custom return-path domain.

Do I need DMARC for both core Salesforce and Marketing Cloud?

DMARC is per domain, not per service. One record covers all email from your domain. But both services must be authenticated.

Will DMARC enforcement affect Salesforce automated emails?

If SPF and DKIM are properly configured, no. Automated emails use the same authentication as manual ones.

Verify Your Salesforce Setup

Once your SPF, DKIM, and DMARC records are in place, run a full domain scan to confirm everything is configured correctly. DNS changes typically propagate within minutes but can take up to 48 hours.

Setup Guides for Other Providers