SMTP 501: syntax error in parameters or arguments
501Syntax error in parameters or argumentsPermanent: retrying will not help
501 5.1.7 Bad sender address syntax
What it means
RFC 5321 defines 501 as "Syntax error in parameters or arguments". The server knows the command, but what follows it is malformed: an address without angle brackets, an empty or invalid HELO name, or a parameter in the wrong format.
The enhanced code usually tells you which argument broke. 5.1.7 means a bad sender address, 5.1.3 a bad destination address syntax, and 5.5.4 invalid command arguments. RFC 4954 adds two AUTH cases: 501 5.5.2 when the server cannot decode a Base64 response, and 501 with 5.7.0 when the client cancels the exchange with "*".
It is permanent for that command. Resending the same command produces the same 501, so the fix has to happen in the client or the sending application. Compare with 553, which says the address is well formed but not allowed.
Likely causes
- The application writes MAIL FROM or RCPT TO without angle brackets, with spaces, or with a display name such as "Jane <jane@example.com>".
- The client sends EHLO with no name, a name containing underscores, or an unbracketed IP address.
- An address contains non ASCII characters but the client did not use SMTPUTF8.
- An AUTH client sends a response that is not valid Base64, often due to a bad library or a stray newline.
How to fix it
- Find the line that drew the 501 in the client debug log: it tells you whether EHLO, MAIL FROM, RCPT TO, or AUTH was at fault.
- Send envelope addresses as `MAIL FROM:<user@example.com>` with no display name or extra spaces.
- Set EHLO to a fully qualified hostname that resolves, such as `mail.example.com`, or a bracketed literal like `[203.0.113.10]`.
- If the problem is AUTH, update the mail library or switch to another supported mechanism and retest.
Checks that apply
- Reverse DNS (PTR) Checks that your sending IP has a hostname you can use as a valid EHLO name instead of a bare or bogus one.
- SMTP Diagnostics Shows the server’s EHLO extensions so you know whether it supports SMTPUTF8 before you send non ASCII addresses.
- A Record Confirms the hostname you use in EHLO resolves to an address, which strict servers check alongside syntax.
FAQ
- Is a 501 the recipient’s fault?
- Almost never. It means the sending client formatted a command badly, so the sender or their application has to fix it.
- Why does my form mailer get 501 on MAIL FROM?
- It probably passes a full "Name <address>" string or an empty value as the envelope sender. Pass only the bare address in angle brackets.