Computer Performance, Exchange 2003

 

Microsoft Exchange Server 2003 - SMTP Auth Login

Introduction to Microsoft Exchange Server 2003 - SMTP Auth Login

This page explains the precise Microsoft syntax that SMTP needs to login to an Exchange server 2003.  Here are SMTP commands that you can try in a telnet session at the cmd prompt.  The raw Windows SMTP commands include, Auth Login:, rcpt to: and data.

Topics for Exchange Server 2003 - SMTP Auth Login

0) Pre-requisite - Base64 encoder

1) Launch telnet from a cmd prompt

2) Type in one word: ehlo

3) Auth Login

4a) Encrypted username

4b) Encrypted password

5) Sending email

6) Summary

 ♠

Understanding the SMTP and Auth Login rationale

I am embarrassed at how long it took me to master the SMTP verb Auth Login.  Rather than pretending that Auth Login is easy, I am going to go slowly and give you even more instructions than usual.  My mission is to explain, in detail, how to send email from the command line.  We will open a telnet shell and connect to the Exchange server.  Once we receive the 250 OK reply code, we will issue the SMTP verbs to encode the password.

Before you go any further, ask your self, 'do I really need to authenticate?'  Could I just try sending email using the plain commands, mail from: and rcpt to:.  Another benefit of trying this simpler technique is that you will gain experience of the telnet and SMTP commands before you grapple with Auth Login and encoding. I recommend that you try the plain SMTP commands first.

0) Pre-requisite - Base64 encoder

It is essential that you have access to a base64 encoder.  Before you go any further you must be able to encode username and password.  For me, even this first step wasn't easy, foolishly, I searched in Google for a 64Bit encrypter instead of a base64 encoder.  So here are two important lessons, pay attention to detail, and this is where you can get a good base64 encoder: Opinionated.

1) Launch telnet from a cmd prompt

This part is easy. We are testing that the SMTP service is running on the Exchange 2003 server.  Here is your simple command to test the SMTP.  From the cmd prompt, type: Telnet server 25.  (Where 'server' is the HostName of your Exchange 2003 server.)


Telnet server 25
 


What you should see is this.


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


Learning Points

Guy Recommends: SolarWinds Engineer's Toolset v10Engineer's Toolset v10

The Engineer's Toolset v10 provides a comprehensive console of utilities for troubleshooting computer problems.  Guy says it helps me monitor what's occurring on the network, and the tools teaches me more about how the system literally operates.

There are so many good gadgets, it's like having free rein of a sweetshop. Thankfully the utilities are displayed logically: monitoring, discovery, diagnostic, and Cisco tools.  Download your copy of the Engineer's Toolset v 10

2) Type in one word: ehlo 

This is what should happen when you carefully type: ehlo, then press the Enter key for a carriage return.


220 ALAN.CP.com Microsoft ESMTP MAIL Service,
ehlo
250 ALAN.CP.com Hello [10.10.1.1]
more... verbs
250 OK
 


Learning Points

  • ESMTP uses ehlo as a greeting - to establish an initial connection.
  • SMTP uses helo instead of ehlo.
  • 250 - Means that the action which you requested, completed OK.  (Remember codes beginning with 2yz indicate success.
  • Note for simplicity, I have omitted the list of extra ESMTP verbs.

3) Auth Login

What we want to do is logon to our mailbox on the Exchange 2003 server.  The SMTP command for this job is: Auth Login.  Firstly, you must know your mailbox name and its email address.  Naturally, you must know the precise spelling and furthermore, this must be your email domain, not your Active Directory.  So, go to Active Directory Users and Computers, user properties, Email Address tab and double check the spelling of your email address.

Username (Mailbox name) = guyt

Email address = guyt@exchguy.com

Next type just two words: auth login.  Naturally, follow with Enter (carriage return).


220 ALAN.CP.com Microsoft ESMTP MAIL Service
ehlo
250 ALAN.CP.com Hello [10.10.1.1]
more... verbs
250 OK
auth login
334 VXNlcm5hbWU6
 


Learning Points

  • There are lots of chances to make a mistake, so start simply with just two words auth login.  No need for your username - yet.
  • I expect you spotted that the command uses login not logON.
  • Another surprise is the response: 334 VXNlcm5hbWU6.  All becomes clear when you realize that in base64, VXNlcm5hbWU6 decodes to Username:
  • Time to get your base64 encoder at the ready. dillfrog.com.

