How to Test Mail Server SMTP AUTH using Telnet

1. Use Perl to get base64 encoding of your username and password:

perl -MMIME::Base64 -e 'print encode_base64("username");'
perl -MMIME::Base64 -e 'print encode_base64("password");'

2. Use Telnet to connect to the mail server:

telnet mailserver.com 25

3. Greet the mail server:

EHLO mailserver.com

4. Tell the server you want to authenticate with it:

AUTH LOGIN

5. Enter the base64 encoded Username string:

dXNlcm5hbWU=

6. Enter the base64 encoded Password string:

cGFzc3dvcmQ=

Now you should have received a message telling you “Authentication succeeded”.

Below is a log of a real successful SMTP AUTH connection over Telnet:

user@localhost [~]# telnet testsmtpdomain.com 25
Trying 1.1.1.1...
Connected to testsmtpdomain.com.
Escape character is '^]'.
220-mail.testsmtpdomain.com ESMTP service ready
EHLO testsmtpdomain.com
250-mail.testsmtpdomain.com says hello
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250-8BITMIME
250-AUTH CRAM-MD5 PLAIN LOGIN
250-AUTH=CRAM-MD5 PLAIN LOGIN
250-XACK
250-SIZE 0
250-VERP
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
dXNlcm5hbWU=
334 UGFzc3dvcmQ6
cGFzc3dvcmQ=
235 2.7.0 authentication succeeded