Facebook tracking pixel

MailGenius

O365 SPF Record Setup, Merge, and Verify

Use v=spf1 include:spf.protection.outlook.com -all in a single SPF TXT record for Microsoft 365, and don't publish a second SPF record for the same domain. If another sender also needs authorization, merge it into that same record instead of duplicating the entry.

You're usually here because mail is already in motion, but SPF is still failing somewhere between DNS, Microsoft 365, and a forwarding hop. The fix is rarely “add more SPF records.” The fix is to treat the o365 SPF record as one consolidated authorization policy for every legitimate sender on the domain.

A diagram explaining that SPF in Microsoft 365 verifies the SMTP Envelope-From address, not the visible address.

What an SPF Record Actually Does in Microsoft 365

SPF checks the domain in the SMTP envelope-from, not the visible From address people see in Outlook. That matters because a message can look ordinary in the inbox while SPF is evaluating a different identity underneath. Microsoft's guidance for Exchange Online uses SPF as part of the authorization layer for the sending domain. Microsoft's SPF configuration guidance

Why the visible From field can mislead you

Marketing and sales teams often assume SPF validates the branded address in the message header. It doesn't. SPF answers a narrower question, whether the server connecting to the recipient is allowed to send for the envelope domain.

Forwarded mail shows the limit fast. A message can leave Microsoft 365 with a clean authorization path, then fail later because another system changes the connecting IP. The DNS record may still be correct, but the delivery path has changed.

Practical rule: if the message is forwarded, relayed, or filtered through another system, SPF can stop reflecting the original sender's intent and start reflecting the last hop's infrastructure.

Why this matters for Microsoft 365 specifically

The o365 SPF record is an authorization policy, not a static DNS string. It tells receivers which sending infrastructure the domain trusts, and it sets up DMARC to evaluate alignment later. In a Microsoft 365 deployment, SPF also shows whether Exchange Online is one authorized sender or only part of a larger sending stack.

That is where the trade-off appears. SPF is strong for direct delivery from the approved platform, but it breaks down when mail crosses forwarders, relays, or gateways that change the connecting source. DKIM and DMARC fill the gaps SPF cannot cover on its own.

An infographic explaining the SPF record 10 DNS lookup limit and the 3600 second TTL restriction.

The Microsoft 365 Baseline SPF TXT Record

A Microsoft 365 tenant with no other mail senders has a simple SPF policy, v=spf1 include:spf.protection.outlook.com -all. Set the TTL to 3600 seconds so DNS changes do not sit in caches longer than necessary. One domain can publish only one SPF record, because separate TXT records do not combine into a larger permission set.

Break the record down before you copy it

v=spf1 marks the string as SPF. It tells receivers to evaluate the rest of the record as sender authorization, not as general TXT data. include:spf.protection.outlook.com authorizes Microsoft 365's outbound mail path, and -all tells receivers to reject everything else.

That strict ending is what makes the baseline work. If Microsoft 365 is the only system sending mail for the domain, any other connecting host is outside the policy. A narrow record is easier to reason about when you are trying to keep spoofed mail from riding on your domain name.

Duplication, not syntax, is what breaks this record

The failure mode I see most often is a duplicate SPF record. Someone adds a second v=spf1 TXT entry, assumes both records now apply, and then spends time chasing authentication failures that come from the DNS layout itself. Microsoft is clear on this point, the permissions do not merge across separate records.

Old senders create the same kind of mess. Teams leave retired marketing tools in the record “just in case,” then the SPF tree grows until lookups get harder to follow and the policy no longer matches actual mail flow. Keep the record current, and remove any sender that no longer transmits for the domain.

What a clean baseline looks like in practice

If Microsoft 365 is the only sender, the record should stay short and exact. Use the documented pattern, keep the TTL at 3600 seconds, and avoid adding legacy systems that are no longer part of the delivery path. That keeps the SPF policy aligned with the mail leaving the tenant.

Merging Microsoft 365 With a Second Sender in One Record

When a second platform sends mail for the same domain, keep one SPF record and treat it as the domain's live authorization policy. Microsoft's merge guidance shows the right pattern, a single TXT record that combines the third party's exact mechanism with Microsoft 365, for example v=spf1 include:existing-provider.example include:spf.protection.outlook.com -all. Microsoft's DNS record merge guidance

The order matters less than the discipline

Put both senders in the same record and use the exact include strings each vendor publishes. Do not guess at a marketing platform's SPF host, and do not copy a shortened version from a blog if the vendor documentation says something else. A wrong include authorizes the wrong path, even when the syntax looks clean.

