Test SMTP AUTH using Telnet

Here is how to test SMTP authentication with telnet using terminal and openssl in Darwin or Linux:

  1. Get your user and password in base64 encoded strings (you need them in base64 because the server wants them to be like that)
    # echo 'myuser' | openssl base64
    # echo 'mypassword' | openssl base64
  2. Open a telnet conneciton susing port 25:
    # telnet myserver.domain.com 25
  3. Greet the server
    # EHLO myserver.domain.com
  4. Tell the server you want to authenticate
    # AUTH LOGIN
  5. The server now asks you in a base64 encoded string to enter user. Enter the encoded string you received for 'myuser' in point 1
  6. The server now asks you for the password, again in a base64 encoded string. Enter the encoded password received from point 1
  7. You should see a message now with authentication succeeded or authentication failed