SMTP Login Exchange: Steps 4 to 6

Using Auth Login to Troubleshoot Exchange
By Guy Thomas October 24, 2011 7:00 PM
Table Of Contents
  • 3. SMTP Login Exchange: Steps 4 to 6
3. SMTP Login Exchange: Steps 4 to 6

The last three steps in our tutorial outlining the Microsoft syntax SMTP requires to log into Exchange server 2010: Encryption, Sending Email and Summary.

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 guy.cp.com Microsoft ESMTP MAIL Service
ehlo
250 guy.cp.com Hello [10.2.1.10]
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 guy.cp.com Microsoft ESMTP MAIL Service
ehlo
250 guy.cp.com Hello [10.2.1.10]
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.


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 guy.cp.com Microsoft ESMTP MAIL Service
ehlo
250 guy.cp.com Hello [10.2.1.10]
more... verbs
250 OK
auth login
334 VXNlcm5hbWU6
Z3V5dA==
334 UGFzc3dvcmQ6
UGaF1bGluZTEz
235 2.7.0 Authentication successful.

mail from: guy@cp.com
250 2.1.0 guy@cp.com....Sender OK
rcpt to: administrator@cp.com
250 2.1.5 administrator@cp.com
data
354 Start mail input; end with .
Please send cheque soonest
.
250 2.6.0 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 ..  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 SMTP Auth Login in Exchange Server 2010

I was surprised at how long it took me to understand the SMTP Auth Login command.  Begin by opening a telnet shell and then connect to your Exchange server.  Once you receive the 250 OK reply code, then issue the SMTP commands to encode the password. Naturally, it is essential that you obtain a base64 encoder because you must be able to encode username and password.

Comment on this article
Comments