550 5.7.367: remote server returned not permitted to relay
Microsoft 365 forwarded or relayed a message through its relay pool because the message failed authentication on arrival, and the downstream mail gateway refused to relay it.
550 5.7.367 Remote server returned not permitted to relay -> 554 5.7.1 Relaying denied
Example NDR text from Microsoft's article on 5.7.367 relay pool issues.
What 550 5.7.367 means
Microsoft documents 5.7.367 for intermittent failures when Microsoft 365 autoforwards or relays email. When Exchange Online forwards or relays a message on behalf of an external sender, it chooses an outbound delivery pool. To prevent abuse such as spoofing and phishing, it may send the message from a relay pool instead of its standard outbound IP ranges, and it's more likely to do so when email authentication failed when the message entered Microsoft 365.
The relay pool isn't published, isn't part of Microsoft 365's SPF record, and isn't in its outbound IP ranges. Microsoft says destinations don't consider Microsoft 365 the sender of mail from the relay pool, so downstream gateways often block or restrict it, and the result is a "relay denied" error. The symptom Microsoft describes: the message trace shows OutboundIpPoolName RegularRelayOutboundPool, and SPF was fail or softfail when the message arrived.
Microsoft says a forwarded or relayed message avoids the relay pool if the sender is in an accepted domain of the tenant, or if SPF passes when the message enters Microsoft 365. A common reason SPF fails on arrival: your MX points to another filtering service or an on-premises server, so Exchange Online evaluates SPF against that gateway's IP. Microsoft's fix is Enhanced Filtering for Connectors, which lets Exchange Online check SPF against the original sender's IP.
Likely causes
- Mail is forwarded or relayed through Microsoft 365 for an external sender, and SPF failed or soft-failed on arrival.
- The domain's MX points to a separate gateway or on-premises server, and Enhanced Filtering for Connectors isn't configured.
- Multiple hops and autoforwarding chains break authentication.
- The downstream gateway only accepts relay from Microsoft 365's published ranges.
How to fix it
If you sent the message
- If the MX record points to another service or server, turn on Enhanced Filtering for Connectors on the inbound connector.
- If the original sender's domain is yours, add it as an accepted domain in Microsoft 365.
- Avoid multi-hop relay and autoforwarding chains where you can.
- Check the message trace for OutboundIpPoolName to confirm the relay pool was used.
If you're the recipient or their admin
- If you run the downstream gateway, review why it denies relay from the connecting IP before allowing it.
Frequently asked questions
What is the Microsoft 365 relay pool behind 5.7.367?
A set of IP addresses Exchange Online can use to forward or relay messages that failed authentication on arrival. Microsoft doesn't publish it and it isn't in Microsoft 365's SPF record, so downstream gateways often refuse mail from it.
Why does a filtering service in front of Microsoft 365 lead to 5.7.367?
Without Enhanced Filtering for Connectors, Exchange Online checks SPF against the filtering service's IP, so SPF fails. Forwarded copies of those messages can then go out through the relay pool. Microsoft recommends enabling Enhanced Filtering on the inbound connector.
Sources
- 5.7.367 Microsoft 365 relay pool issues in downstream gateways (Microsoft Learn)
- Enhanced Filtering for Connectors in Exchange Online (Microsoft Learn)
- Email nondelivery reports (NDRs) and SMTP errors in Exchange Online (Microsoft Learn)
Provider messages are quoted as the provider publishes them. Servers can change their wording, so the bounce you received may differ slightly.
Related codes
- 550 5.7.64 550 5.7.64 TenantAttribution; Relay Access Denied
- 550 5.7.520 550 5.7.520: access denied, your organization does not allow external forwarding
- 550 5.7.1 550 5.7.1: delivery not authorized, message refused
- 550 5.7.23 550 5.7.23: SPF validation failed
- 550 5.7.703 550 5.7.703: messages blocked by your organization using Tenant Allow Block List
- 550 5.7.236 550 5.7.236: daily limit for external mail from onmicrosoft.com domains
- 550 5.0.350 550 5.0.350: generic error from the recipient's server
Related guides
How to use an external spam filter with Microsoft 365 and Enhanced Filtering for Connectors
How to run an MX-level spam filter in front of Exchange Online: Partner connector, Enhanced Filtering for Connectors, why not SCL -1, headers and rollback.
10 min read SPF, DKIM & DMARCWhy email forwarding breaks SPF and DMARC, and how ARC helps
Why forwarding and mailing lists break SPF and sometimes DKIM, how that fails DMARC, and how SRS, ARC and trusted ARC sealers in Microsoft 365 help fix it.
9 min read Setup guidesMicrosoft 365 connectors explained: when you need them and how they work
When Exchange Online needs inbound or outbound connectors: Partner vs on-premises types, TLS certificate and IP matching, smart hosts, validation and mistakes.
9 min read Running email day to dayHow do you find and block malicious inbox rules and auto-forwarding?
How attackers use inbox rules and forwarding to hide replies and copy mail, how to find them in Outlook, PowerShell and Gmail, and how to block forwarding.
10 min read