5.5.1
SMTPERRORCommonProtocolHIGH confidence

Invalid command

Production Risk

Low — indicates a client implementation issue rather than a delivery problem.

What this means

The SMTP client issued a command that is not recognised by the receiving server. This is a protocol-level error indicating a client implementation bug or version mismatch.

Why it happens
  1. 1The client sent a command not in the server's supported command set.
  2. 2The client attempted to use an ESMTP extension command without verifying server support via EHLO.
  3. 3A software bug caused a malformed or unsupported command to be transmitted.
How to reproduce

An SMTP client sends an unrecognised or unsupported command during a session.

trigger — this will error
trigger — this will error
XUNKNOWNCMD arg
# Server returns:
500 5.5.1 Command unrecognized: "XUNKNOWNCMD"

expected output

500 5.5.1 ...

Fix

Check EHLO capabilities before using extended commands

WHEN Building or debugging an SMTP client

Check EHLO capabilities before using extended commands
# Always parse EHLO response to determine supported extensions:
EHLO client.example.com
250-mail.example.com
250-STARTTLS
250-AUTH LOGIN PLAIN
250 HELP
# Only use extensions listed in the EHLO response

Why this works

Negotiating capabilities via EHLO before using extended commands ensures compatibility with the server.

What not to do

✕ Ignore 5.5.1 errors and continue the session

An unrecognised command means the session state may be undefined; the client should handle the error and proceed correctly.

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