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

NetLeverage
NetLeverage

Exchange Online '550 5.4.1 Recipient address rejected: Access denied': Directory-Based Edge Blocking and missing recipients

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.

The bounce "550 5.4.1 Recipient address rejected: Access denied" is what Directory-Based Edge Blocking (DBEB) returns when a message is sent to an address that does not exist in Microsoft 365. DBEB rejects mail for invalid recipients at the edge of the service, before spam and malware filtering run. If the address is real but lives on an on-premises server, or is a dynamic distribution group created on-premises, the fix is to get that recipient into the cloud directory, or to keep the domain on Internal relay until it is there. On-premises mail-enabled public folders have additional considerations that Microsoft describes in a separate article.

If all recipients for your domain are in Exchange Online, DBEB is already in effect and Microsoft says you do not need to do anything.

What the error means

Microsoft describes DBEB this way: if a message is sent to a valid email address in Microsoft 365, it continues through anti-malware, anti-spam and mail flow rules. If the address does not exist, the service blocks the message before filtering occurs, and an NDR (non-delivery report, or bounce) is returned to the sender that looks like "550 5.4.1 Recipient address rejected: Access denied".

DBEB follows the accepted domain type. In Exchange Online an accepted domain is Authoritative or Internal relay. Authoritative means mail is delivered to addresses listed for recipients in Microsoft 365 for that domain, and mail for unknown recipients is rejected. Microsoft says choosing Authoritative enables DBEB. Internal relay means recipients can be in Microsoft 365 or on your own servers, and mail for recipients Microsoft 365 does not know is relayed to your email server.

Two consequences follow. A real person with a working mailbox on your old server is still an invalid recipient to Microsoft 365 until an object for that address exists in the cloud directory. And the rejection happens before any filter or rule you have configured, so a mail flow rule cannot rescue a message that DBEB has refused.

In hybrid environments, Microsoft adds that for DBEB to work the MX record for the domain must point to Microsoft 365, so that mail for the domain is routed there first.

Likely causes

Cause What you see How to confirm
Address does not exist in Microsoft 365 (typo, or user not yet added) 5.4.1 for one address The address is not found in the Exchange admin center recipient list
Domain is Authoritative while some recipients are still on your own server 5.4.1 for the on-premises users only Domain type is Authoritative and those users are not synced to the cloud
Dynamic distribution group created on-premises 5.4.1 for that group's address Group is not in Exchange Online
On-premises mail-enabled public folder Possibly a bounce for the folder address; Microsoft says DBEB has extra considerations for these folders Folder is not in Exchange Online; follow Microsoft's separate public folder article
Recipient not yet replicated to Microsoft 365 after a change New users bounce for a time; Microsoft says recipients must be added to Exchange Online and "replicated through the system" before the domain is made Authoritative User exists on-premises but is not yet in the cloud directory

Prove the cause before changing anything

Read only. Start with the exact address in the bounce and compare it letter for letter with the intended one. Then find the recipient in the Exchange admin center under Recipients. If it is missing, note whether it should exist.

Next, read the domain type. In the Exchange admin center go to Mail flow, then Accepted domains. In PowerShell:

Get-AcceptedDomain -Identity contoso.com.au | Format-List Name,DomainName,DomainType | Out-File -FilePath .\accepted-domain-before.txt

Open the file and record the DomainType value; the back-outs below use it. For a hybrid domain, confirm the MX record points to Microsoft 365, which is Microsoft's stated condition for DBEB to work.

Run a message trace in the Exchange admin center under Mail flow, then Message trace, for the failed message, so you have the delivery details on record. Trace data can take from 10 minutes to an hour to appear.

Example (illustrative): Contoso has 150 staff on contoso.com.au. 112 mailboxes are in Microsoft 365 and 38 are still on mail01, and the 38 have not been added to Microsoft 365 yet. Someone sets the accepted domain to Authoritative early. Mail to the 38 now bounces with 5.4.1, which is 38 of 150, or 25 per cent of staff (38 / 150 = 0.253). The other 112 are unaffected.

Fix

Match the fix to the cause.

Typo or missing user.

Risk: creating a user, as the step below allows, changes your tenant: it adds a directory object to your tenant.

