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
First thing first, is imap activated on your gmail account??? if you are able to login successfully that means ssl is working fine. whats the return code that you get for
have you tried the command
try other alternative commands since not all IMAP servers implementa all the IMAP commands. I have faced this issue while I was creating the data migration tools for different vendors like gmail rediffmail yahoo...
Try this, this should works for you (replace the first line by your
command (mandatory -crlf) & type only the blue part) :
Found an error by help of a friend:
-crlf is critical
A few more options to consider: You may be connecting to a server offering
STARTTLS
in which case you can tell openssl to proceed in negotiating this, you need to specify which protocol you're using (choose frompop3
,imap
,smtp
,ftp
); the-crlf
option has been mentioned by others, and I also find the-showcerts
option useful if I'm debugging an SSL/TLS configuration. So for example you might end up with,More options with the relevant man page if you've got that available,