501 means the server knows the command but cannot accept its argument — an address without its angle brackets, an invalid EHLO name, arguments where none belong. The session stays where it was, so a corrected command can follow.
| Code | 501 |
| Meaning | Syntax error in parameters or arguments |
| Kind | Permanent failure — the sender gives up |
| Sent in reply to | Any command — often EHLO, MAIL, AUTH and STARTTLS |
| What the sender does | May send a corrected command; otherwise the message does not go |
| Defined in | RFC 5321, sections 4.1.4 and 4.2 |
Paste your bounce
Paste the line with the code — or the whole bounce: we explain each code in it, say whether the sender will try again, and link the service’s own page where it has one. It is read in your browser; nothing is sent.
What causes it
- A malformed address in MAIL FROM or RCPT TO.
- An empty or invalid name in EHLO — a server that introduces itself as “localhost” or with nothing at all.
- Parameters after STARTTLS, or AUTH data that is not valid Base64.
What to do
- Set the server’s EHLO name to its full host name — the one its reverse DNS points to.
- Check the addresses and arguments the client sends.
What each provider means by it
| Who | What they say |
|---|---|
| Gmail | 501 5.5.4 for an invalid or empty HELO/EHLO argument, closing the connection; 501 5.5.2 when it cannot decode an AUTH response; 501 5.7.11 for STARTTLS sent with parameters. |
| Postfix | The default for refusing an invalid HELO/EHLO name (invalid_hostname_reject_code). |
Worth knowing
A client that cancels an AUTH exchange with “*” gets a 501 by definition.
Sources
Checked on 27 September 2026 against these official sources:
- RFC 5321: Simple Mail Transfer Protocol — rfc-editor.org
- RFC 3207: SMTP Service Extension for Secure SMTP over Transport Layer Security — rfc-editor.org
- RFC 4954: SMTP Service Extension for Authentication — rfc-editor.org
- Simple Mail Transfer Protocol (SMTP) Enhanced Status Codes Registry — iana.org
- Gmail SMTP errors and codes — knowledge.workspace.google.com
- Postfix Configuration Parameters — postfix.org