惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

IT Notes - python

暂无文章

IT Notes
Stefano Marinelli · 2023-10-19 · via IT Notes - python

Since the time I left BlackBerry behind many years ago, I've consistently sought ways to keep my phones connected to my email accounts. I enjoy receiving emails in real-time, and as a result, I've always used tools that allow me to get instant (or near-instant) notifications whenever a message arrives.

Years ago, I even used emails as a notification tool for my servers. If a server became unreachable, an email would alert me, and I'd immediately take corrective action. Nowadays, I use other systems too (like Telegram bots, Pushover, ntfy, etc.), but I still want to know when I receive a new message.

Back when I had my very first Android device (the original Android, the HTC Dream), I was already using IMAP IDLE, so my phone was always connected to my inbox. When I transitioned to the early iPhones, IMAP IDLE wasn't supported, leading me to use an app called PushMail. This app required you to send copies of your emails to it, after which it would push notifications showing the sender and subject. This approach wasn't ideal for privacy, but it was effective.

In the following years, both with iPhones and various email apps on Android, I noticed that my phones consumed more battery in standby mode than the average. Upon investigation, I found out that a significant part of this consumption was tied to the background activities of my email accounts. The energy drain wasn't so much about the software, but more about the network activity triggered by any event in my inbox. For example: an email arrives, the phone downloads it and sends out a notification. I don't check the phone because I'm at my computer, so I open the email there. In real-time, the phone wakes up in the background to mark the email as read. Then, if I move the email to a folder, the phone wakes up again to sync this change.

The same process happens when I draft an email on my computer. Every time the email client saves the intermediate draft, the phone wakes up from sleep to sync the message. Once sent, it wakes up again to remove it from drafts and copy it to the sent folder. This happens all day, for every single interaction.

This made me recall PushMail and made me realize that I don't actually need all this continuous syncing. All I want is to be alerted when an email arrives, knowing who it's from and what it's about.

With this in mind, I developed NotiMail. I chose to support multiple notification providers, though my initial tests were conducted with PushOver, which I found efficient on both iPhone and Android. It works exactly as intended.

As an additional step, I compiled ntfy for FreeBSD. I also generated Firebase keys and recompiled the Android app so I could use my server while leveraging Google's push notifications. This helps save even more battery by utilizing the always-on data connection to Google servers. It's a trade-off in terms of privacy, but I needed to test this "extreme" case.

The results were astonishing. After a few days of use, I observed an average daily battery savings of 15%, and also a variable, yet notable, data savings.

I'm also testing, on a Pixel 7 with GrapheneOS, the impact of using direct push notifications with a continuous connection to my ntfy server. It's probably less battery efficient, but it saves all the data associated with mailbox operations.

This way, whether I have 1, 5, or 50 "connected" email accounts, they don't weigh down my battery (excluding the increased notifications, of course).

NotiMail is available here: https://github.com/draga79/NotiMail