Often, telnet is used to test a server listing on a TCP port because if telnet can connect, then you know the server is listening. With simple text protocols like POP, you can do pretty extensive testing with telnet by just typing in commands. Testing a server that supports SSL can be done with the stunnel program. You need to download the pem file with the key and certificate, but after that, it isn’t much different than using telnet.
terry@m38:~$stunnel -c -r www.jeeptech.com:995 -p pop3.pem
+OK Hello there.
user terry
+OK Password required.
pass cleartextPasswd
+OK logged in.
list
+OK POP3 clients that break here, they violate STD53.
1 3721
2 5873
3 1020
4 15425
5 1955
6 8598
7 18708
.
quit
+OK Bye-bye.
terry@m38:~$
The order of contents of the .pem file is, it should contain the unencrypted private key first, then a signed certificate. There should be empty lines after the certificate and private key. Any plaintext certificate information appended on the top of generated certificate should be discarded.
—–BEGIN RSA PRIVATE KEY—–
[encoded key]
—–END RSA PRIVATE KEY—–
[empty line]
—–BEGIN CERTIFICATE—–
[encoded certificate]
—–END CERTIFICATE—–
[empty line]