Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
mail:test-smtp-auth-telnet [2009-10-15 22:01:26]
garrett.plasky
mail:test-smtp-auth-telnet [2011-07-01 19:06:18]
garrett.plasky Approved
Line 4: Line 4:
 The first thing you need to do is get a base64 encoding of your username and password. There are a couple ways to do this, the example below uses Perl: The first thing you need to do is get a base64 encoding of your username and password. There are a couple ways to do this, the example below uses Perl:
  
-<code console>perl -MMIME::Base64 -e 'print encode_base64("username");' +<sxh shell>perl -MMIME::Base64 -e 'print encode_base64("username");' 
-# perl -MMIME::Base64 -e 'print encode_base64("password");'</code>+# perl -MMIME::Base64 -e 'print encode_base64("password");'</sxh>
  
 What will be returned from each command is a base64 encoding of the username and password; save these as you will need them later. Now connect to the mail server using Telnet: What will be returned from each command is a base64 encoding of the username and password; save these as you will need them later. Now connect to the mail server using Telnet:
  
-<code console>telnet mailserver.com 25</code>+<sxh shell>telnet mailserver.com 25</sxh>
  
 Greet the mail server: Greet the mail server:
  
-<code console>EHLO mailserver.com</code>+<sxh shell>EHLO mailserver.com</sxh>
  
 Tell the server you want to authenticate with it: Tell the server you want to authenticate with it:
  
-<code console>AUTH LOGIN</code>+<sxh shell>AUTH LOGIN</sxh>
  
 The server should have returned <c>334 VXNlcm5hbWU6;</c> this is a base64 encoded string asking you for your username, paste the base64 encoded username you created earlier, example: The server should have returned <c>334 VXNlcm5hbWU6;</c> this is a base64 encoded string asking you for your username, paste the base64 encoded username you created earlier, example:
  
  
-<q>dXNlcm5hbWUuY29t</q>+<sxh plain>dXNlcm5hbWUuY29t</sxh>
  
 Now the server should have returned <c>334 UGFzc3dvcmQ6;</c>. Again this is a base64 encoded string now asking for your password, paste the base64 encoded password you created, example: Now the server should have returned <c>334 UGFzc3dvcmQ6;</c>. Again this is a base64 encoded string now asking for your password, paste the base64 encoded password you created, example:
  
  
-<q>bXlwYXNzd29yZA==</q>+<sxh plain>bXlwYXNzd29yZA==</sxh>
  
 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  mailserver is broken.  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  mailserver is broken. 
Line 33: Line 33:
 Below is a log of a real successful SMTP AUTH connection over Telnet: Below is a log of a real successful SMTP AUTH connection over Telnet:
  
-<code console>user@localhost [~]# telnet exampledomain.com 25+<sxh shell>user@localhost [~]# telnet exampledomain.com 25
 Trying 1.1.1.1... Trying 1.1.1.1...
 Connected to exampledomain.com (1.1.1.1). Connected to exampledomain.com (1.1.1.1).
Line 53: Line 53:
 bXlwYXNzd29yZA== bXlwYXNzd29yZA==
  
-235 Authentication succeeded</code>+235 Authentication succeeded</sxh>
  
 {{tag>how-to smtp}} {{tag>how-to smtp}}