SMTP Command Line - Testing

Introduction to Exchange Server 2003 SMTP Raw Commands

 

This page explains the raw SMTP commands that you can execute to troubleshoot email on an Microsoft Exchange 2003 server.  Instead of sending email from Outlook, we will create a telnet shell and then type these SMTP commands, ehlo, Mail from: rcpt to: and data.

 

Launch telnet from a cmd prompt

 

Let us begin troubleshooting with an easy command.  Suppose we wish to test that the SMTP service is running on an Exchange 2003 server.  What we need is a telnet shell, so let us launch a cmd box and then type: Telnet server 25.  Naturally, follow through by pressing the Enter key for the carriage return.

 

 

Telnet server 25
 

 

Learning Points

 

 

This is what you should see in the cmd box:

 

 

220 MAIL.ASUPPORT.com Microsoft ESMTP MAIL Service, ......

 

 

Learning Points

 

 

Type in one word: ehlo  

 

This is what should what you should see when you type ehlo.  (Remember to follow up ehlo by pressing the Enter key.)

 

 

220 MAIL.ASUPPORT.com Microsoft ESMTP MAIL Service,

ehlo

250 MAIL.ASUPPORT.com Hello [10.10.1.1]

250-TURN

250-SIZE

250-ETRN

250-PIPELINING

250-DSN

250-ENHANCEDSTATUSCODES

250-8bitmime

250-BINARYMIME

250-CHUNKING

250-VRFY

250-X-EXPS GSSAPI NTLM LOGIN

250-X-EXPS=LOGIN

250-AUTH GSSAPI NTLM LOGIN

250-AUTH=LOGIN

250-X-LINK2STATE

250-XEXCH50

250 OK

 

 

SMTP Learning Points for Raw Commands

 

 

Sending email

 

Let us finish as we started, by paying attention to detail.  Here are 3 vital SMTP commands to master when you troubleshoot,

mail from:

rcpt to:

data

 

Note the colon after both from: and to:.  Also after you type the data, in this example, 'Where are you server?', remember to type a full stop '.' or period as some call this key stroke.  Please note that the last but one line is not empty, can you see a '.' representing a full stop?

 

 

220 MAIL.ASUPPORT.com Microsoft ESMTP MAIL Service

ehlo

250 MAIL.ASUPPORT.com Hello [10.10.1.1]

More verbs....

250 OK

mail from: guyt@exchguy.com

250 2.1.0 guyt@exchguy.com....Sender OK

rcpt to: administrator@asupport.com

250 2.1.5 administrator@asupport.com

data

354 Start mail input; end with <CRLF>.<CRLF>

Where are you server?

.

250 2.6.0 <AlanUNPPqlY2LukY4W00000001@Alan.ExchGuy.com> Queued mail for delivery

 

Learning Points

 

 

Troubleshooting Ideas

 

Now that you have mastered the SMTP command basics, here are ideas for how and why you would use these raw SMTP commands.  For instance, raw SMTP commands are useful to troubleshoot relaying.  If you try to send an email to recipient address outside your organization, then the reply will tell you whether or not that email is relayed.  For example, the response maybe: 550 5.7.1  Unable to relay.  Whereas if you can relay, then you would get the response of,  250 2.1.5.

If you're trying to solve the cause of NDRs, try emailing users at different Exchange 2003 servers, the raw command would be similar to,  rcpt to: diffuser@ somewherelse.net

 

SMTP error codes

 

As I hinted at the beginning, I found this raw SMTP technique difficult and had my fair share of these error codes.  Most of my troubleshooting problems began with 5yz indicating a fatal error with that SMTP command.

 

421 - <service not available, closing channel> (domain)

451 - <req. action aborted: local error in processing>

452 - <req. action not taken: insufficient system storage>

500 - <syntax error, command unrecognized>

501 - <syntax error in arguments> ()

502 - <command not implemented>

550 - <req. action not taken: mailbox unavailable>

551 - <user not local; please try <forward-path>>

552 - <req. mail action aborted: exceeded storage allocation>

554 - <transaction failed>