Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to talk to IMAP server in Shell via OpenSSL

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 
like image 629
Denis Kutlubaev Avatar asked Feb 19 '13 14:02

Denis Kutlubaev


People also ask

What is IMAP protocol?

Internet Message Access Protocol (IMAP) is a protocol for accessing email or bulletin board messages from a (possibly shared) mail server or service. IMAP allows a client e-mail program to access remote message stores as if they were local.


2 Answers

Found an error by help of a friend:

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

-crlf is critical

like image 118
Denis Kutlubaev Avatar answered Oct 26 '22 14:10

Denis Kutlubaev


Try this, this should works for you (replace the first line by your

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

command (mandatory -crlf) & type only the blue part) :

enter image description here

like image 20
Gilles Quenot Avatar answered Oct 26 '22 12:10

Gilles Quenot