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 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 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:
- Find the name your server sent after HELO or EHLO. Your server's mail log shows it.
- Set that name to a hostname you own and that points to the sending server, such as
mail.example.com. - 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).
- For an app or device, look in its SMTP settings for a field named greeting, HELO or local hostname.
- If you never set a HELO name and cannot find where it comes from, check the machine for malware.
- 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.
The address on your list is not what failed here. For the bounces your list does cause, clean the list before you send.