1. Use Perl to get base64 encoding of your username and password:
1 2 | 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:
1 | telnet mailserver.com 25 |
3. Greet the mail server:
1 | EHLO mailserver.com |
4. Tell the server you want to authenticate with it:
1 | AUTH LOGIN |
5. Enter the base64 encoded Username string:
1 | dXNlcm5hbWU= |
6. Enter the base64 encoded Password string:
1 | 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:
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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 |