Enhanced Status Code 5.5.2: Syntax Error
Enhanced Status Code 5.5.2 means “Syntax Error.” The server received a command it could not parse. Usually a malformed address, a stray character, or a line that broke the encoding the protocol expects.
501 5.5.2 Syntax error, cannot decode response
What does 5.5.2 mean?
Enhanced status code 5.5.2 means a syntax error. RFC 3463 defines it as a mail transaction protocol command that could not be interpreted. Where 5.5.1 means the command was understood but was wrong or unsupported, 5.5.2 means the server could not make sense of the characters at all.
Google returns it as 501 5.5.2 when it cannot decode a response, and as 555 5.5.2 for a syntax error that may close the connection. Malformed addresses are the usual trigger: an address with unquoted spaces, unbalanced angle brackets, a trailing comma from a badly joined recipient list, or a non-ASCII character in a context that has not negotiated SMTPUTF8. Bare line feeds instead of proper carriage-return line-feed pairs are the other classic, and they are invisible in most editors.
Because the fault is in the bytes rather than the intent, this is a code you can usually reproduce and fix quickly once you can see the raw session. It is also one that appears suddenly in systems that were fine for years, when a new data source starts supplying addresses that were never validated.
How 5.5.2 plays out
5.5.2 rejectionWhere 5.5.2 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.2 is | ✓ this code |
Common causes of 5.5.2
- A recipient or sender address is malformed, with stray spaces, commas or brackets
- Line endings use bare line feeds instead of carriage return followed by line feed
- A non-ASCII character appears in a command without SMTPUTF8 being negotiated
- A header value contains a control character or an unencoded newline
- An address was concatenated incorrectly when building a recipient list
- A command line exceeded the length the server accepts
How to fix 5.5.2
- Validate and normalise every address before it reaches the SMTP conversation
- Ensure all protocol lines terminate with carriage return followed by line feed
- Encode non-ASCII header content properly, or negotiate SMTPUTF8 where supported
- Strip control characters from any value that is interpolated into a header
- Log the raw session bytes, since the offending characters are usually invisible in a log viewer
- Check any newly added data source, since unvalidated imported addresses are a common trigger