501 5.5.4: Invalid HELO/EHLO or command arguments

At a glance

A command your mail server sent had invalid arguments. Most often it is the greeting: the name your server gives in EHLO or HELO is empty or not a proper host name, so the receiving server refuses to talk to it.

What it means

RFC 3463 §3.6 defines X.5.4 as "invalid command arguments": a valid command was sent with arguments that were out of range or not recognized. It is only useful as a permanent error. The basic code 501 is "syntax error in parameters or arguments" (RFC 5321 §4.2.3).

The EHLO rules come from RFC 5321:

Common causes

How providers use it

Gmail returns 501 5.5.4 when the HELO or EHLO argument is invalid or empty (Google's SMTP error reference). Microsoft has a separate code, 5.7.506, for a bad HELO in which the sending server introduces itself with the name of the server it is connecting to (Exchange Online NDR reference).

How to fix it

  1. Find the EHLO name your server sends. It is in your mail server's settings, often called the host name, HELO name or SMTP banner name, and in the SMTP log.
  2. Set it to a full domain name you control, such as mail.example.com.
  3. Give that name an A or AAAA record pointing to the sending IP, and set the IP's reverse DNS (PTR) to the same name. Receivers check reverse DNS separately; see 550 5.7.25.
  4. If an application connects directly, set its EHLO name in its mail settings; if none is set, the library may send the machine's short name.
  5. If the error points to a different command, check that command's parameters against the server's EHLO reply, which lists the extensions it supports.

See every bounce code in the dictionary.

Many bounces from addresses that do not exist can be avoided: check an address with our free email checker, or clean a whole list before you send.

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.

Updated · Maintained by the email-validation.org team