5.5.2
SMTPERRORCommonProtocolHIGH confidence

Syntax error

Production Risk

Low — indicates a client implementation bug.

What this means

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.

Why it happens
  1. 1A command argument contained illegal characters or was malformed.
  2. 2The client sent binary data or non-ASCII characters where only ASCII is permitted.
  3. 3A line ending issue (e.g., bare LF instead of CRLF) caused the command to be misread.
How to reproduce

Sending an SMTP command with syntactically invalid arguments.

trigger — this will error
trigger — this will error
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

Ensure CRLF line endings and valid ASCII in commands
// Correct SMTP line ending (Node.js):
socket.write('MAIL FROM:<sender@example.com>
');
// NOT:
socket.write('MAIL FROM:<sender@example.com>
'); // bare LF — invalid

Why this works

RFC 5321 requires CRLF (\r\n) line endings. Using bare LF can cause syntax errors on strict servers.

What not to do

Use bare LF line endings in SMTP commands

RFC 5321 mandates CRLF. Servers may reject or misparse commands sent with bare LF.

Sources
Official documentation ↗

RFC 3463 — Enhanced Mail System Status Codes

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All SMTP errors