SMTP Error 502 - Command not implemented. | Warmup Inbox

The short answer

SMTP 502 is a permanent reply meaning "command not implemented": the server recognized the command but does not support it or has disabled it. It commonly hits VRFY, EXPN, ETRN, HELP, or an AUTH mechanism an admin turned off. Remove or replace the unsupported command in your client, or use a relay that implements it.

Quick fix

Check your client config or the server’s advertised capabilities.

5 - Permanent. The server will not try again. Fix the cause before you resend.

What it means

502 is a permanent failure defined in RFC 5321 as "Command not implemented." The leading 5 makes it permanent (retrying the same command fails again) and the middle 0 places it in the syntax and unimplemented-command group. The server parsed your command fine; it just does not offer it, either because it was never implemented or an admin disabled it. It often comes with the enhanced code 5.5.1.

Common causes

VRFY (verify address) and EXPN (expand list) are commonly turned off to prevent address harvesting; RFC 5321 says a server that will not do the work should answer 502. HELP and ETRN are also frequently disabled.

If your client issues AUTH LOGIN or AUTH PLAIN and the relay never advertised AUTH in its EHLO response (or only supports another mechanism like XOAUTH2), you get a 502.

Hosted relays accept the commands needed to submit mail and reject extras.

A script or client emitting a command the modern server no longer implements.

How to fix it

  1. Read the full response line and log
    It names the command that was refused (for example "502 5.5.1 VRFY command is disabled"). That command is the whole problem.

  2. Reproduce the dialogue manually
    Connect and issue EHLO. The 250- lines list exactly which extensions the server advertises. If your command is not there, it is not implemented.

    openssl s_client -starttls smtp -connect smtp.example.com:587
    
  3. Remove or replace the unsupported command
    For VRFY and EXPN, stop calling them; they are optional and routinely disabled. For AUTH, use a mechanism the server advertised: for Gmail that means an App Password (with 2-Step Verification) or OAuth2.

  4. Update an old SMTP library
    If your client emits a legacy command, upgrade it.

  5. If you control the server
    Enable the command in your MTA config (for example Postfix disable_vrfy_command = no), but leave VRFY and EXPN off if they were disabled for anti-harvesting reasons.

Common questions