5.5.4

Enhanced Status Code 5.5.4: Invalid Command Arguments

Permanent failure Medium severity Protocol RFC 3463
What it means

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.

At a glance
Code5.5.4
Bounce typeHard (permanent)
SeverityMedium
CategoryProtocol
What to doSuppress the address; do not retry
StandardRFC 3463
What it looks like in your mail logs
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

Your server attempts delivery
The recipient server returns a permanent 5.5.4 rejection
This is a hard bounce: the message will not be accepted as sent
Suppress the address and fix the root cause before resending

Where 5.5.4 sits: soft vs hard bounce

Soft bounce (4xx) Hard bounce (5xx)
NatureTemporaryPermanent
SMTP class4xx5xx
What to doLet it retrySuppress the address
Recoverable?OftenNo
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

Frequently asked questions

What does 501 5.5.4 mean?
It means a command was recognised but its arguments were invalid. From Gmail it almost always concerns the HELO or EHLO greeting being empty or not a valid fully qualified domain name. The command itself was fine; what followed it was not.
What should my HELO name be?
A fully qualified domain name that you control, that resolves to the IP address you are sending from, and that matches the PTR record for that address. That forward-confirmed reverse DNS relationship is expected by every major provider. A short hostname, localhost, or a bare IP address will all be refused or penalised.
Why does my server send the wrong HELO name?
Because most mail software defaults to the machine's own hostname, which on many systems is a short name with no domain. It works in testing against permissive servers and fails against strict ones. Set the greeting explicitly in configuration rather than relying on the default.
Does the HELO name affect deliverability beyond this error?
Yes, significantly. Receivers use the greeting alongside the PTR record to judge whether a sender is properly operated. A mismatched or invalid greeting contributes to reputation scoring at providers that accept the message anyway, so the cost is not limited to the connections that get refused.
How is 5.5.4 different from 5.5.2?
5.5.2 means the server could not parse the command at all. 5.5.4 means it parsed fine and the arguments were unacceptable. In practice the distinction matters because 5.5.4 points you at a specific value to correct, usually the greeting, while 5.5.2 points at malformed bytes.
Reviewed by Jennifer Jackson, Email Deliverability Analyst · June 2026 ← All bounce codes