501 5.5.4 Invalid HELO/EHLO argument / syntax error in parameters
The server did not like the arguments your client sent with a command, most often the hostname in HELO or EHLO. Servers expect a fully qualified hostname or an address literal in brackets; a bare word, a name with spaces, an underscore, or an empty argument gets this reply, and some servers refuse the session afterwards.
What the server replies
501 5.5.4 Invalid domain name
- Sent by
- Any mail server
- Type
- PermanentRetry fails
- About
- Connection
- Enhanced code
- 5.5.4
Who sends it
Exchange ("501 5.5.4 Invalid domain name" and "Invalid Address" for a malformed MAIL FROM), Postfix ("501 5.5.4 Syntax: HELO hostname" and "504 5.5.2 Helo command rejected: need fully-qualified hostname" when strict), and any server following RFC 5321.
Why it happens
- The MTA's hostname is set to a single label like "mailserver" or "localhost".
- An application library sends the machine's local name, which is not a valid domain.
- The hostname contains an underscore or starts with a digit and the server validates strictly.
- A MAIL FROM or RCPT TO address with unbalanced angle brackets or a space.
How to fix it
Set a fully qualified HELO name
Configure myhostname (Postfix), primary_hostname (Exim) or the equivalent to a real hostname such as mail.example.com that resolves to the server's IP.
Set the client's local hostname
Libraries like Nodemailer, PHPMailer and smtplib let you pass the name to use in EHLO. Set it to your domain rather than relying on the machine name.
Check address syntax
Make sure addresses are wrapped as <user@domain> with no spaces and that display names are not leaking into the envelope.
Check it yourself
These free tools show the records and connections behind this code for your own domain or server.
Related codes
- 550 5.7.25 The IP address sending this message does not have a PTR record setupGmail looked up the reverse DNS of the connecting IP and either found nothing or found a hostname that does not resolve back to that IP.
- 553 5.1.3 Bad recipient address syntaxThe recipient address is not a valid email address as far as the server can tell: a missing @, two @ signs, spaces, quotes in the wrong place, a trailing dot, or characters outside what the server permits.
- 530 5.7.0 Authentication required / Must issue a STARTTLS command firstThe server will not go any further until the client does something it has not done yet.
Sources
Fewer bounces to look up.
Faivelo sends from authenticated, warmed infrastructure, turns permanent bounces into one clean event for your application and keeps the address out of future sends.
Free tier included. No card needed.
Other free tools
All tools- Email DNS checkerCheck MX, SPF, DKIM, DMARC and reverse DNS for any domain and get the exact records to add or fix.
- DMARC checkerLook up a domain's DMARC record, read every tag in plain words and see what to tighten next.
- DMARC record generatorBuild a valid DMARC record from a few choices and copy the host and value into your DNS.
- DMARC report analyzerDrop in a DMARC aggregate report and see who is sending as your domain and whether they pass.
- SMTP connection testerConnect to any SMTP server, check TLS and the login step, and see each stage with its timing.
- Email header analyzerPaste raw headers to see every hop, where the delay was, and whether SPF, DKIM and DMARC passed.
- Email address validatorCheck whether an address is well formed, whether its domain accepts mail, and whether it is disposable or a role account.