thunderbird-android icon indicating copy to clipboard operation
thunderbird-android copied to clipboard

Excessive Battery Usage

Open zWhdmB5T opened this issue 2 years ago • 14 comments

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

  1. Android Version 14
  2. GrapheneOS Build Number UP1A.231005.007.2023102300
  3. Security Patches 2023-10-06
  4. Kernel Version 5.10.194-android13-4-g290eb1d8e5b9

Device model

Google Pixel 6a

Steps to reproduce

  1. Use smartphone regularly
  2. (K-9 Mail autostart) running in background
  3. check battery usage after approx. 1 day
  4. battery usage for K-9 Mail is about 50 % or above (depends on specific use of smartphone in between)

settings:

  1. general settings: network: background synchronization: always
  2. account: frequency of e-mail check: never (only manually)
  3. account: checked folders: all except ancillary folders
  4. account: push folders: only main folders
  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

Expected behavior

much less battery usage

Actual behavior

high battery consumption

Logs

will be supported after the next usage cycle (charging battery, using device)

zWhdmB5T avatar Oct 28 '23 08:10 zWhdmB5T

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.

zWhdmB5T avatar Oct 31 '23 01:10 zWhdmB5T

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.

zWhdmB5T avatar Oct 31 '23 01:10 zWhdmB5T

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 avatar Oct 31 '23 07:10 cketti

@cketti thank you! I will ask Posteo support if they can/may change it. Hopefully…

zWhdmB5T avatar Oct 31 '23 09:10 zWhdmB5T

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.

zWhdmB5T avatar Oct 31 '23 10:10 zWhdmB5T

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 avatar Nov 06 '23 10:11 avatar1024

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.

zWhdmB5T avatar Nov 06 '23 10:11 zWhdmB5T

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 avatar Nov 06 '23 14:11 avatar1024

@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: Screenshot_20231106-155443 Screenshot_20231106-155508 Screenshot_20231106-155605 Screenshot_20231106-155615 Screenshot_20231106-155716 Screenshot_20231106-155727 Screenshot_20231106-155747

I now have fully charged my phone and am doing a cycle of use. I then will provide new debug logs.

zWhdmB5T avatar Nov 06 '23 15:11 zWhdmB5T

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.

cketti avatar Nov 07 '23 22:11 cketti

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

zWhdmB5T avatar Nov 08 '23 11:11 zWhdmB5T

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.

@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 avatar Nov 08 '23 11:11 zWhdmB5T

@zWhdmB5T Did you get an answer from posteo in the meantime?

camoz avatar Aug 15 '24 12:08 camoz

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).

zWhdmB5T avatar Aug 16 '24 04:08 zWhdmB5T

Screenshot_20240915-121948 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.

axodentally avatar Sep 15 '24 10:09 axodentally