That matters because SPF is tied to delivery paths, not department names. A CRM, a transactional service, a marketing platform, a relay, and a gateway each need to match the infrastructure that connects to receivers. If the platform no longer sends for the domain, it does not belong in the record.

Why a second SPF record is not a workaround

Two separate v=spf1 TXT records do not merge into one broader permission set. Receivers evaluate them as a policy problem, not as a combined allow list, and that often leads to authentication failures that are hard to diagnose from the DNS screen alone.

Real deployments are usually simpler than the cleanup work around them:

Sender Scenario Resulting SPF TXT Record Watch Out For
Microsoft 365 only v=spf1 include:spf.protection.outlook.com -all Do not publish a second SPF record
Microsoft 365 plus one CRM v=spf1 include:spf.protection.outlook.com include:crm.example.com -all Use the CRM's exact include string
Microsoft 365 plus a legacy sender v=spf1 include:legacy.example include:spf.protection.outlook.com -all Remove retired services when they stop sending
Microsoft 365 plus a gateway One record with both authorized mechanisms Check lookup count before publishing

If the record changes and deliverability still looks weak, check inbox placement before assuming SPF was the only issue. DKIM and DMARC still have to line up with the same sending path.

The habit that prevents bad merges

Keep a sender inventory. Every entry should map to a real mail flow, direct send, relay, forwarder, or gateway. If the team cannot point to a live system that needs SPF authorization, remove it from the record. That habit keeps Microsoft 365 deployments readable and keeps the policy aligned with what leaves the tenant.

The 10 Lookup Limit and the 3600 Second TTL

Visual math is the trap here. An SPF record can look short on the page and still break because nested include, a, mx, exists, and redirect mechanisms each spend lookup budget, and chained providers do the same.

Count the lookups, not just the lines

The failure mode is usually hidden in the vendors you include. One sender may expand into several more DNS checks behind the scenes, and a few layered policies can push a record past the evaluation ceiling faster than the visible syntax suggests.

Start with the full sender list, then trace each path back to its published SPF policy. If a provider bundles multiple services or depends on its own includes, count those nested checks too. A short record can still fail if the essential work happens inside third-party chains.

A short SPF record can still fail if the included providers are doing the heavy lifting behind the scenes.

What to trim first

Remove senders that no longer send mail. Drop unnecessary a and mx mechanisms when an include already authorizes the same source. If a vendor publishes a single SPF string for its service, use that instead of building a custom path through its infrastructure.

The TTL matters as much as the syntax. Microsoft's examples use 3600 seconds, so DNS changes can stay cached for about an hour, depending on resolver behavior. That affects rollout timing, test cycles, and how long a bad record keeps causing trouble.

A deployment checklist that actually helps

Before you publish, check three things. The merged record stays within the lookup budget. Every included sender is active and intentional. The TTL gives you enough room to correct a mistake without waiting most of the day.

A diagram illustrating how SPF authentication results change across different email forwarders, relays, and network gateways.

How SPF Behaves Across Forwarders, Relays, and Gateways

Microsoft identifies forwarded messages as a distinct SPF failure case because the forwarding server's IP may not appear in the original sender's SPF record, while DKIM signatures remain in the message header after forwarding and so provide a more durable authentication signal across delivery paths. Microsoft's troubleshooting guidance

Direct delivery is the cleanest case

When Exchange Online sends directly, SPF has the best chance of behaving the way administrators expect. The connecting server is the one you planned for, the domain policy is visible, and the receiver can evaluate the envelope sender against the published record. That's the easy path.

Relays and gateways change the result

A relay or secure gateway inserts another server into the delivery path. That can be useful for filtering and routing, but it also means SPF now has to trust the last connector in the chain. If that connector isn't represented correctly, SPF can fail even though the original Microsoft 365 configuration is fine.

Forwarding is where people get blindsided

User-level forwarding is the classic trap. The sender did everything right, the original message may have passed SPF at one hop, and then the final recipient sees a different IP and marks the message as unauthenticated. That's why SPF alone isn't enough in mixed infrastructure environments.

DKIM is the durable piece because the signature stays with the message. DMARC then uses alignment to decide whether the authenticated signals match the visible From domain. That combination is what survives real-world forwarding, mailing lists, and messy corporate mail flow.

Don't pad SPF just because a path exists

The wrong response is to cram every relay and every possible hop into SPF. That creates lookup pressure and usually makes the record harder to maintain without solving the underlying alignment problem. Use SPF for what it does well, then let DKIM and DMARC cover the rest.

Verify SPF Works End to End

