Logging in to IMAPS
Logging into an IMAPS server is only a little more complicated:
$ openssl s_client -host imap.irgendwo.de -port 993
* OK IMAP4 Ready 0.0.0.0 0001f994
1 Login user-ju secret
1 OK You are so in
2 LIST "" "*"
* LIST (\HasChildren) "." "INBOX"
* LIST (\HasNoChildren) "." "INBOX.AV"
2 OK Completed (0.130 secs 5171 calls)
* BYE LOGOUT received
3 OK Completed
Don't forget the freely-selectable sequence number which must precede the actual IMAP command. A POP3 login works in a similar way, if we identify ourselves within the SSL tunnel using the USER and PASS POP3 commands:
$ openssl s_client -host pop.irgendwo.de -port 995
+OK POP server ready H mimap3
+OK password required for user "user-ju"
+OK mailbox "user-ju" has 0 messages (0 octets) H mimap3
+OK POP server signing off
An alternative option is the telnet-ssl tool which offers similar functionality.