dboettger's Blog

Test SMTP authentication with telnet

Posted on: June 23, 2010

If you want to test your SMTP authentication in postfix or any other MTA via commandline / telnet. You can create a BASE64 encoded passwordstring like that:

perl -MMIME::Base64 -e ‘print encode_base64(“00USERNAME00password“)’

Copy the base64.

Open a telnet console to your MTA like that:

telnet localhost 25

After you are connected send a ehlo message to the MTA.

ehlo server

The MTA should answer with something like that:


250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

These lines are important:


250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN

Then you can enter:


AUTH PLAIN BASE64String

The MTA should reply with:

235 2.7.0 Authentication successful

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Tweets

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Advertisements
%d bloggers like this: