# 5.7.506 Bounce: Access Denied, Bad HELO

URL: https://email-validation.org/bounce-codes/5-7-506/
Updated: 2026-11-26

> Documentation index: https://email-validation.org/llms.txt

**Short answer:** Your mail server greeted Microsoft 365 with the name of Microsoft's own server instead of its own name, so it was refused. It is permanent: retrying with the same greeting fails again. Set the HELO or EHLO name on your server to its own fully qualified domain name.

**At a glance**

- **Type:** permanent failure (class 5, RFC 3463 §2). The sending server does not retry it and reports the failure to the sender: a bounce message, or an error in the mail app.
- **Basic code:** varies; the enhanced code is the part that identifies the problem.
- **Enhanced code 5.7.506:** not in the IANA registry; the group is security or policy status (RFC 3463 §3.8).
- **Who uses it:** Microsoft (Exchange Online): access denied, bad HELO.

A 5.7.506 bounce means your server introduced itself to Microsoft 365 with the wrong name. It used the name of the server it was connecting to, not its own.

## What it means

This is Microsoft's code, not one from the IANA registry. Microsoft's [Exchange Online NDR reference](https://learn.microsoft.com/en-us/troubleshoot/exchange/email-delivery/ndr/non-delivery-reports-in-exchange-online) shows it as `Access Denied, Bad HELO`.

Every SMTP session starts with a greeting. The sending server says HELO or EHLO, followed by its own full host name, such as `mail.example.com` (or, if it has none, its IP address in brackets). Microsoft refuses a server that gives the receiving server's name instead, and notes that spam bots behave this way.

A greeting that is malformed in other ways, such as an empty or broken hostname, can get [501 5.5.4](https://email-validation.org/bounce-codes/501-5-5-4/) instead.

## Common causes

- The HELO name in the server's settings was copied from the MX host it sends to.
- A relay or smart host setting put the destination's name in the greeting field.
- An app, printer or script sends mail with a fixed greeting that someone set wrong.
- Spam software on a compromised machine is sending mail. This is the behavior Microsoft is guarding against.

## How to fix it

If you are the sender:
1. Find the name your server sent after HELO or EHLO. Your server's mail log shows it.
2. Set that name to a hostname you own and that points to the sending server, such as `mail.example.com`.
3. Make sure the hostname resolves to the server's IP address, and that the IP's reverse DNS points back to the hostname. A missing PTR record causes its own refusals ([550 5.7.25](https://email-validation.org/bounce-codes/550-5-7-25/)).
4. For an app or device, look in its SMTP settings for a field named greeting, HELO or local hostname.
5. If you never set a HELO name and cannot find where it comes from, check the machine for malware.
6. Send a test message to a Microsoft 365 address and check that it arrives.

If you send through an email service, the service sets the greeting. Forward it the bounce.

## What to do with the address

Keep it. The recipient address is not the problem. Your server's greeting is. Once the name is fixed, resend the message.

## Related codes

- [501 5.5.4](https://email-validation.org/bounce-codes/501-5-5-4/): Invalid HELO/EHLO or command arguments
- [550 5.7.25](https://email-validation.org/bounce-codes/550-5-7-25/): Reverse DNS (PTR) check failed
- [5.7.606](https://email-validation.org/bounce-codes/5-7-606/): Banned sending IP (Microsoft)

See [every bounce code](https://email-validation.org/bounce-codes/) in the dictionary.

The address on your list is not what failed here. For the bounces your list does cause, [clean the list before you send](https://email-validation.org/bulk-email-verification/).

_How we wrote this: drafted by the email-validation.org team with the help of AI writing tools, from our product documentation and the sources linked in the text._
