Email errors
550 5.7.367: fix relay denied on forwarded Microsoft 365 mail
550 5.7.367 means a remote server refused mail sent by Microsoft 365, such as forwarded mail from its relay pool. See how to fix it.
What this means
550 5.7.367 means a remote mail server refused a message that Microsoft 365 tried to forward or relay. Microsoft ties this error to mail that failed the SPF or DKIM sender checks.
Microsoft's example of the bounce is 550 5.7.367 Remote server returned not permitted to relay -> 554 5.7.1 Relaying denied. The part after the arrow is the remote server's reply.
Why it happens
Microsoft 365 sends some forwarded or relayed mail from its relay pool, a separate set of IP addresses. To stay out of it, a message must meet at least one of these conditions on arrival at Microsoft 365:
- The outbound sender is in an accepted domain, one added to your organization.
- SPF passes for the sending domain.
Otherwise it might leave through the relay pool. Receiving gateways often block or restrict this mail.
SPF can fail on arrival in these cases:
- A gateway receives your mail first. Your MX record, which says where your mail arrives, points to a service such as Proofpoint or Barracuda, or to your own server. Exchange Online evaluates SPF with the gateway's IP address.
- The sender's SPF record omits its server.
How to fix it
- Confirm the relay pool. In the Exchange admin center, go to Mail flow > Message trace and find the message. Microsoft says failed messages show
RegularRelayOutboundPoolin theOutboundIpPoolNameproperty of the trace output, but its message trace article does not say which report type includes it. If another pool appears, consult the remote server's administrator. - Read the SPF result. If the forwarding mailbox kept a copy, find
Authentication-Resultsin its headers and look forspf=failorspf=softfail. Thesender IP istext shows the IP tested, andsmtp.mailfromshows the domain. Test that domain with the SPF checker. - If your MX points to a gateway, turn on Enhanced Filtering for Connectors. It preserves the source IP so SPF validates correctly. In the Microsoft Defender portal, open the Enhanced Filtering page and select the gateway's inbound connector. Choose Automatically detect and skip the last IP address if only the last source needs skipping. Otherwise list every gateway IP. Start with Apply to a small set of users and list the exact address the sender writes to (in hybrid through on-premises Exchange, the mail user's
TargetAddress). The test only applies when every recipient of the message is listed. Caution: this changes inbound filtering. Skip only systems that handle your own mail before Microsoft 365. - If you control the sender's domain, add it as an accepted domain. Caution: verify the domain with the TXT record only. Leave Exchange and Exchange Online Protection unselected unless that domain's mail is moving: its MX would send all mail to Microsoft 365, and its SPF record, next to an existing one, returns
permerror. With the Authoritative type, Microsoft 365 rejects mail for addresses it does not know at that domain. If any mailbox there is outside this Microsoft 365 organization, choose Internal relay and create a connector to the server that hosts it, or those people stop receiving mail. - If the sender's SPF record is at fault, have its owner fix it. If that is you, add the missing server to the existing record. Caution: keep one record per domain, because a second SPF record returns
permerror, and so do more than 10 DNS lookups. Keep every other sender listed. - Remove forwarding hops you do not need. Tell the mailbox owner first, because the old destination stops receiving mail.
Confirm the fix
- Ask the sender for a new message along the same path, because a 550 is a permanent refusal.
- Trace it after five to ten minutes. It should read Delivered. If your trace output includes
OutboundIpPoolName, it should not sayRegularRelayOutboundPool. - After Enhanced Filtering, open a test recipient's copy. Microsoft stamps
X-MS-Exchange-ExternalOriginalInternetSenderwhen the feature worked for that recipient. A legitimate sender should showspf=pass. - Keep tracing for a few days, because these failures are intermittent. If you turned on Enhanced Filtering and the test recipients pass, switch to Apply to entire organization.
- If you own the sending domain, DMARC aggregate reports show which sources still fail SPF.