thunderbird / thunderbird-android

K-9 Mail – Open Source Email App for Android
https://k9mail.app/
Apache License 2.0
9.9k stars 2.46k forks source link

Add support for poll intervals smaller than 15 minutes (foreground service) #5513

Open DPTJKKVH opened 3 years ago

DPTJKKVH commented 3 years ago

I regularly need to get notified of certain events in the shortest possible amount of time. Due to regional restrictions and technical limitations, SMS notification and push notifications (eg. via Pushr) are not available to me. So email is the only available option to me.

Before the most recent update (the one with the UI change) I was able to set the fetch interval of individual mail accounts to very low settings. I always did that temporarily and with the explicit permission of the mailservers owner and administrator. (By the way: "Email push" is not available to me and has proven to be unreliable in the past, when I was on a different setup.)

Unfortunately with the new update, the shortest configurable fetch interwal is 15 minutes. I do understand that this is fine for most use cases but it puts me in a difficult situation. 15 minutes are at least 10 minutes too long (if not more) if I have to get notified asap.

Describe the solution you'd like I do understand that I might be somewhat of an edge case but I do want to politely ask for allowing users to set fetch intervals blow 15 minutes.

Describe alternatives you've considered If the removal of short fetch intervals was a measure to protect people from themselves, I want to suggest to hide the option for short fetch intervals inside a debug menu or "advanced" menu, which would prevent casual users from accidentally choosing "too short" fetch intervals.

cketti commented 3 years ago

The minimum of 15 minutes is a system limitation for periodic background work. It's still possible to wake up the device more often than that. But it requires using a totally different mechanism (foreground service). For near-instantaneous notifications we support Push (with IMAP accounts), which is fairly energy-efficient.

A poll interval of less than 15 minutes isn't particularly energy-efficient and requires adding additional code. I'm not opposed to including this functionality in the app, but I have no desire to write it myself.

DPTJKKVH commented 3 years ago

Thanks for your honest opinion on that matter and for not outright dismissing the idea. I will try and look for a dev who can provide the code necessary.

With that said: If anyone reading this is interested to earn some money by creating a pull request for the above described feature, please comment here and provide some way to get in touch. We can work out the specifics then. Please note: cketti must approve and merge the pull request!

BaumGuard commented 2 years ago

I don't really understand why there is no possibility for a smaller sync intervall nowadays. In the past the sync intervall has always been set to 5 minutes in my case and it worked well.

HFPasfho commented 2 months ago

The minimum of 15 minutes is a system limitation for periodic background work. It's still possible to wake up the device more often than that. But it requires using a totally different mechanism (foreground service). For near-instantaneous notifications we support Push (with IMAP accounts), which is fairly energy-efficient.

A poll interval of less than 15 minutes isn't particularly energy-efficient and requires adding additional code. I'm not opposed to including this functionality in the app, but I have no desire to write it myself.

Do I understand correctly that Push is more energy-efficient than checking for emails every 5 minutes? Do all IMAP accounts support Push notifications?

Onlo0ker commented 2 months ago

This is blatant overreach by google; I'm using 10-14 year old Android 2.3 IRC client and they are maintaining 'live' connection and phone uptime when idle is 16 days! I see no reason pop3 polling can't be similar. I noticed the 15minute minimum interval on recent k9 reinstall; I tried older versions until v5.6 which still has the 1min interval option but! in Android 11 it will not function or sync or check any mail unless manually done. I tried a k-9 from ~14 years ago, but it appears the menus are not available to really 'use it'. I run my own pop3 mail server, I'm ok with 30 second polling intervals; it's my $hit to overload; and if google has a problem with it on their servers they can deny it from their end, not every bloody phone in the world.