Skip to main content
Enter TitanOS

Sender setup

Microsoft 365 and third-party senders: shared SPF, DKIM CNAMEs and subdomains

Microsoft 365 handles your staff mailboxes, but it is rarely the only thing that sends as your domain. A CRM, a bulk mailing service or a web form may all put your address in the From line. Microsoft's documentation for custom domains gives a clear division of labour: your own mailboxes go in the main domain's SPF record and DKIM CNAMEs, and services you do not control are best kept on a subdomain.

By Kyle Deligny, Titanos, Brisbane. Last reviewed 1 December 2026. General information, not legal advice.

This page walks through that split using Microsoft Learn's SPF, DKIM and DMARC articles, so you know which records are yours to publish, what the selectors mean, and how to read a message header when DMARC fails.

The SPF record Microsoft expects

For a domain that sends only through Microsoft 365, Microsoft Learn gives v=spf1 include:spf.protection.outlook.com -all. Government cloud tenants use different includes, so use the one your tenant's documentation names. Microsoft also states that there are no admin portal controls for SPF; you publish the TXT record at your registrar or DNS host.

Microsoft recommends -all, a hard fail, because you are also meant to run DKIM and DMARC. It adds a detail worth knowing: DMARC treats both -all and ~all as SPF failures, but a ~all failure is effectively ignored by DMARC policy when the message carries no DKIM signature. Two other rules from the same page are that only one SPF record is allowed per domain or subdomain, and that each subdomain needs its own record because the parent's does not cover it.

Why outside services belong on a subdomain

Microsoft's worked example sends from marketing.contoso.com for a bulk mailing service the business does not control, with that subdomain's own SPF record listing the service's include next to Microsoft's. The reasons it gives are reputation and arithmetic. Problems with bulk mail then do not drag down the main domain's name, and the subdomain gets its own ten lookup budget instead of sharing the parent's.

Unlike SPF and DKIM, a DMARC record at the parent domain automatically covers subdomains that have no record of their own. That means the subdomain still needs working SPF and DKIM for DMARC to pass, but you do not have to publish another DMARC record unless you want a different policy there.

Microsoft's examples of when an address aligns under relaxed DMARC
From addressSigning or MAIL FROM domainRelaxed
user@contoso.combounces.contoso.comAligns
user@marketing.contoso.comcontoso.comAligns
user@contoso.comcontoso.onmicrosoft.comDoes not align
user@contoso.comadatum.netDoes not align

DKIM for a custom domain: selector1 and selector2

Signing with your own domain in Microsoft 365 takes two CNAME records, at the hostnames selector1._domainkey and selector2._domainkey. Only one is active at a time; the other waits for the next key rotation. The values depend on your tenant. Domains added from May 2025 use a newer format ending in dkim.mail.microsoft, while older domains keep targets under onmicrosoft.com, and Microsoft's page shows how to read the exact values with the Get-DkimSigningConfig command, so copy them rather than building them by hand.

A new signing configuration created in PowerShell defaults to a 1024 bit key, with 2048 selectable. Microsoft says a rotation takes four days before the new key signs, and that the s= value in the DKIM-Signature header shows which selector signed a message. A signature that names an onmicrosoft.com domain will not align with a From address on your own domain.

Reading a failed DMARC result

Microsoft's troubleshooting section turns on one idea: SPF and DKIM can both pass and DMARC can still fail, because DMARC needs the passing domain to match your From domain. In its example, spf=pass for a bounce domain at the vendor and dkim=pass with the vendor's domain give dmarc=fail for a From address at contoso.com.

The fixes Microsoft lists, in order, are to change the service's MAIL FROM to your domain, to have the service sign with your domain, or to send from a subdomain with the service signing as that subdomain. Forwarded mail is the other common cause, and Microsoft's answer there is trusted ARC sealers on the receiving side, which you cannot set for someone else's mailbox.

Bring an outside sender into a Microsoft 365 domain

  1. List every service that sends from your domain, from the vendor documentation and a DMARC report.
  2. Decide which ones you control closely and which should send from a subdomain such as updates.yourdomain.com.au.
  3. Check that the main domain has exactly one SPF record with the Microsoft include.
  4. Publish selector1 and selector2 CNAMEs for each domain that sends from Microsoft 365, using the values from Get-DkimSigningConfig.
  5. Turn on DKIM signing in the Defender portal once the CNAMEs resolve.
  6. For each outside service, publish the SPF include and DKIM records its own help page lists on the subdomain.
  7. Send a message from each service to a mailbox you control and open the headers.
  8. Confirm header.d in the DKIM result matches the From domain, not the vendor.
  9. Start DMARC at p=none with a reporting address, parent domain saved until last.
  10. Step the policy up only after reports show no legitimate sender failing.

Questions people ask

Can I add a vendor's SPF include to my Microsoft 365 record?

Yes, as another include inside the one record, as Microsoft's example for marketing.contoso.com shows. Each include costs a lookup, so check the total before you publish.

Why does my vendor's mail pass SPF but fail DMARC?

Because SPF passed for the vendor's own bounce domain, which does not match your From address. DMARC needs an aligned SPF domain or an aligned DKIM signature, so get the vendor to sign with your domain.

Should I use a subdomain for every outside service?

Microsoft recommends it for services you do not directly control, such as bulk mailers. A tool that only sends a few invoices may be fine on the main domain if it signs with your DKIM.

Do I need DKIM if SPF already passes?

Yes, for resilience. Microsoft says to configure DKIM and DMARC alongside SPF, and forwarded mail tends to break SPF while a DKIM signature can survive when the body is not modified.

Where to from here

The free privacy policy audit reads your published privacy policy against the Australian Privacy Principles and tells you what is missing. Privacy Care keeps your policy and your shopper data practices current for AU$149 a month, with a 3-month minimum. Would it be okay if we showed you what the audit finds? A no is welcome.

Get the free auditSee Privacy CareBook a call

Sources

  1. Microsoft Learn, set up SPF for Microsoft 365
  2. Microsoft Learn, set up DKIM for Microsoft 365
  3. Microsoft Learn, set up DMARC for Microsoft 365
  4. RFC 7489, DMARC (identifier alignment)
  5. Australian Signals Directorate, email hardening
Book a free call