Correct the address, or create the user. Microsoft's two ways to add valid users are directory synchronisation from on-premises Active Directory to Microsoft Entra ID, or adding users with PowerShell or the Exchange admin center.

To undo it, delete the user you created, once you have checked no mail has been delivered to it that you need.

Domain too strict during a migration. Microsoft's sequence for enabling DBEB ahead of a migration is: verify the accepted domain is set to Internal relay, add users to Microsoft 365, then set the accepted domain to Authoritative. Microsoft adds that until all valid recipients have been added to Exchange Online and replicated through the system, the domain should stay Internal relay. To go back to Internal relay, record the current type first (the file accepted-domain-before.txt from the read-only step holds it).

Disruptive step: Internal relay turns off the edge rejection for that domain. Mail for recipients Microsoft 365 does not know is relayed to your server, and your server then decides what to do with it. Microsoft also says Internal relay needs a connector from Microsoft 365 to your on-premises server, otherwise recipients not hosted in Microsoft 365 cannot receive mail. Confirm the connector exists before you switch. Microsoft's pages say only that the connector is required; the usual place to look is the Exchange admin center under Mail flow, then Connectors, for a connector that sends mail to your server. Back-out: set the type back to the value you recorded, for example Set-AcceptedDomain -Identity contoso.com.au -DomainType Authoritative.

The command to go back to Internal relay:

Set-AcceptedDomain -Identity contoso.com.au -DomainType InternalRelay

Save first: the recorded type in accepted-domain-before.txt.

Disruptive step: the next change sets the domain type to Authoritative (portal route below), which enables DBEB, and every address missing from Microsoft 365 starts bouncing. Check the recipient list first.

The portal route is Mail flow, then Accepted domains, select the domain, set the domain type and select Save. Microsoft notes that the Save button is shown only to admins with the specific permissions needed to change the type, so check your permissions before you plan the change window. Microsoft puts the work at 5 to 10 minutes. If you select Authoritative, the portal asks you to confirm that you want to enable DBEB.

To undo it, set the type back to InternalRelay with the command shown above.

Dynamic distribution groups from on-premises. Microsoft says these do not sync to Exchange Online and are blocked by DBEB.

Risk: the workaround below creates a mail contact, which adds a directory object that routes mail for that address. Record the address first.

In hybrid environments the documented workaround is to create a mail contact with the same external email address of the blocked group in Exchange Online. To undo it, delete the mail contact you created.

On-premises mail-enabled public folders. Microsoft's DBEB page says there are additional considerations and points to a separate Microsoft article titled "Office 365 Directory Based Edge Blocking support for on-premises Mail Enabled Public Folders". No steps for it are given here; read that article before switching the domain type.

Confirm the fix

Send a message from an outside mailbox to the previously rejected address and confirm it is delivered. Then run a message trace for it. Send a message to a deliberately wrong address on the domain to confirm the intended behaviour: with Authoritative the sender gets the 5.4.1 bounce, and with Internal relay the message is relayed to your own server, which decides what happens to it. Repeat for each group of recipients that bounced. Keep the earlier record of the domain type and the list of connectors next to the test results, so a later change can be compared with a known state.

What to watch afterwards

  • Recipients created on-premises. New users must reach Microsoft 365 before the domain is Authoritative.
  • Dynamic distribution groups and public folders, which behave differently from mailboxes. Ask the owners of each whether anyone outside the company writes to them, because those are the first addresses to bounce.
  • Bounces in the days after switching the domain type. Compare their count with the count of staff not yet moved.
  • Microsoft's caveat that, after the switch to Authoritative, there might be infrequent instances where addresses that do not exist in your organisation are allowed to relay through the service.

Risks and limits

These commands have not been run or lab-tested. Microsoft's DBEB page gives portal steps and does not provide PowerShell. The Set-AcceptedDomain syntax comes from its reference page, which shows no date. Changing the accepted domain type affects all mail for the domain, so make the change in a quiet period and test both directions. Microsoft gives no time for how long replication takes after users are added, so confirm each user in the directory before you change the type. These steps apply only when the bounce comes from Microsoft 365, so check the sending server named in the bounce header before you start.

Sources