Thursday, February 08, 2007

Testing POP over SSL the old way

In the old days it was common to test SMTP/POP servers using a simple telnet connection to the corresponding port (25/110) and interacting directly with the server via text commands. This was simple, clean and easy to do without need of configuring any mail clients just for testing.

These days any basic SMTP/POP server is configured with TLS or SSL to improve security. This is a necessity rather than a luxury these days as more commerce and business are dependent of Internet services like Mail.

For a time I thought that the old school of direct text interaction with these servers was impossible until I found the openssl command utility. From the man page it is easy to see that this openssl utility has several uses and one of them is. taken from the man page itself: SSL/TLS Client and Server Tests!!.

For example to connect to a POP3 server that uses SSL we call the following command:

openssl s_client -connect localhost:995

Make sure you replace localhost for the server address and if you use a different port (995) change it as well. This command will connect to the POP3 server and handle all the SSL stuff for you. You will see a lot of messages about certificates and SSL handshakes etc... if you are not interested in SSL simply ignore them.

After all the SSL stuff has passed you will be greeted by the POP3 server message (+OK Hello There for courier-pop) and then you can start interacting with the server as you would using telnet.

If you don't know how to interact with a POP server using text commands check my previous post about the topic.

1 comment:

  1. Anonymous7:01 AM

    Hey thanks, that was very helpful!

    ReplyDelete