SMTP error 500 5.0.0 means the receiving server's parser could not recognise the command you just
sent as a valid SMTP verb at all. This is different from every other 5xx code in this series: a
550 or 553 means the server understood you and refused the request. A 500 means it never
got that far - the bytes it received did not resolve to HELO, MAIL FROM, RCPT TO, DATA, or
any other defined command.
Fault: sender, almost without exception. The server is not expressing an opinion about your
domain, your content, or your reputation. It is reporting that the thing you sent was not SMTP.
Why it happens
- A malformed command line. Missing or doubled
CRLFline endings, a command issued with no
trailing newline, or a line that exceeds the SMTP line-length limit before the terminator.
- A broken or outdated mail library. Hand-rolled SMTP clients and old PHP/Perl mail scripts are
the most common source - they build the command stream as a raw string and a single
off-by-one error produces garbage on the wire.
- SMTP pipelining sent to a server that did not advertise it. If your client assumes
PIPELINING support and sends several commands back-to-back without waiting for replies, and
the server never offered that extension in its EHLO response, the second command arrives
while the server is still mid-parse on the first and the stream desyncs.
- A transparent proxy or SMTP ALG (application-layer gateway) rewriting the stream. Some
consumer routers and older firewalls inspect and rewrite SMTP traffic on port 25, and the
rewrite logic breaks on commands it does not expect, corrupting the bytes before they reach the
server.
- Binary content leaking into the command phase. An attachment-encoding bug that writes raw
bytes before the DATA terminator is confirmed can produce a line the parser reads as a
command.
The transcript
$ swaks --to test@mailpilots.in --server mail.example.net
-> EHLO sender.example.com
<- 250-mail.example.net Hello sender.example.com
<- 250 PIPELINING
-> MAIL FROM:<sender@example.com>
<- 250 2.1.0 OK
-> RCPT TO:<test@mailpilots.in>
<- 250 2.1.5 OK
-> DATA
<- 354 Start mail input; end with <CRLF>.<CRLF>
-> Subject: Test
->
-> Hello{binary-garbage-byte-sequence}
-> .
<- 500 5.0.0 Error: bad syntaxThe failure is not in the envelope - MAIL FROM and RCPT TO were both accepted cleanly. It
happened once stray bytes landed inside what the server still parses as command-adjacent input.
How the big three word it
| Provider | Typical reply | Notes |
|---|---|---|
| Gmail / Google Workspace | 500 5.5.1 Unrecognized command | Google tends to pair the base 500 with a 5.5.1 enhanced code rather than 5.0.0. |
| Microsoft 365 / Exchange Online | 500 5.3.3 Unrecognized command | Exchange frequently returns 5.3.3 for malformed or unsupported commands - see the dedicated 500 5.3.3 piece for that variant. |
| Yahoo / AOL | 500 Syntax error, command unrecognized | Yahoo's inbound MTAs often omit the enhanced code entirely on this one. |
Diagnose it
$ swaks --to test@mailpilots.in --server mail.example.net --dry-run === Would send: EHLO sender.example.com MAIL FROM:<sender@example.com> RCPT TO:<test@mailpilots.in> DATA ...
swaks --dry-run prints exactly what your client would put on the wire without sending it, which
is the fastest way to spot a malformed command before it ever reaches a real server. Pair that
with tcpdump -i any -A port 25 on the sending host if the dry-run looks clean but the live
attempt still fails - a clean dry-run plus a dirty live capture means something between your
process and the network (a proxy, a library's actual socket write) is the real culprit.
The fix, in order
- Reproduce with `swaks` or raw `telnet`/`openssl s_client`, typing the commands manually.
If the manual session succeeds, the bug is in your library, not the server or the network.
- Check line endings. SMTP requires
CRLF(\r\n), not bare\n. Libraries built on
Unix-only tooling sometimes emit bare newlines.
- Disable pipelining in your client if the server's
EHLOresponse does not list
PIPELINING, and confirm the client is honouring that absence rather than assuming it.
- Bypass any transparent SMTP proxy. Test from a host with no firewall SMTP inspection
enabled; if that clears the error, the proxy is the cause and needs its SMTP ALG disabled.
- Update the mail library to its current release. Most SMTP command-construction bugs of
this kind were fixed years ago in actively maintained libraries.
- Send exactly one message after each change, reading the full transcript, rather than
retrying a batch and hoping.
What not to do
- Do not retry the identical malformed command on a timer. It will produce
500 5.0.0every
time; nothing about waiting changes a parser failure.
- Do not treat this as a reputation or content problem. Changing subject lines, sender
domains, or IPs will not touch a parser-level failure.
- Do not assume the server is broken. A
500from a major receiver after years of accepting
your mail almost always means something changed on your end - a library update, a new proxy, a
migrated sending host.
- Do not suppress the recipient. The failure happened before the envelope was fully
processed in some cases, and the recipient's address was never actually evaluated.
MailPilot's warm-up and monitoring both connect over standard SMTP/IMAP or OAuth using
well-maintained client libraries, so a 500 5.0.0 on a monitored mailbox is a strong signal that
the problem is outside MailPilot - typically a proxy or firewall sitting between the sending host
and the receiving MTA - rather than something to chase in content or reputation.
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