We help IT Professionals succeed at work.
Get Started

Secure connection from Android to IMAP on Linux

Mark asked
Last Modified: 2015-03-02
I am running Dovecot 2.2.15 on Slackware64 14.1, kernel 3.10.17, openssl 1.0.2.

I can connect from my Android to this server just fine using IMAP and no security. Now I am trying to set up SSL security. On the Android I've tried both "SSL" and "SSL (Accept all certificates)". The suggested port is 993 which I've forwarded on the server to port 143. When I attempt to connect I get the following message on the Android:
Setup could not finish
Cannot safely connect to server.
(SSL handshake aborted : ssl=0x5fb440: Failure in SSL library, usually a protocol error
error:140770FC:SSL routines: SSL23_GET_SERVER_HELLO: unknown protocol (external/openssl/ss/s23_clnt.c:683 oxad1276bf:0x0000000000))
In my dovecot log I get the following:
Feb 28 12:21:52 auth: Debug: Loading modules from directory: /usr/local/lib/dovecot/auth
Feb 28 12:21:52 auth: Debug: Read auth token secret from /usr/local/var/run/dovecot/auth-token-secret.dat
Feb 28 12:21:52 auth: Debug: auth client connected (pid=22360)
Feb 28 12:24:52 imap-login: Info: Disconnected: Inactivity (no auth attempts in 180 secs): user=<>, rip=, lip=, session=<aGRJQykQOwBMtUHE>
Feb 28 12:25:18 imap(mark): Info: Disconnected for inactivity in=1325 out=124104

Open in new window

My dovecot config is:
$ doveconf -n
# 2.2.15: /usr/local/etc/dovecot/dovecot.conf
# OS: Linux 3.10.17 x86_64 Slackware 14.1
auth_debug_passwords = yes
auth_mechanisms = plain login
auth_verbose = yes
auth_verbose_passwords = plain
disable_plaintext_auth = no
info_log_path = /var/log/dovecot_info
mail_location = maildir:~/Maildir
passdb {
  driver = shadow
protocols = imap
ssl = no
userdb {
  driver = passwd

Open in new window

If I try connecting using TLS I get a message on the Android" "Setup could not finish/Server doesn't support TLS", but of course it does. We get and send messages with TLS all the time.

No idea what's wrong. Need help getting this working.
Watch Question
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE