Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Exchange Online "550 5.7.23" bounce: the SPF record, unprovisioned domains and the high-risk delivery pool

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Microsoft's page says the bounce "550 5.7.23" in Exchange Online points to a Sender Policy Framework (SPF) configuration issue in your Microsoft 365 or Office 365 organisation. The "Diagnostic information for administrators" section of the bounce carries the original error from the external server that refused the message.

Only an email administrator of the sending organisation can fix it. Check four things in the order Microsoft gives: the public SPF record, whether every domain you own is provisioned, whether your on-premises IP addresses are in the record, and whether the message was sent through the high-risk delivery pool.

What the error means

SPF is a DNS TXT record that lists which systems may send mail for a domain. The receiving server checks the sending system against it. A 5.7.23 bounce is the refusal coming back to the sender. Microsoft's page points to an SPF configuration issue, and the bounce text carries the original error from the external server.

Microsoft's page names four things to try, in this order:

  1. "Verify the SPF DNS record for your domain", using a publicly available SPF or DNS record checker.
  2. "Provision all of the domains you own." Microsoft's reason: "We limit the number of emails with unprovisioned domains that a tenant can send."
  3. Add your on-premises IPs, if any, to the SPF record of any domains you send for. That includes unprovisioned domains you might be relaying through Microsoft 365.
  4. Verify that the outbound message wasn't identified as spam and routed through the High Risk Delivery Pool. Microsoft says messages in that pool "won't pass SPF checks, and therefore won't be accepted by the destination email organization."

Microsoft's page does not give a version range beyond Exchange Online and Microsoft 365.

Microsoft's SPF page explains the record's parts. v=spf1 identifies the record as SPF. Each valid source follows it: an ip4: or ip6: address or CIDR range for a system you control, or an include: value for a service that sends on your behalf. The enforcement rule ends the record: -all (hard fail) tells receivers that sources not listed are not authorised, ~all (soft fail) says they probably are not, and ?all (neutral) suggests no action and is for testing. Microsoft's page adds that in complex organisations where it is hard to identify every valid source, it is important to configure DKIM signing and DMARC in "take no action" mode quickly, and that a DMARC reporting service helps identify email sources and SPF failures.

Likely causes

Cause What you see How to confirm
The SPF record for the domain is missing, wrong or duplicated 5.7.23 to many external domains Read the public TXT record with an SPF or DNS checker
A domain you send as is not provisioned in the tenant Bounces for that domain only Compare the domains you send from with your accepted domains
On-premises servers send as the domain but their IPs are not in the record Bounces for mail relayed from on-premises Check the record for the on-premises address
The message went through the high-risk delivery pool SPF fails even though the record looks right Message trace, OutboundIpPoolName property
The sending domain has no A record and no MX record in public DNS Same Microsoft's pools page says such messages always use the high-risk pool
The record needs more than 10 DNS lookups SPF permerror at the receiver Count the lookups; Microsoft's SPF page explains how

Prove the cause before changing anything

All of these read only.

  1. Read the "Diagnostic information for administrators" section of the bounce and keep the text.
  2. Look up the public SPF record for the domain in the From address with a public SPF or DNS record checker. Microsoft's SPF page says there is only one SPF record allowed per domain or subdomain, so the checker should show one record that starts v=spf1.
  3. Compare the domains you send from with the domains provisioned in the tenant.
  4. Run a message trace for the bounced message. Microsoft's pools page says: "you can use Message trace and look for the OutboundIpPoolName property in the output. This property contains a friendly name value for the outbound pool that was used." A high-risk pool name there shows the message went through that pool; Microsoft names spam detection and a missing A and MX record as reasons.

Example (illustrative): at contoso.com.au all mail leaves through Exchange Online. The administrator of contoso.com.au gets a 5.7.23 bounce for a message sent through Exchange Online to an external recipient. The domain's SPF record is v=spf1 -all, which lists no mail source at all. Microsoft's page does not say which of its four checks applies to a given bounce, so the administrator works through them in order: the public record (which lacks include:spf.protection.outlook.com), the provisioned domains, whether any on-premises address is listed, and the outbound pool shown by message trace. The record is the first check to fail.

Fix

Fix the cause the checks point to.

An SPF record that is missing something. Microsoft's SPF page gives the syntax v=spf1 <valid mail sources> <enforcement rule>, says "Most Microsoft 365 organizations require include:spf.protection.outlook.com in the SPF TXT record for the domain", and shows the record for an organisation with an on-premises server and Microsoft 365:

v=spf1 ip4:192.168.0.10 include:spf.protection.outlook.com -all

Microsoft's page says there are no admin portals or PowerShell cmdlets in Microsoft 365 to manage SPF records, and that you create the TXT record at your domain registrar or DNS hosting service.

Before you change the record, copy its current text from the registrar into a file kept with the change record.

Risk: the next step edits the SPF TXT record for the whole domain. Every receiving system uses it. A second record, a missing source or more than 10 DNS lookups makes SPF fail for all mail from the domain, and Microsoft says multiple SPF records for one domain or subdomain cause a permerror. DNS changes take time to reach receivers.

Edit the one existing SPF TXT record so it lists every system that sends mail for the domain, including the public address of any on-premises server in the ip4: form shown above, and keep it as a single record. Microsoft recommends -all (hard fail) for Microsoft 365 domains, because DKIM and DMARC are also recommended. Microsoft also recommends a minimum time to live of 3600 seconds on SPF TXT records.

To undo it, put the saved text back as the domain's one SPF TXT record. If no SPF record existed before, the undo is to remove the record you added; the saved copy is then an empty note and nothing is overwritten.

A domain that is not provisioned. Microsoft's page says to provision all of the domains you own and gives no steps for it.

The high-risk delivery pool. Microsoft's page says: "If you determine that the outbound message was incorrectly detected as spam by Microsoft 365 or Office 365, contact support." To receive blind copies of outbound messages determined to be spam, Microsoft refers to "Configure outbound spam policy notifications". Microsoft's pools page says delivery from the pool is not guaranteed "because many email organizations don't accept messages from the high risk delivery pool."

Microsoft's pools page also says messages from a source domain with no A record and no MX record in public DNS "are always routed through the high-risk delivery pool". Microsoft's page does not say whether an SPF change affects that routing.

Confirm the fix

  • Send a test message to the external domain that bounced. It should deliver without the 5.7.23 bounce.
  • Run a message trace for it and read OutboundIpPoolName again.
  • Look up the SPF record again with the checker and confirm there is one v=spf1 record.

What to watch afterwards

  • New systems that send as the domain, such as scanners, line-of-business servers and marketing services. Microsoft says each needs to be a valid source in the record, and recommends a subdomain with its own SPF record for services you do not control.
  • The count of DNS lookups in the record, which Microsoft says must stay within the limit of 10.
  • Any further 5.7.23 bounces from the same domain.

Risks and limits

These commands have not been run or lab-tested. The SPF record text is Microsoft's example, adapted to one domain.

Microsoft's 5.7.23 page is short and names causes without ranking them. It gives no steps for provisioning a domain, and the registrar steps vary by provider. A wrong SPF record affects all mail from the domain, not only the mail that bounced. Microsoft's page names Exchange Online and Microsoft 365 without a version range.

Sources