K9mail abruptly stopped syncing last june 21

My k9 email stopped retrieving mail from the imap server on 21 june 2021. Manually syncing by swiping down or pressing on the “refresh” icon: the application spins for a bit, then stops. No error message appears, but no mail is downloaded.

  • k9mail version: 5.600

  • Android device: samsung s3

  • Android version: 4.4.2, kernel 3.4.0-1784548

  • (I know this kernel is like six years out of support, but k9mail was working fine until it stopped working.)

  • I set the folder poll frequency to “never” so a manual update is always necessary.

  • I enabled debug logging

  • I installed ‘adb’ as described on the github site, ran
    ./adb shell ps | grep k9
    to find the pid of k9 (currently 4767), then dumped the log with
    ./adb logcat -d -v time > dump.txt
    I did not see a way of limiting the debug log to just k9-related stuff, but searching for the
    pid (4767) in dump.txt brings up error messages like (this is ugly):

  • 07-10 02:01:25.769 D/ImapConnection( 4767): Connecting to gwimap.uregina.ca as gwimap.uregina.ca/142.3.100.146
    07-10 02:01:25.779 V/ImapConnection( 4767): conn1119552448 <<< #null# [OK, [CAPABILITY, IMAP4rev1, STARTTLS, LOGINDISABLED], Server Ready]
    07-10 02:01:25.789 D/ImapConnection( 4767): Saving [IMAP4REV1, LOGINDISABLED, STARTTLS] capabilities for conn1119552448
    07-10 02:01:25.789 V/ImapConnection( 4767): conn1119552448>>> 1 STARTTLS
    07-10 02:01:25.799 V/ImapResponseParser( 4767): conn1119552448<<<#1# [OK, Begin TLS negotiation]
    07-10 02:01:26.109 E/ImapConnection( 4767): Failed to login, closing connection for conn1119552448
    07-10 02:01:26.420 E/ImapFolder( 4767): IOException for naqvik@uregina.ca:INBOX/MessagingController
    07-10 02:01:26.420 E/ImapFolder( 4767): javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x638d5848: Failure in SSL library, usually a protocol error
    07-10 02:01:26.420 E/ImapFolder( 4767): error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:744 0x5d5067e8:0x00000000)
    07-10 02:01:26.420 E/ImapFolder( 4767): at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:449)
    07-10 02:01:26.420 E/ImapFolder( 4767): at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.(OpenSSLSocketImpl.java:662)

The number of messages is longer than what I’ve provided, but it gives a flavour of what’s happening. Basically some sort of handshake is failing, and I don’t know what changed. I can still access email from the imap server on many other clients, but I have not tried other clients on the Android phone because it’s so old that it’s tanking and most apps are not even installable.

Chances are your email provider requires you to set an app password for k9 (and most other email apps) since they consider them “insecure”. Check the settings of your email provider in your web browser and generate an app password for k9.

It’s a TLS error. Your provider now probably requires TLS versions newer than what your Android version supports by default. See SSLSocket  |  Android Developers

Your Android version ships with support for more modern TLS versions. They are just disabled by default (due to compatibility concerns at that time). It should be possible to modify K-9 Mail to make things work. However, there won’t be an official release doing that. The next stable version of K-9 Mail will only run on Android 5.0 and newer. I’m afraid you’re on your own here.

Well, after nearly 10 years I’ve probably squeezed nearly all the usability out this old phone (but it still works as a phone and camera). Thank you so much for your help!