A DNS panel can tell you the record exists. It can't tell you whether the message that leaves Microsoft 365 is still authentic after it passes through your delivery path. For that, you need to test the actual mail flow and read the headers that receivers produce.

Screenshot from https://mailgenius.com

Start with the record itself

Check that only one SPF TXT record exists and that the published string matches your intended sender mix. A live lookup tool is faster than arguing with your registrar's UI, especially when DNS propagation or stale entries are muddying the picture. If the record is malformed, the rest of the test is wasted effort.

Then send a real message

Use a seed mailbox at Gmail, Outlook, or Yahoo and inspect the Authentication-Results header. You want to see whether SPF passes, whether DKIM passes, and whether DMARC has enough aligned signals to trust the message. If SPF passes but the message still lands poorly, the problem may be alignment, not raw authorization.

After that, run a broader check with an SPF and DKIM checker so you can review the authentication layer alongside the rest of the delivery signals. That's much faster than guessing which hop broke.

Look at the whole message, not just SPF

SPF rarely fails alone in modern Microsoft 365 setups. If the envelope record is right but deliverability is still weak, check the DKIM signature, the visible From alignment, and whether the domain is passing DMARC. A decent test report should show those pieces together so you can stop fixing one layer while ignoring the others.

A MailGenius spam test is one way to see SPF, DKIM, DMARC, blacklist signals, and content checks in a single workflow. That kind of combined result is more useful than chasing isolated green checks, because receivers don't evaluate mail in isolation either.

Choosing Between Hardfail, Softfail, and Neutral

-all, ~all, and ?all are not cosmetic choices. They tell receivers how strongly to treat mail that doesn't match the published policy, and the wrong one can undermine the whole point of the record.

Use hardfail when the policy is settled

-all is the production posture for a hardened Microsoft 365 domain. It says anything not explicitly listed is unauthorized, which is exactly what you want once your sender inventory is accurate. If the domain should only send through approved systems, hardfail fits that rule.

Use softfail during rollout, not forever

~all is useful when the team is still confirming whether every legitimate sender is in the record. It signals caution without pretending the authorization picture is final. That makes sense in a transition, especially when a marketing stack is still being untangled.

Neutral is usually a template mistake

?all is the one I see people copy from generic examples when they don't understand the consequence. It tells receivers the domain is making no strong claim either way, which defeats the purpose of the policy for most Microsoft 365 senders. If you want control, this is not the qualifier to leave in place.

If the rollout is still in motion, start with caution. Once the sender list is complete, tighten the record.

A good way to confirm the transition is to pair a live lookup with DMARC aggregate reports. If the reports show only the expected streams, the domain can usually move from softfail to hardfail with much less risk.

Where SPF Stops and DKIM and DMARC Take Over

SPF is excellent at one thing, authorizing the connecting server for the envelope domain. It's not designed to prove that the visible From address survived forwarding intact, and it's not enough by itself when your domain sends through multiple systems. That's why serious Microsoft 365 deployments treat SPF, DKIM, and DMARC as a stack, not a menu.

The three signals do different jobs

SPF answers whether the sending infrastructure is permitted. DKIM signs the message so the recipient can verify that it wasn't altered in transit, and the signature survives forwarding. DMARC then checks whether those signals align with the visible From domain and decides how to handle the result.

That matters most for cold outbound and marketing mail, where receivers are already cautious. If SPF passes on the envelope but alignment fails on the visible domain, the mailbox provider still has reasons to distrust the message. A clean o365 SPF record is necessary, but it isn't sufficient.

Why the combination is stronger

Forwarders are where SPF loses durability. DKIM keeps its signature in the message header, so the cryptographic proof travels with the email even when the path changes. DMARC gives you the policy layer on top, which is what turns authentication into a meaningful deliverability stance.

For domains that need a practical validator, MailGenius includes a DMARC checker alongside other deliverability tests, so the authentication picture isn't split across different tools. That's useful when you're trying to see whether the sender stack is ready for production.

The real takeaway

Think of SPF as the permission list, not the whole security model. Once Microsoft 365, DKIM, and DMARC are all aligned, the domain is much better positioned to survive forwarding, relays, and mixed infrastructure without losing trust at the receiver.


If your Microsoft 365 record is still messy, test it before you touch it again. MailGenius can check SPF, DKIM, DMARC, blacklist signals, and content issues in one run, which makes it easier to see whether the problem is the record, the path, or the message itself. Visit MailGenius and run a deliverability test on the exact sending setup you're using now.

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today

Run a Free Email Deliverability Test - Send an Email to the Address Below, then Click “See Your Score”:

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today