My activities New request

contact atmail support

PH: +61 (7) 5357-6605

support@atmail.com

Follow

Testing SMTP AUTH using telnet

Stewart -

PROBLEM

I need to test if SMTP AUTH is working.

ENVIRONMENT

  • On-Premise Server + WebMail Installations: Version 6.0 > Current Version

CAUSE

Sometimes you need to test SMTP Authentication is working on your server, and you may not have Outlook or another email client handy to test the connection.

You can verify SMTP authentication is working by using telnet and accessing the SMTP server directly. Below is a quick tutorial on how to test your server with Atmail for SMTP authentication details.

RESOLUTION

  1. First, make sure SMTP authentication is enabled via the Atmail Webadmin > Services > SMTP Settings > SMTP Authentication = On
  2. Next, create or verify an existing username and password on the system
  3. Build the Base64 username/password
    SMTP AUTH LOGIN will encapsulate the username and password as a Base64 string. This is used to prevent sending the username/password plaintext via the network connection. Using Perl, you can issue the following command to encode the username and password as a base64 string, which can be sent to the SMTP server. Note the @ symbol is escaped to pass the string via Perl.
    # perl -MMIME::Base64 -e 'print encode_base64("myusername\@domain.com")'
    bXl1c2VybmFtZUBkb21haW4uY29t
    # perl -MMIME::Base64 -e 'print encode_base64("weakpass")'
    d2Vha3Bhc3M=
  4. Access the local system. Commands we issue are highlighted in bold.
    # telnet localhost 25
    Trying 127.0.0.1...
    Connected to localhost.localdomain (127.0.0.1).
    Escape character is '^]'.
    220 mydomain.com Welcome to the @Mail SMTP Server ( Exim )
    ehlo test.com
    250-mydomain.com localhost [127.0.0.1]
    250-SIZE 52428800
    250-PIPELINING
    250-AUTH LOGIN
    250-STARTTLS
    250 HELP>
    The above command will verfiy AUTH LOGIN is enabled on the server. Next, send the following command to start the SMTP Authentication process.
    AUTH LOGIN
    334 VXNlcm5hbWU6 ( Server returns username as a base64 string )
    bXl1c2VybmFtZUBkb21haW4uY29t
    334 UGFzc3dvcmQ6 ( Server returns password as a base64 string )
    d2Vha3Bhc3M=
    235 Authentication succeeded
  5. Congratulations, SMTP authentication is now enabled and confirmed working on your server. Note you must send the Base64 string of the username and password as two commands.
Have more questions? Submit a request

Comments