Syntax error
Production Risk
Low — indicates a client implementation bug.
The SMTP server received a command with a syntax error. The command was recognised but its format or arguments were invalid according to the SMTP protocol specification.
- 1A command argument contained illegal characters or was malformed.
- 2The client sent binary data or non-ASCII characters where only ASCII is permitted.
- 3A line ending issue (e.g., bare LF instead of CRLF) caused the command to be misread.
Sending an SMTP command with syntactically invalid arguments.
MAIL FROM: bad syntax here # Server returns: 501 5.5.2 Syntax error in parameters or arguments
expected output
501 5.5.2 ...
Fix
Ensure CRLF line endings and valid ASCII in commands
WHEN Building or debugging an SMTP client
// Correct SMTP line ending (Node.js):
socket.write('MAIL FROM:<sender@example.com>
');
// NOT:
socket.write('MAIL FROM:<sender@example.com>
'); // bare LF — invalidWhy this works
RFC 5321 requires CRLF (\r\n) line endings. Using bare LF can cause syntax errors on strict servers.
✕ Use bare LF line endings in SMTP commands
RFC 5321 mandates CRLF. Servers may reject or misparse commands sent with bare LF.
RFC 3463 — Enhanced Mail System Status Codes
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev