Skip to content
  • There are no suggestions because the search field is empty.

SPF include vs DKIM from the vendor

An SPF include: for a vendor authorizes the vendor's servers for one envelope domain, and it counts for DMARC only if that envelope (Return-Path) domain is yours. A DKIM signature from the vendor with d= set to your domain aligns with your From address directly, usually survives forwarding, and is required if you publish p=reject. So when a vendor offers both, set up both, but treat aligned DKIM as the one you can't skip.

Vendors usually lead with the SPF include because it's familiar. The catch is that SPF checks the envelope sender, not the From address people see. If the vendor's envelope domain is its own, your include never comes into play. If the message is forwarded, SPF usually breaks anyway. The difference between the two senders is explained in Envelope From vs Header From.

What each one actually proves

SPF include: for the vendor Vendor DKIM signing with your domain
What it checks That the connecting IP is authorized for the MAIL FROM domain That a signature with d= your domain is valid, so the signed headers and body weren't changed
When it counts for DMARC When the MAIL FROM domain aligns with the From domain When d= aligns with the From domain
Where the record goes In the SPF record of the domain used in MAIL FROM, which may be a vendor-specific subdomain A selector record under _domainkey of the signing domain, as TXT or as a CNAME to a vendor-hosted key
Forwarding Usually breaks: the forwarder's IP isn't in your SPF Usually survives, unless the forwarder or a mailing list changes signed content
DNS cost Each include uses at least one of the 10 allowed lookups, and nested includes count No SPF lookups; one DNS record per selector
At p=reject Not enough on its own Required
Revoking access Remove the include Remove the TXT or CNAME

How an SPF include really works

The word "include" misleads people. It doesn't copy the vendor's IP addresses into your record. Your record asks the vendor's record whether the connecting IP passes, and only a pass counts as a match. The name was poorly chosen. A -all inside the vendor's record doesn't end your evaluation either. The mechanics are in SPF mechanisms: include, a, mx, ip4, ip6, redirect, and the SPF basics on our What is SPF page.

SPF can pass and still not count

Say a vendor sends From: news@example.com with a Return-Path of bounces.vendor.example. The receiver checks SPF for bounces.vendor.example, the vendor's own record says yes, and SPF passes. But DMARC "relies solely on SPF validation of the MAIL FROM identity," and vendor.example doesn't align with example.com. Your apex include did nothing.

The fix is the vendor's custom Return-Path (sometimes called a custom MAIL FROM or bounce domain). You publish a subdomain such as bounce.example.com, often with a CNAME or MX record the vendor gives you, plus an SPF record on that subdomain if the vendor asks for one. Google's instruction for third-party senders is to "Make sure the provider's envelope sender domain matches your domain". Not every vendor offers this.

How vendor DKIM works

DKIM can pass and still not count

Many services sign with their own domain by default. A hosted email service often signs the message using the service domain, and then signs it again using the customer domain after the customer configures DKIM signing. Only the signature with your domain helps your DMARC. The vendor's own signature doesn't hurt: a message passes if any authenticated DKIM identifier aligns with the From domain.

CNAME or TXT?

Vendors publish DKIM in one of two ways:

  • CNAME. You point a selector, such as vendor1._domainkey.example.com, at a key the vendor hosts. The vendor can rotate the key without asking you. You revoke access by deleting the CNAME. Microsoft 365 itself uses CNAMEs for custom-domain DKIM.
  • TXT. You publish the vendor's public key yourself. You control when it changes, and rotation needs you every time.

Managing DKIM keys with a third party has security risks that should be carefully managed, and methods involving CNAMEs or subdomains may alleviate some of those risks. Who rotates a CNAME-hosted key, and how often, depends on the vendor, so ask. Selectors and record formats are covered in DKIM selectors and DNS records.

Key strength

Ask for 2048-bit RSA keys where the vendor offers them. Signers must use RSA keys of at least 1024 bits and should use RSA keys of at least 2048 bits, and rsa-sha1 must not be used for signing. A 1024-bit key still meets the minimum. The details are in 1024-bit vs 2048-bit DKIM keys.

Alignment across subdomains

Under relaxed alignment, which is the default, d=mail.example.com or a Return-Path on bounce.example.com aligns with From: example.com. Relaxed alignment is enough for almost every domain. If you set strict alignment (adkim=s or aspf=s), a vendor that signs as mail.example.com stops aligning with example.com (Relaxed vs strict alignment). The concept itself is in Identifier alignment for SPF and DKIM.

What we recommend

This order is our recommendation:

  1. Aligned DKIM from every vendor that sends as your domain. It's what survives forwarding, and domains at p=reject must not rely solely on SPF to secure a DMARC pass and must apply valid DKIM signatures.
  2. Plus an aligned custom Return-Path with SPF, where the vendor supports it. You need at least one aligned identifier, and preferably two. Outlook.com's rules for high-volume senders also expect SPF and DKIM both to pass (Microsoft and Outlook authentication rules).
  3. SPF-only vendors are workable at p=none or quarantine, and a risk at p=reject. Plan to get DKIM from them, move them to a subdomain (Shared domains and multi-service setups), or replace them before you go to reject (When you are ready for p=reject).

Our SPF stance applies to the Return-Path subdomain too: ~all for sending domains. An SPF hard fail such as -all could cause a message to be rejected early in the SMTP transaction, before any DMARC processing takes place, even when aligned DKIM would have passed. Microsoft 365's own examples end in -all, which is platform guidance. The comparison is in Softfail vs fail (~all vs -all).

Mistakes worth avoiding

  • Adding the vendor's include to the apex while its Return-Path subdomain has no SPF record, or the other way around.
  • Proxying the vendor's DKIM CNAMEs through a CDN, so the key no longer resolves (DKIM selectors and DNS records).
  • Setting adkim=s while a vendor signs with a subdomain.
  • Keeping includes "just in case" until SPF goes over 10 lookups and every source gets permerror (The 10-lookup limit and SPF permerror).
  • Assuming the vendor rotates its DKIM keys. Ask.

The full onboarding procedure is in How to add a third-party sender without breaking DMARC. If a vendor is already failing alignment, see Third-party mail fails alignment.

Free DMARC account

Not sure which sender is failing?

Connect your domain's DMARC reports and see every service that sends as your domain, and whether each one passes SPF, DKIM and DMARC.

  • Every sending source in one dashboard
  • SPF, DKIM and alignment results per sender
  • No XML files to read

Create a free DMARC accountTalk to an expert

FAQ

The vendor only gave me an SPF include. Is that enough?

For DMARC, only if the vendor's Return-Path uses your domain. Ask for DKIM signing with your domain. At p=reject you need it.

The vendor's SPF passes. Why doesn't it count for DMARC?

SPF most likely passed for the vendor's bounce domain, not yours. Check smtp.mailfrom in the Authentication-Results header.

Should the vendor sign with my apex domain or a subdomain?

Either aligns under relaxed alignment. A subdomain can keep that vendor's reputation separate from your main domain (Shared domains and multi-service setups).

What's a DKIM CNAME?

A DNS record that points your selector at a public key the vendor hosts, so the vendor can rotate the key. You revoke it by deleting the CNAME.

Will a forwarded vendor email still pass?

Usually, if the aligned DKIM signature survives. SPF usually won't. Google calls DKIM "especially important" for forwarded messages. Forwarding is covered in Email forwarding, SRS, and ARC and the DKIM side in DKIM and mailing lists or forwarders.

Do two DKIM signatures cause a problem?

No. Any one aligned, valid signature is enough.