K-9: Sync issues

Created on 7 Mar 2019  路  7Comments  路  Source: k9mail/k-9

Note: This is a catch-all issue for all kinds of sync problems. Other issues will be marked as duplicate of this one to make life easier for us developers, who are the primary users of this issue tracker. Those other issues are likely to contain valuable information for users. So please read them before posting here!

Power saving features in recent Android versions make periodic mail checks in K-9 Mail unpredictable to unreliable. We are in the process of rewriting large parts of the mail sync code to address this. Those changes will hopefully soon be available to beta testers as version 5.7xx. The next stable version containing these changes will be 5.800.

UPDATE: Beta versions are available on Google Play after opting in to become a beta tester, by manually installing them from F-Droid, or you can download the APKs here: https://github.com/k9mail/k-9/releases

Please don't ask when the new stable version will be available. We don't know.

This site might be helpful to understand the power saving features of your device: https://dontkillmyapp.com/

bug

All 7 comments

One additional report: K9 has multiple simultaneous connections to the imap server (in my case, 12), and my imap server (dovecot 2.3.3 from dovecot-2.3.3-1.fc29.x86_64 on Fedora29) had a limit of 10 per user per ip address.

I fixed it with this:

  sudo sed '/#mail_max_userip_connections/a \  mail_max_userip_connections = 100'  /etc/dovecot/conf.d/20-imap.conf 
  grep -B6 -A1 mail_max_userip_connections /etc/dovecot/conf.d/20-imap.conf

Output:

protocol imap {
  # Space separated list of plugins to load (default is global mail_plugins).
  #mail_plugins = $mail_plugins

  # Maximum number of IMAP connections allowed for a user from each IP address.
  # NOTE: The username is compared case-sensitively.
  #mail_max_userip_connections = 10
  mail_max_userip_connections = 100
}

# Restart dovecot to make the changes take effect:
sudo service restart dovecot
# Check that dovecot has restarted and is listening:
sudo netstat -tanp | grep dovecot

Output:

tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      12844/dovecot       
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      12844/dovecot       
tcp6       0      0 :::993                  :::*                    LISTEN      12844/dovecot       
tcp6       0      0 :::995                  :::*                    LISTEN      12844/dovecot  

Workaround for sync issues with Android >= 8 on rooted phones: install Magisk and Magisk module 'swap torpedo'. Since then, K9 works as expected on Android 9.0

Workaround for sync issues with Android >= 8 on rooted phones: install Magisk and Magisk module 'swap torpedo'. Since then, K9 works as expected on Android 9.0

Not on my S9 with latest version of evertything, the module makes it freeze when open random apps. I have not had a freeze on any of my phones in several years, but since yesterday I've had three. So I'm removing that again.

Sorry, I forgot to mention my phone: Moto X4 retail

I've noticed a few times that notifications are shown during a brief moment. I can't be more precise... It could be a few seconds or maybe minutes, not sure. If I don't open them, at some point they dissapear and don't come back.

Push notifications could be working for some of us but because they vanish after some time it could look like a syncing issue.

I solved issues of sync disactivating on a samsung galaxy A3 by changing BOTH those two parameters:
1) Prevent samsung layer to optimize it
Settings -> Device Maintenance -> Battery -> Unmonitored apps (bottom) -> Add apps -> K9
2) Prevent Android doze
Settings -> Apps -> (Menu top right screen) Special access -> Optimize Battery usage -> (select) All apps -> Uncheck K9

I had to search for quite some time before finding 2), but it seems like it was the key to my issues (and I assume to those relating this here). Since then, I had no issues, on wifi and on data.

https://www.oruxmaps.com/cs/en/ app suffer same trouble (as does waze for me sometimes). Orux invites user to change this setting (2)) by accessing it directly (launching a new activity) when app is launched for the first time. Pretty smart idea IMHO. Maybe that could be a hint to k9 dev to check this and/or redirect user to correct setting immediately. And much faster to implement than waiting for a new "core".

Referencing #4258

Was this page helpful?
0 / 5 - 0 ratings

Related issues

D0ve picture D0ve  路  3Comments

maltfield picture maltfield  路  3Comments

jrtberlin picture jrtberlin  路  3Comments

frederiiiic picture frederiiiic  路  3Comments

farson2003 picture farson2003  路  4Comments