How to talk to IMAP server in Shell via OpenSSL

imap, openssl, terminal

Solution

Found an error by help of a friend:

openssl s_client -connect imap.gmail.com:993 -crlf

-crlf is critical

Problem

I want to send IMAP commands via Mac OS X Terminal to server and get response. I can connect to the server using this line: ``` openssl s_client -connect imap.gmail.com:993 ``` And I can successfully login: ``` ? LOGIN m.client2 passwordhere ``` But all other commands do not work, no response from server. I tried for instance this: ``` ? LIST "" "*" ? SELECT INBOX ```

Original source