How to get IMAP/SSL (993) working?
$ openssl s_client -connect localhost:993
And then once you get an "OK" message, type: 1 Login someuser somepass
On a correct setup (like Apple's iCloud), it will say you authenticated OK, or authentication failed. I can't get those responses with my IMAPS server.
6 Replies
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.
But I'm not. I don't think Dovecot is set up properly. Port 993 is definitely there and using SSL which is great. But my mail client doesn't like the lack of the CAPABILITY handshake.
# Send IMAP capabilities in greeting message. This makes it unnecessary for
# clients to request it with CAPABILITY command, so it saves one round-trip.
# Many clients however don't understand it and ask the CAPABILITY anyway.
#login_greeting_capability = no
With this set to "yes" then the capability list is sent at connection time (restart dovecot after making the change)
$ openssl s_client -connect localhost:993
If I see this line:
- OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN] Dovecot ready.
Then I know I'm good. And then I type:
1 Login bob bobpass
And see:
1 NO [AUTHENTICATIONFAILED] Authentication failed.
However, if I follow the instructions Linode has posted for Ubuntu, when I issue the openssl connect, I see no OK until I hit enter, and I see:
- OK Waiting for authentication process to respond..
And if I type "1 Login bob bobpass" now.. I get:
- OK Waiting for authentication process to respond..
So it's almost like the protocol has changed?? And this is why my Mac Mail app hangs when trying to connect to IMAP SSL port 993, because it's sending the "1 Login user pass" command and not getting what it expects.