title: How to talk to IMAP server in Shell via OpenSSL
body: <p>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: </p>
  
  <pre><code>openssl s_client -connect imap.gmail.com:993
  </code></pre>
  
  <p>And I can successfully login: </p>
  
  <pre><code>? LOGIN m.client2 passwordhere
  </code></pre>
  
  <p>But all other commands do not work, no response from server. I tried for instance this: </p>
  
  <pre><code>? LIST "" "*"
  ? SELECT INBOX
  </code></pre>