Excessive Battery Usage
Checklist
- [X] I have used the search function to see if someone else has already submitted the same bug report.
- [X] I will describe the problem with as much detail as possible.
App version
6.711 (F-Droid)
Where did you get the app from?
F-Droid
Android version
- Android Version 14
- GrapheneOS Build Number UP1A.231005.007.2023102300
- Security Patches 2023-10-06
- Kernel Version 5.10.194-android13-4-g290eb1d8e5b9
Device model
Google Pixel 6a
Steps to reproduce
- Use smartphone regularly
- (K-9 Mail autostart) running in background
- check battery usage after approx. 1 day
- battery usage for K-9 Mail is about 50 % or above (depends on specific use of smartphone in between)
settings:
- general settings: network: background synchronization: always
- account: frequency of e-mail check: never (only manually)
- account: checked folders: all except ancillary folders
- account: push folders: only main folders
- account: incoming mail server: imap-server: posteo.de (1 server / 1 e-mail address in total)
- account: incoming mail server: type of security: SSL/TLS
- account: incoming mail server: port: 993
- account: extended: max push folders: 10 folders
- account: extended: renew push connection: every 24 minutes
Expected behavior
much less battery usage
Actual behavior
high battery consumption
Logs
will be supported after the next usage cycle (charging battery, using device)
Logs
will be supported after the next usage cycle (charging battery, using device)
here… k9mail-logs.txt
It was generated after 3 days of use of the device (most of the time the phone was idle), at that time the battery consumption of K-9 Mail was about 50 % and there was about 20 % of battery capacity left. (Sorry, no screenshot, missed it)
Will repeat this step after the next cycle of using.
settings:
5. account: incoming mail server: imap-server: posteo.de (1 server / 1 e-mail address in total) 6. account: incoming mail server: type of security: SSL/TLS 7. account: incoming mail server: port: 993 8. account: extended: max push folders: 10 folders 9. account: extended: renew push connection: every 24 minutes
I recently asked the support team of my e-mail provider Posteo about supporting IMAP IDLE. They said, they do provide IMAP IDLE support by standard.
It looks like Posteo is using the Dovecot default config for imap_idle_notify_interval which will send a response every 2 minutes waking up the device. This will help keep the connection to the mail server alive, but it also wakes up a device using IMAP IDLE much more often than should be necessary. They should probably increase this value to at least 10 minutes. Better yet to 30 minutes. That will let clients use their own refresh interval.
@cketti thank you! I will ask Posteo support if they can/may change it. Hopefully…
Dear @cketti I just noticed https://github.com/thundernest/k-9/issues/5685. This issue seems to be very similar to mine. Sorry, that I have not noticed it before.
Maybe you should add this info about IMAP IDLE and refresh cycles of either client (K-9 Mail: 24 minutes by standard) or e-mail provider (like Posteo in my case: 2 minutes) to Wiki or pinned issue. When I check your issues for high battery consumption like https://github.com/thundernest/k-9/issues?q=is%3Aissue+battery+usage or https://github.com/thundernest/k-9/issues?q=is%3Aissue+battery+drain I get quite a few hits. Not always it's the same case. But probably, it's quite usual. So, when there are new complains about high battery consumtion one should provide debug logs and check for refresh intervall of e-mail provider.
Humm... I use a Posteo account with FairEmail and I don't have any battery drain issue from this app so I'm not sure Posteo is the cause here.
Humm... I use a Posteo account with FairEmail and I don't have any battery drain issue from this app so I'm not sure Posteo is the cause here.
@avatar1024 Thank you for this comment: strange…
I know about FairEmail, and it is also on my list of bookmarks. But I would like to stay with K-9 Mail for some reasons.
Currently, I use poll instead of push at K-9 for Posteo (Posteo is my sole provider and I also have only 1 account there), and (using poll) battery usage is quite fair, it's insignificant.
I will now switch back to push, use my device for a period and generate new debug logs. Maybe, different debug logs show some new/different info.
I would really like to use both K-9 and push (with my Posteo).
As stated above, I asked my provider Posteo if they use/support IMAP IDLE. They said they do. When @cketti was talking about the different refresh intervals, I sent them a new support mail. I am still waiting for their answer.
I know about FairEmail, and it is also on my list of bookmarks. But I would like to stay with K-9 Mail for some reasons.
Just for clarity, I'm not suggesting you should switch app (although FairEmail is very good I have to say). I'm just pointing that this issue does not occur using that app and so it must be solvable at an app level (so a bug indeed in K9-Mail or in your particular set-up) rather than something wrong at the Posteo level.
@avatar1024 thank you, very helpful! Well, you did not push me to switch — I moreover have been thinking about now and then because of this issue. I am fine with K-9 in general, but the battery drain at my side is really annoying. (And I know FairMail to be a good app, too.)
@cketti @wmontwe please consider that it's K-9 (the app and/or specific K-9 settings) and not Posteo (my provider) for @avatar1024 mentioned that he is fine with Posteo, but FairEmail instead of K-9.
my summary of settings as attachments:
I now have fully charged my phone and am doing a cycle of use. I then will provide new debug logs.
I'm fairly certain FairEmail has the same issue. It's just that what you call "excessive battery usage" is not exactly that. Your device lasted over 3 days on one charge. Sure, it might be able to last longer if Posteo increased the imap_idle_notify_interval value. But it's not rapidly draining your battery. Most users probably wouldn't notice.
I will now switch back to push, use my device for a period and generate new debug logs. Maybe, different debug logs show some new/different info.
So, please find my logs here… bugreport-bluejay-UP1A.231005.007-2023-11-08-12-29-38.zip bugreport-bluejay-UP1A.231005.007-2023-11-08-12-29-38-dumpstate_log-20344.txt dumpstate-stats.txt k9mail-logs.txt
I'm fairly certain FairEmail has the same issue. It's just that what you call "excessive battery usage" is not exactly that. Your device lasted over 3 days on one charge. Sure, it might be able to last longer if Posteo increased the
imap_idle_notify_intervalvalue. But it's not rapidly draining your battery. Most users probably wouldn't notice.
@cketti,
The ticket at my e-mail provider is still open. They haven't answered, yet. Maybe, they're still investigating the issue.
Do you have other infos or details I should share with them? Anything needful/helpful in order to setup their server properly?
@zWhdmB5T Did you get an answer from posteo in the meantime?
Oh, sorry.
Yes, I got an answer: they told me, that they think everything is OK on their side and they are not going to change anything (related to that).
I also have exsessive battery usage from time to time. Last night I did not attach the charger to the phone and woke up with only36% battery left.
Device: Fairphone 4 OS: CalyxOS 5.11.1 K9Mail Version: 6.904
I have IDLE on for 4 accounts and daily poll for one. I will add logs, the next time I can see such a problem.