Tips on Testing SMTP on Port 25 and 465

Written by James McDonald

December 3, 2017

When testing your login using AUTH PLAIN if your passwords starts with a number you need to use a \000 instead of \0 other wise you will always get an error as the base64 encoded string will be wrong

printf 'username\0username\0001234567pwd' | mmencode

perl -MMIME::Base64 -e 'print encode_base64("username\0username\0001234567pwd");'

more information here

To test SMTP port 25 and SSL/TLS use -starttls smtp

openssl s_client -starttls smtp -crlf -connect

To test port 465 which is immediate SSL/TLS don’t use -starttls

use openssl without -starttls

openssl s_client -crlf -connect

Do use testsaslauthd for check if it’s working. If you are using postfix with chroot enabled you have to specify the path to the unix socket.

testsaslauthd -f /var/spool/postfix/var/run/saslauthd/mux -u username -p password
0: OK "Success."


Submit a Comment

Your email address will not be published.

You May Also Like…


Zebra Printer Language The above website has a page where you can enter ZPL and it...

PHP Iterators

Just came across a Youtube talk "Iterators in PHP" by Jake Smith published in 2014 that steps through the many...

PHP array_map Multiple Arrays

array_map can take multiple arrays. I like how it starts mapping through them starting at the first element of each...