SMTP error 502, appearing with no enhanced status code attached at all - just "502 Command not
implemented" with no 5.5.1 or similar X.Y.Z suffix - is the signature of an older or minimal
mail system that predates or never implemented RFC 3463 enhanced status codes. Most modern SMTP
servers (Postfix, Exchange Online, Gmail) pair every base reply with an enhanced code; a bare
502 with nothing else attached usually means legacy IIS SMTP, an old mainframe-adjacent relay,
or a minimal embedded mail stack on networking hardware.
Fault: sender, usually. The server genuinely does not implement the command or extension you
sent, and no amount of retrying changes that - you need to stop sending it.
Why it happens
- Your client negotiated or assumed an ESMTP extension the server never advertised.
PIPELINING, 8BITMIME, SIZE, SMTPUTF8, and similar extensions are optional; a client that
assumes universal support and sends extension-specific syntax to a server that only implements
base SMTP gets a flat "not implemented."
- The destination is running legacy Windows/IIS SMTP or an embedded SMTP relay inside network
hardware (some older firewalls, print servers, and monitoring appliances include a minimal
SMTP client/server for alert emails) - these commonly implement only the original SMTP verb set
with no enhanced status support.
- A command was sent with internationalised (UTF-8) addressing to a server that does not
support SMTPUTF8, which is still not universally implemented outside major providers.
- An old version of a widely used MTA that predates the enhanced-status-code convention
entirely, still in production on infrastructure that has not been upgraded.
The transcript
$ swaks --to test@mailpilots.in --server legacy-relay.example.net -> EHLO sender.example.com <- 250-legacy-relay.example.net <- 250 SIZE 10485760 -> MAIL FROM:<sender@yourdomain.com> SMTPUTF8 <- 502 Command not implemented
The server's EHLO response advertised only SIZE - no SMTPUTF8, no PIPELINING. The client
requested an extension that was never on offer, and the bare 502 with no enhanced code is
exactly what a minimal implementation returns for "I don't recognise that parameter."
How the big three word it
| Provider | Typical reply | Notes |
|---|---|---|
| Gmail / Google Workspace | 502 5.5.1 Unrecognized command or 502 5.5.2 Command not implemented | Google always attaches an enhanced code - a genuinely bare 502 from Google is effectively never seen. |
| Microsoft 365 / Exchange Online | 502 5.5.1 Command not implemented | Likewise always enhanced-coded on modern Exchange Online. |
| Legacy/embedded relays (old IIS SMTP, appliance mail stacks) | 502 Command not implemented | The genuinely bare form - no enhanced code, often no further text at all. |
Diagnose it
$ swaks --to test@mailpilots.in --server legacy-relay.example.net --quit-after EHLO -> EHLO sender.example.com <- 250-legacy-relay.example.net <- 250 SIZE 10485760
The EHLO response is the complete list of what the server actually supports. Anything your
client sends beyond that list will fail - this one command confirms what is and is not on offer
before you change any client configuration.
The fix, in order
- **Read the
EHLOresponse and disable any extension your client assumes but the server did
not advertise** - most mail libraries have an explicit setting to force base-SMTP-only mode.
- Drop `SMTPUTF8` for destinations that do not advertise it, converting addresses to
ASCII-compatible encoding (Punycode for domains) before sending if internationalised addressing
is involved.
- Confirm the actual software and version on the receiving end if you administer or can
query it - many legacy appliance mail stacks have no update path and simply need to be worked
around rather than fixed.
- Fall back to the most conservative, universally supported command set (
HELOinstead of
EHLO, no extension parameters) specifically for destinations known to be legacy systems.
- Flag the destination as "legacy, base SMTP only" in your own sending configuration so
future sends to it do not repeat the same negotiation failure.
What not to do
- Do not assume a missing enhanced code means a parsing bug on your own side. Many
legitimate, if old, mail systems simply never implemented RFC 3463 and this is expected
behaviour from them.
- Do not keep sending the same unsupported extension hoping a retry works. The server's
capabilities will not change between attempts.
- Do not force every destination into base-SMTP-only mode globally just because one legacy
relay needs it - that needlessly disables useful extensions for every other destination that
does support them.
- Do not treat this as a content or reputation problem. It is a protocol-capability mismatch,
resolved entirely by matching what you send to what the EHLO response actually lists.
MailPilot negotiates capabilities per destination from each server's own EHLO response rather
than assuming a fixed extension set, so sending to an older or minimal relay does not produce
this class of failure on connections it manages.
Ready to reach the inbox every time?
Automated email warmup across real peer mailboxes. Live inbox placement monitoring. Free 7-day trial - no credit card required.
Start free trial