Testing SMTP AUTH connections

After setup smtp authentication (SMTP AUTH), we should test before let server go life. Here are some command to proof your work.

Input your authentication information

All AUTH information input must be base64-encoded, so you need perl MIME::Base64 to encode your user/pass into one encoded string as following:-

$ perl -MMIME::Base64 -e 'print encode_base64("\000test\@myserver.com\000the.password.is.fake")'
AHRlc3RAbXlzZXJ2ZXIuY29tAHRoZS5wYXNzd29yZC5pcy5mYWtl

\000 is a separator between userid and password, so we put in first place of both information. If your userid is an email address (same as my sample), you’ll need a blackslash (\) for “@”, because perl silently interprets the “@” sign in the middle of a string and replaces it with the contents of an array with that name, if exists… or with nothing, if not.

Depends on server configuration, you may need to use SSL or TLS before you are able to use the AUTH command. In fact, if you are able to use the AUTH command without using either SSL or TLS, you are in fact sending your userid and password over the internet in clear text.

For normal connection, you may simply connect to port 25 Continue reading