Android 10 Notification Issues

Thank you @Nimueh for the reply, it’s been a while since I last used K-9.

Battery Optimization was (and is) turned off for the app, Auto-Sync is on by default, phone-wide.

And for IMAP PUSH, in the individual account setting:

  • Folder Poll Frequency: Never
  • Push folders: Only 1st Class folders

then IMAP PUSH worked. :slightly_smiling_face:

Does K-9 have permission to access media (sound files for notifications) as well as permission to post notifications?

Sorry, I didn’t mean auto sync but background data. I’m not on the A10 device atm so I grabbed a screen from OOS 11, but it should be somewhat the same. It’s under device Settings - Apps - All Apps - K-9 - Advanced on OOS 11 but I’m fairly certain it’s the same on an A10 rom.


You may want to set Poll to something like 15 or 30 minutes too … Push, at least for Gmail, has always been pretty unreliable for me, no matter which device, Android/OOS version or app (with K-9 still doing the best job of all mail apps I’ve tried, incl. the stock Gmail one).

1 Like

Hello,

Same problem here on Android 10/MIUI 12 and K-9 6.000.

I already try K-9 mail a few years ago but I gave up on it because of the outdated interface and I wasn’t getting notification for new emails, so I preferred using FairEmail instead.
I recently saw there was a new version with a really nice user interface, I wanted to give it a new try and I like it a lot, so I would like to make it my main email app, but there is still the same problem with notifications that doesn’t work and because of this, I can’t.

I did all the settings tweaks given here: https://dontkillmyapp.com/ with no success. MIUI optimizations are off, auto start is enabled, battery optimizations are off, all permissions are given, data sync is on, polling emails set at 15 min… I don’t know what I can do more.:frowning:
If I manually launch the app by tapping on it, then I get notifications appearing for new emails. But if I don’t, nothing ever appears.

I think something needs to be fixed here with K-9 because it’s the only app I’ve ever had this kind of problem, with FairEmail notifications are working well, and apparently we are several facing this problem.

I have this same problem on android 9. Solution: Android settings> information app> k9 app> notification in app> messages> overwrite the do not disturb function ON

I’m having the same problem. Mine started sometime in the last couple of weeks. I haven’t changed anything on my phone or K9 settings (been using it for several years). K9 is showing the emails as having arrived and shows them as unread but it doesn’t make a notification sound or show a notification message.

It’s not phone settings because if I send an email to my GMail account that plays the sound.

The only settings discrepancy with what’s mentioned above is that I have polling set to never but it’s an IMAP account so shouldn’t need to poll and anyway it seems to be seeing the message arrive.

I just left the screen on, sent an email from a different account and saw the message appear in my inbox - no sound.

Phone is a Samsung S10.

@Andrue_Cope: Did you record a debug log like it was suggested in this thread before? The log should include the reason why a notification wasn’t created.

Hmmm.

08-05 08:24:14.431  9625  9670 D ImapSync: SYNC: Fetching 1 small messages for folder INBOX
08-05 08:24:14.432  9625  9670 V RealImapConnection: conn167661428>>> 44 UID FETCH 17392 (UID BODY.PEEK[])
08-05 08:24:14.456  9625  9670 V RealImapConnection: conn167661428<<<#null# [18, FETCH, [UID, 17392, BODY, [], 1]]
08-05 08:24:14.469  9625  9670 D BinaryTempFileBody$BinaryTempFileBodyInputStream: Deleting temporary binary file: body1415447688659118959.tmp
08-05 08:24:14.471  9625  9670 D BinaryTempFileBody$BinaryTempFileBodyInputStream: Deleting temporary binary file: body5510192091284637642.tmp
08-05 08:24:14.490  9625  9670 V LockableDatabase: LockableDatabase: Transaction ended, took 13 ms / com.fsck.k9.storage.messages.SaveMessageOperations.saveMessage(SaveMessageOperations.kt:81)
08-05 08:24:14.493  9625  9670 V ImapSync$downloadSmallMessages: About to notify listeners that we got a new small message andrue imap:INBOX:17392
08-05 08:24:14.496  9625  9670 V K9NotificationStrategy: No notification: Message is old
08-05 08:24:14.504  9625  9670 V RealImapConnection: conn167661428<<<#44# [OK, UID FETCH completed]

I’ve repeated this with and without Thunderbird open on my laptop. Thunderbird reported the arrival and both Thunderbird and K9 currently think my test messages are unread.

I’ve done some searching around that and one of the results relating to deleted messages (from 2017) does remind me that I had to rebuild my mail server a couple of weeks ago. Could it be that K9’s new message sync point is out of date?

K9NotificationStrategy: No notification: Message is old

K-9 Mail will only create notifications for messages that have been added to the folder after the latest message it knows about (it uses the UID for that). So if you sync 10 messages, then delete one, the app will download an “old” message to get back to 10 synced messages. However, K-9 Mail will not create a notification for that “old” message. That’s true even if the app hasn’t seen the “old” message before, e.g. if you have received 11 new messages since the last time you’ve synced the folder. The only way around that is to increase the number of messages synced to the device.

K-9 Mail resets the highest known UID if the UIDVALIDITY value changes. If you’ve rebuilt you mail server and new UIDs are used but the UIDVALIDITY value is the same as it was before, then this could explain the problem. However, that violates the IMAP spec and all kinds of issues could occur. Please check the documentation of your IMAP server on how to force a new UIDVALIDITY value. That will clear the cache in K-9 Mail. Alternatively, you could remove the account from K-9 Mail and then add it again.

All I did was restore from a backup. The backup was several days out of date but otherwise fine. I’m loathe to do anything to the server since it was clearly restored to a valid state and Thunderbird is not having any problems recognising new mail.

If it’s not technically a bug in K9 I’d call it a deficiency. Being unable to handle restoration of a mail server is surely wrong.

The IMAP specification guarantees that a tuple of (folder name, UIDVALIDITY, UID) uniquely identifies a message. By restoring an old state (and receiving new messages), you broke that guarantee. All of the UIDs that have been assigned after your backup was created (but before you restored the backup) will be assigned to different messages after you have restored the backup. I hope you can see how that can break client side caching.

I can understand it but it’s a shame K9 broke when another client didn’t. But I’ve recreated the account (easy enough thankfully by exporting/importing settings) and I’m getting notifications again so thanks for that.

Oh and thanks for the additional work recently on K9. It’s a great client and justify me running my own server.