Enhanced Status Code 5.5.4: Invalid Command Arguments
Enhanced Status Code 5.5.4 means “Invalid Command Arguments.” A valid SMTP command carried invalid arguments. Gmail returns it most often for a HELO or EHLO greeting that is empty or not a proper hostname.
501 5.5.4 HELO/EHLO argument invalid, closing connection
What does 5.5.4 mean?
Enhanced status code 5.5.4 means invalid command arguments. RFC 3463 defines it as a valid mail transaction protocol command issued with invalid arguments. The command was recognised; what followed it was not acceptable.
Google returns 501 5.5.4 for an invalid HELO or EHLO argument and for an empty one. That greeting is supposed to be the fully qualified domain name of the connecting host, and receivers increasingly check that it looks like one. Sending a bare hostname with no domain, an IP address without brackets, the word localhost, or nothing at all will be refused. The greeting is also one of the first things a receiver uses to form an impression of a sender, so an invalid one costs more than the immediate rejection.
The correct value is a fully qualified domain name that resolves to the sending IP address and matches its PTR record. That forward-confirmed reverse DNS relationship is a baseline expectation at every major provider, and getting the greeting right is the cheapest part of it. Software that defaults to the machine's short hostname is the usual source of the problem.
How 5.5.4 plays out
5.5.4 rejectionWhere 5.5.4 sits: soft vs hard bounce
| Soft bounce (4xx) | Hard bounce (5xx) | |
|---|---|---|
| Nature | Temporary | Permanent |
| SMTP class | 4xx | 5xx |
| What to do | Let it retry | Suppress the address |
| Recoverable? | Often | No |
| 5.5.4 is | ✓ this code |
Common causes of 5.5.4
- The HELO or EHLO argument is empty
- The greeting uses a short hostname with no domain part
- The greeting is an IP address without the required bracket syntax
- The greeting is localhost or another non-routable placeholder
- A parameter on MAIL FROM or RCPT TO is malformed, such as a bad SIZE value
- The sending software defaults to the machine hostname rather than a configured value
How to fix 5.5.4
- Set the HELO name explicitly to a fully qualified domain name you control
- Make sure that name resolves to the sending IP and matches its PTR record
- Never send a bare short hostname, localhost, or an unbracketed IP address
- Check parameters on MAIL FROM and RCPT TO if the greeting is already correct
- Log the exact command that drew the refusal, since the argument is the fault
- Verify the PTR relationship with Reverse DNS Checker after changing the greeting