O365 SPF Record Setup: A 2026 Guide

Learn to set up an O365 SPF record for better email deliverability in 2026. Step-by-step instructions to prevent spoofing and improve inbox placement.

•

Published on

•

O365 SPF Record Setup: A 2026 Guide
Do not index
Do not index
Your Microsoft 365 emails can authenticate successfully and still land in spam. A common cause is an o365 SPF record that was correct when published, then became incomplete after a CRM, marketing platform, relay, or other sending system was added. Receivers at Gmail, Outlook, and Yahoo evaluate the current DNS policy, not the configuration your team remembers approving.
SPF is therefore an operational control, not a one-time checkbox. The correct Microsoft 365 value is simple in a pure Exchange Online environment, but mixed sending infrastructure creates lookup limits, duplicate-record errors, and authorization gaps that can damage inbox placement, sender reputation, conversions, and brand trust.
Table of Contents

Why Your O365 SPF Record Isn't Preventing Spam

The campaign looked ready. Microsoft 365 was configured, authentication had been mentioned in the migration checklist, and the domain had an SPF record. Then legitimate messages started appearing in spam folders, while some recipients never saw them at all.
The failure often begins weeks earlier. A company adds a customer relationship platform for sales emails, a marketing system for newsletters, or a transactional service for product notifications. Each service sends with the company's domain, but the DNS owner never updates the original SPF policy. Microsoft 365 remains authorized, while the newer sender is treated as unauthorized.
notion image

SPF authorizes the sending path

Sender Policy Framework publishes approved mail sources in DNS. The receiving server compares the envelope sender, known as 5321.MailFrom, with the connecting sending infrastructure. Microsoft describes this process as a way to detect spoofing and support deliverability through authorized-source validation in its SPF and email authentication guidance.
That check doesn't prove the message is wanted, and SPF doesn't replace DKIM or DMARC. It does establish whether the apparent sending path is allowed to send for the domain. If the policy is missing, incomplete, duplicated, or too complex to evaluate, a legitimate message can lose authentication at the point where filtering decisions begin.
A failed SPF result can contribute to filtering, rejection, or weaker DMARC alignment. The commercial impact is direct. Messages that miss the inbox generate fewer responses, purchases, renewals, and product actions, while repeated authentication failures weaken trust in the sending domain.

The record drifts while the business changes

The original Microsoft 365 policy may be technically valid. The problem is that the business no longer sends only through Microsoft 365. A stable record needs an inventory of every legitimate source, followed by controlled updates whenever the sending architecture changes.
Teams should track:
  • Microsoft 365 mail flow, including whether messages leave directly through Exchange Online.
  • Marketing and CRM traffic, which may use separate provider infrastructure.
  • Transactional messages, such as account notices, receipts, and alerts.
  • Legacy relays, applications, scanners, or web systems that still send with the domain.
  • Subdomain senders, because each sending domain or subdomain needs its own appropriate policy.
A domain can have a polished Microsoft 365 setup and still fail at the receiver because one overlooked service sends outside the authorized policy. That is why SPF, DKIM and DMARC explained should be treated as an authentication system rather than three unrelated DNS tasks.

Where to Create Your SPF Record in Microsoft 365

Microsoft 365 doesn't host the SPF TXT record for a custom domain. The record belongs in the DNS zone managed by the domain registrar or DNS hosting provider, not in the Microsoft 365 admin portals. Microsoft's Microsoft 365 SPF configuration guidance makes that ownership distinction explicit.

Find the authoritative DNS host

Start by identifying where the domain's authoritative DNS records are managed. That may be the registrar, a dedicated DNS provider, a hosting company, or an internal DNS service. The Microsoft 365 subscription and the DNS zone can be controlled by different teams, so access to the Microsoft admin center doesn't necessarily provide permission to edit SPF.
The practical sequence is:
  1. Identify the DNS owner. Confirm who can edit TXT records for the sending domain.
  1. Inspect existing TXT records. Search for a value beginning with v=spf1.
  1. Inventory legitimate senders. Don't overwrite an existing policy before understanding what it authorizes.
  1. Merge policies into one record. Microsoft says a domain should have only one SPF record.
  1. Set an operational TTL. Microsoft lists 3600 seconds, or one hour, as a typical DNS-record value in its guidance.
If the domain is already sending through another service, adding a second Microsoft 365 SPF record is not a safe shortcut. The existing policy must be edited so Microsoft 365 and the other approved sources appear in a single SPF value.

Why the admin portal causes confusion

Microsoft 365 can expose domain verification and mail-flow settings, but the public SPF policy is still served by DNS. Looking for a “create SPF” button inside Exchange Online sends administrators toward the wrong control plane. The result is often a false conclusion that SPF has been configured because Microsoft 365 itself appears healthy.
That distinction matters during an incident. A delivery team can spend hours reviewing Microsoft settings while the actual problem is a duplicated TXT record, a stale DNS zone, or a policy managed by another department. If the DNS record isn't correct at the authoritative host, receivers won't see the intended authorization.

The Exact SPF Record Syntax for Office 365

For a domain that sends only through Microsoft 365, the standard SPF TXT value is:
v=spf1 include:spf.protection.outlook.com -all
Microsoft documents this value for a pure Exchange Online environment in its Microsoft 365 DNS-record instructions. It belongs in a single TXT record at the domain apex.

Pure Microsoft 365 versus mixed sending

A mixed environment must extend the existing policy rather than publish another one. A generic structure looks like this:
v=spf1 include:spf.protection.outlook.com include:authorized-service.example ~all
The second include is only an example placeholder. It must represent a real sender approved for the domain. Fixed infrastructure can often be represented with direct ip4 or ip6 mechanisms, while provider infrastructure typically uses an include.
A useful construction process is:
  • List every sender. Include Microsoft 365, relays, applications, marketing systems, and transactional services.
  • Confirm each provider's published mechanism. Don't guess an include domain.
  • Merge the mechanisms. Keep one v=spf1 policy.
  • Count the full evaluation chain. An include can contain additional mechanisms.
  • Choose the qualifier deliberately. Use ~all during controlled discovery when legitimate sources may still be unknown, then consider -all after coverage is confirmed.
Microsoft documents ~all as the softer enforcement option and -all as the hard-fail option. A permanent soft fail can leave unauthorized sources weakly controlled, while an early hard fail can hurt legitimate mail if the sender inventory is incomplete.

The lookup budget causes production failures

SPF evaluation has a 10 DNS-lookup limit. Microsoft states that include, a, mx, ptr, and redirect mechanisms count toward that limit. When the evaluation exceeds the cap, receivers can return permerror, even when the sending system is legitimate.
Mechanism
Lookup count
Example
include
1, plus nested lookups
include:spf.protection.outlook.com
a
Counts as a DNS lookup
a:mail.example
mx
Counts as a DNS lookup
mx
ptr
Counts as a DNS lookup
ptr:example
redirect
Counts as a DNS lookup
redirect=_spf.example
ip4, ip6, all
No DNS lookup
ip4:192.0.2.10
The count applies across the expanded chain, not just the visible words in the TXT record. That's why adding several vendor includes can break an apparently reasonable policy.
Remove unused includes first. Then consolidate providers, move distinct sending streams to appropriate subdomains where architecture permits, or use direct IP mechanisms for infrastructure the organization controls. The right answer depends on ownership and change frequency, not on making the record merely look shorter.

Step-by-Step SPF Record Creation Process

The editing interface differs across DNS providers, but the control logic is the same. The team must locate the authoritative zone, find the existing SPF policy, merge Microsoft 365 into it, and publish one valid TXT record.
notion image

Follow the DNS workflow

  1. Open the DNS manager.In Cloudflare, open the relevant zone and choose DNS records. In GoDaddy or Namecheap, open the domain's DNS management page. In Azure DNS, open the DNS zone and its record sets. The exact labels may change, but the target is the public DNS zone, not the Microsoft 365 administration screen.
  1. Search for v=spf1.Filter the TXT records and inspect the full value. If an SPF policy already exists, edit it. Don't create a second TXT record containing another v=spf1.
  1. Add Microsoft 365 to the existing policy.For a pure Microsoft 365 sender, the value is:
    1. v=spf1 include:spf.protection.outlook.com -all
      During controlled rollout, the softer form is:
      v=spf1 include:spf.protection.outlook.com ~all
      The choice affects enforcement. A hard fail can reject unauthorized mail, while a soft fail gives the team room to find overlooked senders.
  1. Merge other authorized sources.A mixed policy should place Microsoft 365 and the other legitimate mechanisms in the same value. Remove abandoned services before saving, because legacy includes consume lookup capacity and preserve unnecessary authorization.
  1. Set the TTL to 3600 seconds.Microsoft identifies 3600 seconds, or one hour, as a useful operational baseline for DNS records and SPF troubleshooting. A consistent TTL helps teams reason about propagation and reduces operational uncertainty during changes.
  1. Save and verify.Check that only one SPF policy remains at the hostname. Then validate both the DNS response and a real message header. A record that appears in a DNS editor can still fail evaluation if its syntax or lookup chain is invalid.
A shorter TTL isn't a substitute for a sound record. Changing DNS repeatedly while the policy remains incomplete can produce inconsistent observations during propagation and complicate incident response. The goal is controlled change, not constant editing.

Common SPF Mistakes That Break Email Deliverability

Many SPF incidents begin with a reasonable intention: “Add Microsoft 365 to the existing record.” The failure occurs when the administrator adds a new TXT entry instead of merging the value, or keeps adding includes without calculating the expanded lookup chain.
notion image

Duplicate policies invalidate evaluation

Two SPF records are not additive. Microsoft states that a domain should have only one SPF record. Multiple v=spf1 records can produce permerror, which means the receiver can't reliably determine the authorized senders.
The incorrect pattern is conceptually:
  • TXT record one, Microsoft 365 SPF
  • TXT record two, marketing-service SPF
The correct pattern is one merged policy containing all approved mechanisms. If the duplicate records remain, Outlook, Gmail, Yahoo, and other receivers may handle the failure differently, but none receives a clean authorization result.

Too many includes create a silent outage

The 10-lookup limit applies to the whole SPF evaluation. Every include, a, mx, ptr, and redirect mechanism contributes to the cap, and nested includes can consume more capacity than the visible record suggests. Microsoft's operational guidance, summarized in this SPF setup reference, identifies excessive lookups and multiple SPF entries as common validation failures.
A typical drift pattern looks like this:
  1. Microsoft 365 is added and works.
  1. A marketing service adds an include.
  1. A CRM adds another include.
  1. A legacy relay remains in the record.
  1. A new transactional system pushes the expanded policy beyond the limit.
The resulting permerror can affect legitimate mail even though every individual sender is approved. Remove unused mechanisms, prefer direct IP mechanisms for fixed infrastructure, and reassess whether separate sending streams should use subdomains.

Soft fail becomes permanent indecision

~all can be appropriate while the team discovers every sender. It becomes a weakness when nobody revisits the policy. Unauthorized mail isn't strongly rejected by the SPF policy, and the organization may assume the record is enforcing more than it is.
Hardening to -all requires confidence that legitimate sources are covered. If a sender was forgotten, the hard fail can affect real business mail. That trade-off should be evaluated with authentication results and operational knowledge, not changed blindly.

Validating Your O365 SPF Record Works

DNS publication is necessary, but it isn't proof that the sending path passes SPF. Validation should move from the record itself to the message received by an external mailbox.
notion image

Check the public DNS response

Use a DNS lookup utility such as dig or nslookup to retrieve TXT records for the sending domain. The response should show one SPF policy beginning with v=spf1, containing the expected Microsoft 365 authorization, and including any other legitimate sources.
Look for three conditions:
  • One policy exists. Multiple v=spf1 values indicate a structural problem.
  • The value is complete. It must include every approved sending path.
  • The lookup chain is valid. A syntactically correct visible record can still exceed the evaluation limit after includes expand.
A dedicated spf checker can help identify syntax issues, lookup consumption, and missing authorization. A checker accelerates diagnosis, but it can't decide whether a forgotten application is legitimate. That requires an accurate sender inventory.

Read the received message headers

Send a controlled message from each relevant sending path to a mailbox outside the organization. Open the full headers and locate fields such as:
Authentication-Results: ... spf=pass ...
or:
Received-SPF: pass ...
The exact header format varies by receiver. The important question is whether the receiver evaluated the actual connecting source as authorized. Test Microsoft 365 separately from marketing, transactional, relay, and application paths, because one passing stream doesn't prove that the others are covered.

Separate authentication from inbox placement

An SPF pass doesn't guarantee inbox placement. Content, engagement, DKIM, DMARC alignment, reputation, forwarding behavior, and receiver-specific filtering still matter. Conversely, a failed or indeterminate SPF result can make those other signals work harder.
If a message fails, capture the sending path, envelope sender, receiver result, and DNS response before changing records. Repeated edits without evidence can create new duplicates, introduce syntax errors, or make propagation harder to interpret.

Frequently Asked Questions About O365 SPF Records

Does Microsoft 365 automatically update SPF when a new feature is enabled?

No. SPF authorizes sending infrastructure, so any new system that sends as the domain must be checked against the existing policy. A Microsoft 365 change doesn't automatically authorize unrelated marketing, CRM, application, or relay infrastructure.

Can a domain have more than one SPF record?

No. Microsoft states that multiple SPF records invalidate evaluation and can cause mail-flow problems. If another provider is already authorized, add the Microsoft 365 mechanism to the existing policy instead of creating a second v=spf1 record.

How long should DNS changes take?

Microsoft lists 3600 seconds, or one hour, as a typical TTL baseline in its DNS guidance. Actual visibility can vary by resolver and cached data, so validation should confirm the public response rather than relying only on the DNS editor.

What happens if a legitimate sender is missing?

That sender can receive an SPF soft fail or fail because its infrastructure isn't authorized. The result can affect filtering and DMARC outcomes, so the sending inventory should be updated before enforcement is tightened.

Does SPF replace DKIM and DMARC?

No. SPF authorizes the envelope sending path, while DKIM authenticates message content and DMARC evaluates alignment between authentication results and the visible From domain. Strong deliverability requires the three controls to work together, especially when messages are forwarded.
MailAdept provides subscription-based deliverability consulting that combines AI agents with human experts, including SPF, DKIM, DMARC, DNS, and sender-reputation work. Teams dealing with Microsoft 365 authentication drift can visit Mailadept to discuss a technical review and ongoing monitoring without treating inbox placement as a guarantee.

Fix Your Email Deliverability Before It Costs You Revenue

Get expert insights on why your emails go to spam and how to consistently reach the inbox.

Get a Free Deliverability Audit
Thami Benjelloun

CEO Mailwarm, email deliverability expert.