Computer Performance, Exchange 2003

 

Microsoft Exchange Server 2003  - SMTP Raw Commands

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.

Topics for Microsoft Exchange 2003 SMTP Commands

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

  • Telnet is a command to open up a shell.
  • For 'server' substitute the name of your Exchange 2003 computer.  My server is called Alan.
  • 25 is the port number for SMTP  (Telnet itself uses port 23).

 

This is what you should see in the cmd box:


220 ALAN.CP.com Microsoft ESMTP MAIL Service, ......
 


Learning Points

  • 220 - This return code (220) indicates success.
  • 2yz - Means the SMTP command completed OK.
  • x2z - Means connected.
  • ALAN.CP.com  - Is the fully qualified name of the server.
  • Microsoft ESMTP MAIL Service - Tells you this mail server understands Extended SMTP.


TrainSignal - Guy's recommended training videos for Exchange 2003Exchange Server 2007 is a complex topic, do you need practical hands on training?  As an MCT trainer, I can thoroughly recommend TrainSignal.  In particular, I like the way that TrainSignal cover all learning methods, instructor lead, video and of course text material.  You can either take one module, for example Exchange 2007 or go for a combination of modules.  Learn more about Microsoft Exchange Server 2007 here


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 ALAN.CP.com Microsoft ESMTP MAIL Service,
ehlo
250 ALAN.CP.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

  • ESMTP uses ehlo as a greeting.  It's just a way of establishing an initial connection.
  • SMTP uses helo instead of ehlo, this is the older form of the SMTP language.
  • 250 - Means the action which you requested, completed OK.  (Remember codes beginning with 2yz indicate success.

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 ALAN.CP.com Microsoft ESMTP MAIL Service
ehlo
250 ALAN.CP.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@cp.com
250 2.1.5 administrator@cp.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

  • Note the colon: after mail from: and rcpt to:.
  • Once you type data, examine the server's response:
    354 Start mail input, end with <CRLF>.<CRLF>.  SMTP tells you to end with 2 carriage returns with a full stop in between.
  • I confess.  I have an aversion to 'Test', so chose 'Where are you server?' as the data.
  • Unlike cmd, with SMTP commands you cannot use doskey. (The arrow keys just do not work.)
  • Don't be put off by lots of 5yz error messages, just try again.
  • When you have finished your SMTP / Telnet session type quit twice, once to end the SMTP session and then once again to end telnet.
  • If you need to authenticate to the Exchange 2003 server then here is how to use Auth Login

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>

See here for NDR and related codes.

Note: it would be unlikely if you got all these errors in one bunch!

.

SMTP Raw Commands Summary

Knowledge of how to issue raw SMTP commands is handy to troubleshoot email problems in general, and Exchange 2003 server in particular.  The key to success is to open a telnet shell then practice SMTP commands such as, ehlo, mail from: and rcpt to:.

See Also

 


Download your Exchange 2003 Migration eBook for only $6.25

The extra features you get in your eBook include:  'How to...' sections with screen shots.  Checklists to prepare your migration plan.

Lots of tips, recommendations and troubleshooting advice.  Problem solving section.  The role of Active Directory explained.  Printer friendly pages.

 

 .


Google

Webcomputerperformance.co.uk

GFi Events Manager

Guy Recommends: GFi EventsManager

Here is a solution to monitor, manage and archive thousands of events that are generated by devices across your entire network.  Get your free evaluation copy of GFI EventsManager.

 

Home Copyright © 1999-2008 Computer Performance LTD All rights reserved

Please report a broken link, or an error.