How to Test SMTP Auth using Telnet

Below are the instructions on how to test SMTP Auth using telnet:

  • The first thing you need to do is get username and password in base64 encoding. Check this link for reference.
  • Once you get base64 encoded username and passwords, now you need to connect to the mail server using telnet.

  telnet mailserver.com 25

  • Now after you get connected, greet the mail server.

EHLO mailserver.com

  • Now, we need to let the server know that you want to authenticate with it:

AUTH LOGIN

  • The server should have returned 334 VXNlcm5hbWU6; this is a base64 encoded string asking you for your username, paste the base64 encoded username you created earlier.
  • Now the server should have returned 334 UGFzc3dvcmQ6; Again this is a base64 encoded string now asking for your password, paste the base64 encoded password you created.
  • Now you should have received a message telling you that you successfully authenticated. If it failed your user/pass may have been wrong or your mail server is broken.

Below is a log of successful SMTP AUTH connection over telnet:

 

[email protected] [~]# telnet exampledomain.com 25
Trying 1.1.1.1...
Connected to exampledomain.com (1.1.1.1).
Escape character is '^]'.
220-server1.exampledomain.com ESMTP Exim 4.66 #1 Wed, 09 May 2007 23:55:12 +0200
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
EHLO exampledomain.com
250-server1.exampledomain.com Hello  [1.1.1.2]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
dXNlcm5hbWUuY29t
334 UGFzc3dvcmQ6
bXlwYXNzd29yZA==
235 Authentication succeeded
Thanks for dropping by!! Feel free to comment to this post or you can also drop me an email at [email protected]