550 5.7.54 unable to relay recipient in non-accepted domain
550 5.7.54 means an Exchange server refused to relay your message to a domain it does not host. Fix the accepted domain, connector or relay permission.

On this page(8 sections)
A 550 5.7.54 bounce, worded "SMTP; Unable to relay recipient in non-accepted domain", means an Exchange server was asked to deliver a message to a domain it does not own and was not allowed to pass it on. The server is working as designed: it accepts mail for its own domains and refuses to be an open relay for everyone else. The fix is to give the sender relay rights, or to send through a path that is allowed to reach outside recipients.
This post explains what the code is, the four situations that produce it, and how to tell which one you are in before you change any permissions.
What does 550 5.7.54 mean?
It means the receiving server treated the recipient's domain as foreign, and the connection you used was not permitted to relay to foreign domains. The pieces come from two standards.
| Part | Meaning | Source |
|---|---|---|
550 |
Permanent failure: the requested action was not taken | RFC 5321 section 4.2 |
5.7.54 |
Class 5 (permanent), subject 7 (security or policy), detail 54 as defined by Exchange | RFC 3463 for the structure |
An open relay is a server that forwards mail from anyone to anyone. Exchange refuses that by default, so a message addressed to a recipient outside its accepted domains is rejected unless the client authenticated with relay permission or connected from an allowed source. Because the failure is about policy, not about the mailbox, retrying the same message changes nothing.
Which of the four situations are you in?
Match the symptom to the cause before touching a setting. The bounce text is identical in all four.
| Situation | Typical symptom | Where the fix lives |
|---|---|---|
| An app or device relays through Exchange Server on premises | Internal recipients work, external ones bounce | The receive connector and its relay permission |
| An app uses Direct Send to Microsoft 365 | Your own domain works, Gmail or Yahoo bounces | Switch to a method that can reach the internet |
| A hybrid or migration setup routes a shared domain | A domain you own bounces on one side only | Accepted domain type and connectors |
| An external forward or rule on a mailbox | Only forwarded copies fail | The send connector or forwarding policy |
Ask first: does the failing recipient belong to a domain your organization owns, or to a stranger such as Gmail? That one question usually picks the row.
Why does Direct Send to Microsoft 365 produce it?
Direct Send is the method where a device or app connects straight to your Microsoft 365 MX endpoint on port 25 with no authentication. Microsoft's documentation says it sends only to recipients in your own organization and that mail to outside recipients, with Yahoo and Gmail addresses given as examples, is rejected. Microsoft does not tie that rejection to a specific code on that page, but a relay refusal of this kind is the typical shape of the bounce people paste.
The fix is to stop using Direct Send for anything that must reach outside addresses. Microsoft lists these alternatives for external delivery:
| Method | Port | Reaches external recipients | Needs |
|---|---|---|---|
| Client SMTP submission (SMTP AUTH) | 587 or 25 | Yes | A licensed mailbox and credentials, with SMTP AUTH enabled |
| SMTP relay through an inbound connector | 25 | Yes | A static IP or a TLS certificate with an accepted domain |
| Direct Send | 25 | No | Nothing, but internal recipients only |
SMTP relay authenticates your sender with an inbound connector, so Exchange knows the mail belongs to your organization. The connector is matched by a certificate whose subject or SAN contains an accepted domain, or by a static public IP address that belongs only to you. For the From address, Microsoft says any address in an accepted domain works, even one with no mailbox.
If you are choosing between SMTP and an HTTP API for the sending side, SMTP or API for sending email covers the trade-offs, and 550 5.7.64 TenantAttribution relay access denied is the nearby Microsoft 365 error for a connector that is missing or mismatched.
How do I fix it on an on-premises Exchange Server?
On Exchange Server the cause is usually a receive connector that lets the client connect but not relay. Authentication alone is not enough: the connecting account or source needs the relay right on that connector.
- Identify which receive connector the client actually reaches. Check the port and the source IP against each connector's bindings and remote IP ranges.
- Run
Get-ReceiveConnector "<name>" | Format-List Enabled,Bindings,RemoteIPRanges,PermissionGroups,AuthMechanismand read the output against the client's behavior. - Create a dedicated receive connector for the application instead of loosening the default ones. Scope its remote IP range to the application server only.
- Grant the relay right on that dedicated connector only. Microsoft documents the procedure in Allow anonymous relay on Exchange servers.
One caution from public support threads: some answers suggest granting the accept-any-recipient right to a broad group such as Authenticated Users. That works, but it hands relay rights to every authenticated account on that connector. Prefer a narrowly scoped source or account, and note that several of those threads are old and unresolved, so verify against Microsoft's current page.
When is the accepted domain type the culprit?
If the failing domain is one your organization owns, check how it is registered. An accepted domain in Exchange Online is a domain you added to Microsoft 365. Microsoft describes two types:
- Authoritative: mail is delivered to recipients listed in Microsoft 365, and mail for unknown recipients is rejected.
- Internal relay: known recipients get the mail in Microsoft 365, and anything else is relayed to your own mail servers, which requires a connector to them.
In a hybrid setup, a domain whose mailboxes live on both sides needs Internal relay on the cloud side, with a working connector to on-premises. If the type is wrong or the connector is missing, the domain looks foreign to the side that should have relayed it. Check it with:
Get-AcceptedDomain | Format-Table Name,DomainName,DomainType
A typo is also possible: if the domain in the bounce is a misspelling of a domain you own, it is simply a foreign domain, and the right fix is the address.
What about forwarded mail failing with 5.7.54?
A mailbox forward to an outside address makes Exchange send a new message to a foreign domain. If the path used for that does not permit relaying, the forward bounces with 5.7.54 while direct mail works. Public admin write-ups describe a dedicated send connector for the external domain as the fix. If Microsoft 365 blocks outbound forwarding by policy instead, you will see 550 5.7.520 external forwarding blocked, a different code with a different fix.
What should I send to the admin?
If you do not control the Exchange side, a short, exact report saves a day of back and forth.
- The full bounce, including the Reporting-MTA and Remote-MTA lines.
- The sending method: Direct Send, SMTP AUTH on 587, SMTP relay on 25, or a forward.
- Whether internal recipients succeed and external ones fail.
- The source IP address and the From address used.
- The time of the failure in UTC.
Bottom line
- 550 5.7.54 means Exchange refused to relay to a domain it does not host. It is policy, not a bad mailbox, so retrying does not help.
- If internal recipients work and external ones fail, you almost always need a different sending method or relay permission, not a DNS change.
- Direct Send to Microsoft 365 cannot reach outside recipients. Use authenticated submission or an inbound-connector relay.
- On Exchange Server, give a dedicated receive connector the relay right, scoped to the application server only.
- For a domain you own, check the accepted domain type and the connector between the cloud and on-premises sides.
Start with Koltrix
Your domain, one inbox, and an API that sends.
A team inbox where AI sorts and drafts (nothing is sent without your click), plus the transactional API and SMTP relay your product sends with. 7 days free, no card.


