Suped

How do I align SPF and DKIM in Salesforce Service Cloud, and is it necessary if DKIM is already aligned?

Matthew Whittaker profile picture
Matthew Whittaker
Co-founder & CTO, Suped
Published 11 May 2025
Updated 19 Aug 2025
9 min read
When managing email deliverability, especially within complex systems like Salesforce Service Cloud, understanding the nuances of SPF and DKIM alignment is crucial. It’s a common area of confusion, particularly when one authentication method, like DKIM, appears to be working correctly. Many senders wonder if achieving SPF alignment is still a necessary hurdle if their DKIM is already aligned and passing DMARC. This question delves into the intricacies of how these email authentication protocols interact within the Salesforce ecosystem and what truly matters for successful inbox placement.
The goal is always to maximize the chances of deliverability and prevent emails from landing in the spam folder. While email authentication standards can seem daunting, a clear understanding of SPF, DKIM, and DMARC, particularly in the context of a specific sending platform, helps demystify the process. Let's explore how SPF and DKIM function, how Salesforce Service Cloud impacts their alignment, and what actions you should prioritize.
Suped DMARC monitoring
Free forever, no credit card required
Learn more
Trusted by teams securing millions of inboxes
Company logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logo

Understanding SPF and DKIM alignment

SPF and DKIM are foundational email authentication protocols, but they check different parts of an email for alignment. SPF, or Sender Policy Framework, verifies the sender's IP address against a list of authorized sending IPs published in the domain's DNS record. When we talk about SPF alignment, we're specifically looking at whether the domain in the Return-Path (or Mail From) address matches the domain in the From header of the email. This is a common point of failure for email service providers (ESPs) that use their own domains for the Return-Path.
DKIM, or DomainKeys Identified Mail, uses cryptographic signatures to verify that an email hasn't been tampered with in transit and was sent by the authorized domain owner. For DKIM alignment, the domain used to sign the email (found in the d= tag within the DKIM signature) must match the domain in the From header. This is generally easier to achieve with ESPs if they allow you to set up custom DKIM keys for your domain, as is the case with Salesforce Service Cloud.
The third and arguably most critical authentication protocol is DMARC (Domain-based Message Authentication, Reporting, and Conformance). DMARC relies on either SPF or DKIM passing and aligning with the From header domain to pass DMARC checks. This means if your DKIM is correctly set up and aligned, your emails will pass DMARC even if SPF alignment fails. The DMARC validations are the most important as they combine both SPF and DKIM validations.

Salesforce Service Cloud and SPF alignment

salesforce.com logoSalesforce Service Cloud, like many other ESPs, handles the Envelope From (or Return-Path) address in a way that often prevents direct SPF alignment. Instead of using your domain for the Return-Path, Salesforce typically uses a subdomain that belongs to them, such as 5aypzwwrn347mvql.g6fp2iu.hs-1qwqsmak.usa648.bnc.salesforce.com. This means that for SPF to align, this Salesforce-owned domain would need to match your From address domain, which is generally not possible from your end.
A common mistake I've seen is attempting to force SPF alignment by adding your primary domain to the SPF record with an 'a' mechanism, like a:mydomain.com. This approach is fundamentally incorrect for achieving SPF alignment with Salesforce Service Cloud. The include:_spf.salesforce.com part of your SPF record correctly authorizes Salesforce's IPs to send on your behalf, but it doesn't solve the alignment problem when Salesforce uses its own domain for the Return-Path.
Incorrect SPF record for alignmentDNS
v=spf1 include:_spf.salesforce.com a:mydomain.com ~all
This challenge is often tied to Salesforce's bounce management feature. To effectively track bounces and update contact records, Salesforce modifies the Return-Path address to point to its own bounce processing servers. While beneficial for data accuracy within the CRM, this mechanism inherently prevents SPF alignment with your primary domain. You cannot publish anything in your DNS that will make SPF align if Salesforce is changing the Return-Path to one of their own domains.

Is SPF alignment necessary if DKIM is already aligned?

So, is SPF alignment truly necessary if DKIM is already aligned? The short answer, particularly for DMARC compliance, is no. DMARC requires either SPF or DKIM to align with the From header domain to pass validation. If your DKIM signature is correctly applied by Salesforce Service Cloud and aligns with your From domain, your emails will satisfy DMARC requirements. Many third-party services will always fail SPF alignment, but having DKIM for them lets DMARC tests pass. SPF alignment failures with an ESP are not the end of the world.
The main reason why organizations don't pursue SPF alignment in Service Cloud (if DKIM is already aligned) is to retain Salesforce's built-in bounce management. Disabling this feature to achieve SPF alignment would mean that bounce notifications would be sent to the sender's email address directly, potentially creating an influx of mailer-daemon@recipient server messages. While this could theoretically be managed by an internal system (e.g., creating a case from each bounce email), it often complicates bounce processing and data management.
Given the recent new requirements from Google and Yahoo, the emphasis has shifted even more towards strong DKIM authentication and alignment. If your DKIM is aligned, you are in a good position for DMARC compliance and overall deliverability. It's often not worth the trade-off of losing Salesforce's bounce management just to achieve SPF alignment.

Configuring DKIM and deliverability best practices

For Salesforce Service Cloud, the primary focus for email authentication should be on ensuring DKIM is correctly set up and aligned. Salesforce Sales and Service Cloud generally make this process straightforward, allowing for self-service provisioning of DKIM keys. You will typically navigate to the Setup menu, search for DKIM Keys, and create a new key. This process generates CNAME records that you then add to your domain's DNS, pointing them back to Salesforce. Salesforce provides specific instructions on this. Once these DNS records propagate, your DKIM should authenticate and align.
For Service Cloud emails, which are primarily transactional (e.g., case replies, auto-replies), the requirement for unsubscribe links differs from marketing emails. While Google and Yahoo's new sender requirements emphasize one-click unsubscribe for bulk senders, transactional emails are typically exempt. Service Cloud is generally not designed for bulk email sending, but rather for individual interactions.
However, if auto-replies or other system-generated emails might be perceived as unsolicited by recipients, it's a good practice to include a clear mechanism for recipients to indicate if the email is not for them or if they wish to close a case they didn't open. This can be a simple text link within the email body, such as "This is not me" or "Close this case, I didn't open it." This helps maintain a positive sender reputation by reducing complaints, even if a formal one-click unsubscribe is not feasible or required.

Views from the trenches

Best practices
Ensure your DKIM keys are properly provisioned and aligned for your sending domain in Salesforce Service Cloud. This is the most crucial step for DMARC compliance.
Maintain Salesforce's bounce management. The benefits of automated bounce processing and data updates generally outweigh the need for SPF alignment in Service Cloud.
For transactional emails from Service Cloud, include clear, actionable links like 'This is not me' or 'Close this case' if automatic case creation could lead to unwanted communications.
Common pitfalls
Attempting to force SPF alignment for Salesforce's Return-Path domain by adding incorrect 'a' mechanisms to your SPF record.
Disabling Salesforce's bounce management solely for SPF alignment, which can lead to complications in bounce handling and data synchronization.
Confusing the requirements for marketing emails (which need explicit unsubscribe links) with transactional emails sent from Service Cloud.
Expert tips
DMARC will pass if either SPF or DKIM is aligned; focus on DKIM alignment for Service Cloud.
Salesforce Service Cloud handles DKIM key provisioning through a self-service model in the Setup menu.
Transactional emails from Service Cloud do not typically require a one-click unsubscribe header per Google/Yahoo guidelines, but a clear custom link for misdirected emails is beneficial.
Expert view
Expert from Email Geeks says the domain in the Envelope From address is what needs to align for SPF. For Salesforce Service Cloud, this domain is typically a Salesforce-owned subdomain, making direct SPF alignment with your primary domain impossible via DNS changes.
2024-04-29 - Email Geeks
Marketer view
Marketer from Email Geeks says that SPF alignment is not achievable by adding your primary domain to the SPF record when Salesforce is using its own domain for the Envelope From. This is a common misconception.
2024-04-29 - Email Geeks

Prioritizing authentication in Service Cloud

For Salesforce Service Cloud users, the takeaway is clear: prioritize DKIM alignment. While SPF authentication for Salesforce's IPs is important and included via include:_spf.salesforce.com, achieving SPF alignment with your From address is often impractical due to Salesforce's bounce management system. Thankfully, if your DKIM is properly configured and aligned with your From domain, your emails will pass DMARC checks, which is what truly matters for deliverability and preventing your emails from being sent to a spam or junk folder (or being placed on a blacklist/blocklist). Being listed on an email blacklist (or blocklist) can severely impact your sender reputation, so maintaining DMARC compliance is key.
Always ensure your DKIM records are correctly set up and check your email authentication regularly. For Service Cloud, leveraging its native bounce management capabilities while ensuring strong DKIM alignment provides a robust and practical approach to email deliverability. Remember, the goal is to send emails that recipients want to receive, and proper authentication is a vital component of that.

Frequently asked questions

DMARC monitoring

Start monitoring your DMARC reports today

Suped DMARC platform dashboard

What you'll get with Suped

Real-time DMARC report monitoring and analysis
Automated alerts for authentication failures
Clear recommendations to improve email deliverability
Protection against phishing and domain spoofing