How to get IMAP/SSL (993) working?

Anyone know how to get IMAP over SSL working? The way to test it is by issuing this command:

$ 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

It seems I should be getting a handshake message like this:

* 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.

Check dovecot.conf

  # 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)

That is an invalid setting. This is dovecot v2 on Ubuntu 12.04 LTS.

Further details (I've sent this to support as well):

$ 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.

Sounds like you've not got SASL working properly; restart sasl daemons, maybe?

Got it. This guide works perfectly for Ubuntu 12.04:

http://www.exratione.com/2012/05/a-mail … cot-mysql/">http://www.exratione.com/2012/05/a-mailserver-on-ubuntu-1204-postfix-dovecot-mysql/

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct