Using SMTP Commands to Troubleshoot and Test SMTP Servers
Before diving into specific software-configuration tips, here’s a technique that can be used to troubleshoot or test any SMTP server: manual mail delivery. Normally, end users don’t use SMTP commands because end users generally don’t transfer their email manually. That’s the job of MUAs, MDAs, and MTAs.
But it so happens that SMTP is a simple ASCII-based protocol built on
TCP, and it’s therefore possible to use SMTP
commands to interact directly with an email server by
telneting to TCP port 25 on that server. This is
a useful technique for checking and troubleshooting MTA
configurations. All you need is a telnet
client and a working knowledge of a
few of the commands in RFC 2821.
Here’s an example session:
$telnet buford.hackenbush.com 25Trying 10.16.17.123... Connected to buford.hackenbush.com. Escape character is '^]'. 220 buford.hackenbush.com ESMTP Postfixhelo woofgang.dogpeople.org250 buford.hackenbush.orgmail from:<mick@dogpeople.org>250 Okrcpt to:<groucho@hackenbush.com>250 Okdata354 End data with <CR><LF>.<CR><LF>Subject: Test email from MickTesting, testing, 1-2-3....250 Ok: queued as F28B08603quit221 Bye Connection closed by foreign host.
Let’s dissect the example, one command at a time:
-
helo woofgang.dogpeople.org The
HELOcommand (SMTP commands are case insensitive) provides the remote server with your hostname or domain name.-
mail from:<mick@dogpeople.org> The
MAILcommand is used to specify your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access