Skip to content
DMARC Pulse

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

  1. Confirm the relay pool. In the Exchange admin center, go to Mail flow > Message trace and find the message. Microsoft says failed messages show RegularRelayOutboundPool in the OutboundIpPoolName property 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.
  2. Read the SPF result. If the forwarding mailbox kept a copy, find Authentication-Results in its headers and look for spf=fail or spf=softfail. The sender IP is text shows the IP tested, and smtp.mailfrom shows the domain. Test that domain with the SPF checker.
  3. 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.
  4. 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.
  5. 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.
  6. Remove forwarding hops you do not need. Tell the mailbox owner first, because the old destination stops receiving mail.

Confirm the fix

  1. Ask the sender for a new message along the same path, because a 550 is a permanent refusal.
  2. Trace it after five to ten minutes. It should read Delivered. If your trace output includes OutboundIpPoolName, it should not say RegularRelayOutboundPool.
  3. After Enhanced Filtering, open a test recipient's copy. Microsoft stamps X-MS-Exchange-ExternalOriginalInternetSender when the feature worked for that recipient. A legitimate sender should show spf=pass.
  4. 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.
  5. If you own the sending domain, DMARC aggregate reports show which sources still fail SPF.

Check it now

Validate SPF and count DNS lookups

Frequently asked questions

Is "sender not authorized for relay" the same error?
Forum threads use that name for code 5.7.367. Microsoft's documentation words it as "Remote server returned not permitted to relay", so go by the code when you search or open a support case.
Can I add the relay pool to my SPF record or an allowlist?
No. Microsoft does not publish the relay pool's addresses and says they can change often. They are also outside the Microsoft 365 SPF record. Fix the authentication failure on arrival instead.
Does turning on DKIM stop this error?
Not by itself. Microsoft recommends DKIM on the sending domain to improve authentication of forwarded mail, but says it does not prevent routing through the relay pool. Microsoft's criteria for staying out are an accepted domain or an SPF pass on arrival.
Why do only some forwarded messages fail?
Microsoft describes these failures as intermittent. A message that fails authentication on arrival might go out through the relay pool, and the result then depends on the gateway that receives it.
How is this different from 550 5.7.64 TenantAttribution?
550 5.7.64 TenantAttribution; Relay Access Denied appears when your inbound connector no longer matches the certificate or IP address of the server submitting mail. With 5.7.367, a remote server refused the message.
If SPF passes on arrival, will the forwarded message also pass DMARC?
Not always. With the Sender Rewriting Scheme (SRS), Microsoft 365 rewrites the envelope sender of forwarded mail, so SPF can pass at the next hop, but the rewritten address uses the forwarding domain, which does not align with the From: address as DMARC requires. Microsoft says the only reliable way is a DKIM signature from the From: domain that stays intact until the final destination.

Sources consulted

Related pages

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.