http://www.linuxplanet.com/linuxplanet/tutorials/7296/1
Testing Linux Mail Servers with OpenSSLTesting POP3 TLS/SSLFebruary 15, 2011 Yesterday Juliet Kemp showed us how to perform basic server tests with telnet. Today Carla Schroder shows how to test TLS/SSL-enabled POP3 and IMAP servers. This is a followup to Juliet Kemp's excellent Troubleshooting Linux Servers with telnet article. This is adapted from my aging but still-excellent Linux Cookbook. Testing POP3 TLS/SSLTelnet does not support any encryption. If you are protecting your POP3 sessions with TLS/SSL then you need s_client, which is part of OpenSSL. You can query both local and remote mail servers, using your own server names of course. Commands that you type are in bold:
$ openssl s_client -connect localhost.com:995 You'll see a whole lot of lines about certificates and protocols, and eventually something like this:
---
Now we know we're talking to a Dovecot server. Dovecot supports both secure POP3 and secure IMAP. Now I can give Dovecot my login. Note that if you enter an invalid username it won't tell you, but will still say +OK:
Let's see if I have any messages: list
Yay, two messages for me! Use the retr command to read them:
retr 1
Hello Little Carla,
We're having a little get-together this weekend and hope you can come.
Bring your fabulous chicken skewers.
Love,
To read the second message type retr 2. To delete messages type dele followed by the message number, for example dele 1. Messages are not really deleted until you type quit, so you can change your mind and un-delete with the rset command, which un-deletes all messages marked for deletion.
You may need to use the domain name on a remote server to log in, for example user carla@example.com. RFC 1939 contains a complete listing of POP3 commands. |