Why Exchange Online returns 550 5.1.8 Access denied, bad outbound sender, how to secure the likely compromised account first, unblock it on the Restricted entities page or in PowerShell, and set outbound spam limits and alerts.
Home › Guides › Exchange Online 5.1.8
Last updated 17 November 2026
Microsoft documents the full NDR as:
Your message couldn't be delivered because you weren't recognized as a valid sender. The most common reason for this is that your email address is suspected of sending spam and it's no longer allowed to send email. Contact your email admin for assistance. Remote Server returned 550 5.1.8 Access denied, bad outbound sender.
The account went over the sending limits of the service or the limits in an outbound spam policy, so Exchange Online restricted it from sending. It can still receive mail. The account is added to the Restricted entities page in the Microsoft Defender portal, and Microsoft's NDR reference says this typically happens because the account was compromised (hacked) by phishing or malware.
The fix has two parts, in this order:
Remove-BlockedSenderAddress. Restrictions are usually removed within one hour.A user who gets this bounce should check whether their account is compromised and tell their admin. Only an admin can remove the block.
Every outbound message is scanned for spam. Microsoft blocks an account from sending when it passes an undisclosed limit for spam, or an overall outbound message limit regardless of the spam verdict. Microsoft doesn't publish those exact limits. The published per-user limits and the limits you can set yourself are:
| Limit | Value (Microsoft Learn) |
|---|---|
| Recipient rate limit | 10,000 recipients per day (24-hour sliding window) |
| Message rate limit | 30 messages per minute |
| Tenant External Recipient Rate Limit (TERRL) | Per tenant, scales with licenses; trial tenants 5,000 external recipients per day; NDR 550 5.7.233 |
| Outbound spam policy limits (yours) | External and internal recipients per hour and total recipients per day, 0 to 10000 (0 = service defaults) |
Common signs of a compromised mailbox from Microsoft's list: the mailbox is blocked from sending, suspicious Inbox rules (forwarding to unknown addresses, moving mail to Notes, Junk Email or RSS Subscriptions), odd messages in Sent Items or Deleted Items, recently added external forwarding, unexplained lockouts or password changes, changed GAL contact details and suspicious signatures.
Microsoft's steps for a compromised cloud email account, in order:
Connect-MgGraph -Scopes "User.ReadWrite.All" $user = Get-MgUser -Search UserPrincipalName:'<UPN>' -ConsistencyLevel Eventual Update-MgUser -UserId $user.Id -AccountEnabled $falseIf you can't disable it, reset the password. Don't send the new password by email (the attacker may be reading the mailbox), don't reuse any of the last five passwords, reset it twice in Active Directory if the account is synced, and change it on-premises if the identity is federated. App passwords aren't revoked by a reset: delete and recreate them. Enable and enforce MFA.
Connect-MgGraph -Scopes User.RevokeSessions.All Revoke-MgUserSignInSession -UserId <UPN>
Get-Mailbox -Identity <Identity> | Format-List Forwarding*Address,DeliverTo* Get-InboxRule -Mailbox <Identity> -IncludeHidden | Format-List Name,Enabled,RedirectTo,Forward*,IdentityA nonblank
ForwardingSmtpAddress forwards to an external recipient; check every rule with RedirectTo, ForwardTo or ForwardAsAttachmentTo.Then investigate: Microsoft Entra sign-in logs (IP address, location, time, success or failure), the audit log from just before the suspicious activity, and message trace for what the account sent. Microsoft also offers a Compromised Accounts diagnostic (Run Tests) to spot suspicious account activity. If you disabled the account, reset the password and enable it again when you're done.
You need the Organization Management or Security Administrator role group in Exchange Online (Global Reader, Security Reader and View-Only Organization Management can only view the page), or the matching Microsoft Entra or Defender XDR unified RBAC permissions.
Get-BlockedSenderAddress Get-BlockedSenderAddress -SenderAddress <emailaddress> | Format-List Remove-BlockedSenderAddress -SenderAddress <emailaddress>
For a cloud mailbox the identifier is the user principal name, which doesn't have to match the primary SMTP address. A nonhosted sender (for example an on-premises sender) is listed by its sending SMTP address.
Under most circumstances all restrictions are removed within one hour. Microsoft says transient issues can make it longer, but no longer than 24 hours in total.
Outbound spam policies are at Email & collaboration > Policies & rules > Threat policies > Anti-spam (Create policy > Outbound for a new one). The Restriction placed on users who reach the message limit setting decides what happens:
| Portal setting | PowerShell value | What happens |
|---|---|---|
| Restrict the user from sending mail until the following day | BlockUserForToday (default) | Notifications are sent and the user can't send until the following day, based on UTC time. |
| Restrict the user from sending mail | BlockUser | The user is added to Restricted users and can't send until an admin removes them. After removal, the user won't be restricted again for that day. |
| No action, alert only | Alert | The Email sending limit exceeded alert notifies admins. |
Microsoft's example for the default policy:
Set-HostedOutboundSpamFilterPolicy -Identity Default -RecipientLimitExternalPerHour 500 -RecipientLimitInternalPerHour 1000 -RecipientLimitPerDay 1000 -ActionWhenThresholdReached BlockUser
The default alert policy User restricted from sending email emails the TenantAdmins group (Global Administrator members) when a user is blocked. Check its recipients under Email & collaboration > Policies & rules > Alert policy. Alerts need audit logging, which is on by default. Microsoft recommends the alert policy over the notification settings inside outbound spam policies. Email sending limit exceeded and Suspicious email sending patterns detected are default alerts too.
If the account was blocked because of a legitimate mass mailing: Microsoft says bulk email through Microsoft 365 isn't a supported use of the service. Use Azure Communication Services Email, a non-Microsoft bulk email provider or your own servers, preferably from a subdomain with its own SPF, DKIM and DMARC (see the bulk sender guide).
| Code | Text in Microsoft's NDR reference | Meaning |
|---|---|---|
| 5.1.8 | Access denied, bad outbound sender | This guide: account restricted from sending. |
| 5.1.90 | Your message can't be sent because you've reached your daily limit for message recipients | Recipient rate limit; could indicate a compromised account. |
| 5.2.2 | Submission quota exceeded | Recipient or message rate limit; see the 5.2.2 guide. |
| 5.7.233 | Your message can't be sent because your tenant exceeded its daily limit for sending email to external recipients (tenant external recipient rate limit) | Tenant-wide external recipient limit (TERRL). |
| 5.7.501, 5.7.502, 5.7.503 | Access denied, spam abuse detected / Access denied, banned sender | Account banned for spam activity; see the 5.7.501 to 5.7.503 guide. |
| 5.7.708 | Access denied, traffic not accepted from this IP | Tenant-level block; see the 5.7.708 guide. |
Need SPF, DMARC and MX checks across a whole client list? Run the Bulk SPF / DMARC / MX Auditor on Apify ($2 per 1,000 domains).
Check your sending domain with the Email Deliverability Checker, SPF Record Checker and DMARC Record Checker, confirm the tenant with the M365 Tenant Lookup, read the NDR in the Email Header Analyzer and keep cmdlets in the PowerShell Cheat Sheet. Related guides: Exchange Online 5.7.501 to 5.7.503, Exchange Online 5.2.2, Exchange Online 550 5.7.708, Exchange Online 550 5.7.520 and bulk sender requirements.
Exchange Online restricted the sending account because it exceeded the sending limits of the service or of an outbound spam policy. The account can still receive mail, appears on the Restricted entities page in the Microsoft Defender portal, and in most cases was compromised by phishing or malware.
Secure the account first, then open the Restricted entities page in the Microsoft Defender portal (under Email & collaboration, Review), select the mailbox and choose Unblock. In Exchange Online PowerShell, run Remove-BlockedSenderAddress -SenderAddress with the user principal name.
Microsoft says all restrictions are usually removed within one hour. Transient technical issues can make it take longer, but the total wait should be no longer than 24 hours.
No. Microsoft treats exceeding outbound limits as an indicator of compromise. Disable the account or reset the password, revoke sessions, enable MFA, and check MFA methods, app consents, admin roles, forwarding and Inbox rules before you remove the block, or it can be blocked again.
Yes, within limits. Outbound spam policies set external and internal recipients per hour and recipients per day (0 to 10000, 0 means the service defaults) and the action: block until the following day (default), block until an admin removes the user, or alert only. The service limits and the undisclosed spam limits still apply.
Runbooks, checklists and helpdesk templates: IT Admin Packs on Gumroad.