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

推荐订阅源

博客园 - Franky
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Schneier on Security
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Spread Privacy
Spread Privacy
Project Zero
Project Zero
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
N
News | PayPal Newsroom
A
Arctic Wolf
NISL@THU
NISL@THU
W
WeLiveSecurity
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News: Ask HN
Hacker News: Ask HN
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
L
Lohrmann on Cybersecurity
Last Week in AI
Last Week in AI
T
Threatpost
The Last Watchdog
The Last Watchdog
博客园_首页
C
Cybersecurity and Infrastructure Security Agency CISA
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Engineering at Meta
Engineering at Meta
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
S
Security Affairs
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
雷峰网
雷峰网
T
Tenable Blog
Schneier on Security
Schneier on Security
H
Heimdal Security Blog
V2EX - 技术
V2EX - 技术
V
V2EX
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Latest news
Latest news
Help Net Security
Help Net Security
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
V
Vulnerabilities – Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

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