Sep 19, 2018

Test SMTP AUTH using Telnet

telnet mailserver.com 25
Greet the mail server:

EHLO mailserver.com
Tell the server 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, example:

dXNlcm5hbWUuY29t
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, example:

bXlwYXNzd29yZA==

See also:
$ telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mail.i88.ca ESMTP service ready
EHLO dbbig.com
250-mail.i88.ca 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
ZGV2
334 UGFzc3dvcmQ6
bXlwYXNzd29yZA==
235 2.7.0 authentication succeeded
MAIL FROM: [email protected]
250 2.1.0 MAIL ok
250 2.1.5 <[email protected]> ok
DATA
354 send message
From: "John Smith" <[email protected]>
To: "Jane Doe" <[email protected]>
Subject: test message sent from manual telnet session        
test
.
250 2.6.0 message received
quit
221 2.0.0 mail.i88.ca says goodbye
Connection closed by foreign host.