4a) Encrypted username

This is where you need to be precise.  Type your username in the encoder and then copy the encrypted result into memory (ctrl + c).  Now be careful, and right click in the cmd window and select Paste from the short cut menu.  For example, guyt encodes to: UGF1bGluZTE= so that is what I pasted.  (Because ctrl + v does not work in the cmd shell, you must use that short cut menu.)


220 ALAN.CP.com Microsoft ESMTP MAIL Service
ehlo
250 ALAN.CP.com Hello [10.10.1.1]
more... verbs
250 OK
auth login
334 VXNlcm5hbWU6
Z3V5dA==
334 UGFzc3dvcmQ6
 


Learning Points

  • If you get a second 334, but this time, 334 UGFzc3dvcmQ6, this is good news ,it means SMTP liked your username and now it wants your encoded password.
  • You are not going mad, UGFzc3dvcmQ6 is different from VXNlcm5hbWU6.
  • UGFzc3dvcmQ6 means Password:  Why not check with your base64 encoder / decoder?

4b) Encrypted password

All you need now is to encrypt your password with the base64 encoder.  Once you have the string, copy then paste the password into the SMTP prompt, just as you did with the username.  (Remember the short cut menu, do NOT use ctrl + c.)


220 ALAN.CP.com Microsoft ESMTP MAIL Service
ehlo
250 ALAN.CP.com Hello [10.10.1.1]
more... verbs
250 OK
auth login
334 VXNlcm5hbWU6
Z3V5dA==
334 UGFzc3dvcmQ6
UGaF1bGluZTEz
235 2.7.0 Authentication successful.
 


Learning Points

  • If you have got this far - well done.  The hard part is over, you have mastered 'auth login' and base64.
  • Unlike cmd, in SMTP you cannot use the doskey, the arrow keys just do not work.

 

Exchange Monitor from SolarWindsGuy Recommends: The SolarWinds Exchange Monitor

Here is a free tool to monitor your Exchange Server.  Download and install the utility, then inspect your mail queues, monitor the Exchange server's memory, confirm there is enough disk space and check the CPU utilization. This is the real deal - there is no catch.  SolarWinds provides this fully-functioning product for free, as part of their commitment to supporting the network management community.

Free Download of SolarWinds Exchange Monitor

5) Sending email

Let us finish as we started, by paying attention to detail.  There are now 3 key commands to master,
mail from:
rcpt to:
data
Note the colon after from: and to:.  Also when you have typed the message, in this example 'Please send cheque soonest', remember the full stop '.' or period as some call this key stroke.  To see what I mean, refer to the last but one line, it's not empty there is a dot 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
auth login
334 VXNlcm5hbWU6
Z3V5dA==
334 UGFzc3dvcmQ6
UGaF1bGluZTEz
235 2.7.0 Authentication successful.

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>
Please send cheque soonest
.
250 2.6.0 <AlanUNPPqlY2LukY4W00000001@Alan.ExchGuy.com> Queued mail for delivery
 


Learning Points

  • Note the colon: after mail from: and rcpt to:
  • Avoid this typing error, 'mail to:' is wrong.  What you mean is - 'mail from:'.
  • Once you type data, examine the response.  354 Start mail input, end with <CRLF>.<CRLF>.  SMTP is telling you to end with 2 carriage returns, but remember the full stop in between.
  • When you have finished your SMTP / Telnet session type quit, then quit again.

6 ) Summary of Auth Login  in Microsoft Exchange Server 2003

See Also

 

This section shows you how to connect to a Microsoft Exchange server using raw Microsoft SMTP commands.  In particular, it explains in detail how to master Auth Login.  The key to success is to obtain a base64 encoder for your username and password.  As ever, pay attention to detail with the SMTP syntax.


Download your Exchange 2003 Disaster Recovery and Troubleshooting eBook for only $9.95

Exchange 2003 Disaster Recovery and Troubleshooting EbookThe 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.  Printer friendly pages in both PDF and Word format.

 

 .


Google

Webcomputerperformance.co.uk

GFi Events Manager

Guy Recommends: GFi EventsManager

Let GFI EventsManager do the dirty work! Have event logs monitored automatically and get warned about critical events! Download a copy here

 

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

Please report a broken link, or an error.