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

Use UnifiedPush for push notifications

Open iiitomo opened this issue 4 years ago • 1 comments

Current K9-mail beta doesn't provide push notifications. I wish K9-mail provides Push notifications and allows me choose my distributor for Push Notifications. (e.g. so that I can use Gotify instead of FCM / Google services)

UnifiedPush is a recent FOSS library that allows this, I suggest to include it in K9-mail.

See https://unifiedpush.org and Matrix discussion on #unifiedpush:matrix.org Also #5123 might give additional info.

iiitomo avatar Feb 21 '21 22:02 iiitomo

Do any mail servers implement UnifiedPush already?

Atemu avatar Jul 20 '22 08:07 Atemu

Could we have proxy/inbetween server for the notifications? I know many servers won't implement unified push (like gmail, o365), so a self hostable proxy server that can watch for new emails from accounts, send a notification and similar to snapchat, k9 can go out with a background service to fetch the new emails from the accounts in the push notification. Could even expand that functionality out to FCM if users want it, functionally behaving the same way.

hockeymikey avatar Dec 13 '22 18:12 hockeymikey

I already use both k9 mail and Nextcloud mail to read my mail, depending on the device I'm on. Therefore Nextcloud knows both about my new mail and my Unified Push provider. I wonder if there's an opportunity there, like having NextcloudMail push a notification to K9 mail?

Obviously not everyone runs Nextcloud Mail, but Nextcloud is already very popular with self hosters, and Nextcloud Mail is very easy to add on to it.

Might it be worth making a feature suggestion over there?

Bugsbane avatar Dec 27 '22 14:12 Bugsbane

Using an external service for Push notifications is not something IMAP currently supports. See #5827.

cketti avatar May 03 '23 12:05 cketti

Maybe this issue needs to be solved at the email provider level: they are after all the ones running servers and pushing updates. Its up to someone to create an email service, self-hostable or not, that also runs its own unifiedpush instance, or uses the global one, to push updates to clients.

After that, it would be on email clients like k9 to integrate with ntfy to receive them.

Would be a bit of work, but its far better for battery and security, than either relying on google FCM, or having background services running, or doing periodic polling. ntfy is really wonderful on battery life, and can potentially support any app that needs notifs.

dessalines avatar May 03 '23 16:05 dessalines

Yes, ultimately it is up to the server, whatever that is, to provide the push notifications. The scope of K9/TB should be the ability to register with UnifiedPush (whether NTFY, or another UnifiedPush provider) the same way that Fedilab does for UnifiedPush notifications sent by the Mastodon server.

Ultimately the goal is to have K9/TB not have to poll for new mail at all, but just get woken when UnifiedPush neds a notification, so we can save battery and bandwidth.

Bugsbane avatar May 06 '23 20:05 Bugsbane

Could we have proxy/inbetween server for the notifications? I know many servers won't implement unified push (like gmail, o365), so a self hostable proxy server that can watch for new emails from accounts, send a notification and similar to snapchat, k9 can go out with a background service to fetch the new emails from the accounts in the push notification. Could even expand that functionality out to FCM if users want it, functionally behaving the same way.

I think about the same, not a lot servers will implement it. Let's even say it will be niche situations. I know there is some known projects that provide such proxy things, but from what I know it's not serious software

Let me know if my knowledge is outdated

But for know and for what I actually know of the email world we will have to continue pulling emails to find new ones

williamdes avatar May 06 '23 20:05 williamdes

@williamdes It's nothing about any servers implementing it. The proxy is a shim between the client and the email server that is hosted by the user. You share credentials with that push proxy server and it polls instead of the mobile client. Doesn't seem super complex in my head for implementation, rather a question of dev hours and where they are most needed.

hockeymikey avatar May 08 '23 04:05 hockeymikey

@williamdes It's nothing about any servers implementing it. The proxy is a shim between the client and the email server that is hosted by the user. You share credentials with that push proxy server and it polls instead of the mobile client. Doesn't seem super complex in my head for implementation, rather a question of dev hours and where they are most needed.

Can you share documentation links?

williamdes avatar May 08 '23 05:05 williamdes

@williamdes Docs about what?

hockeymikey avatar May 09 '23 17:05 hockeymikey

Please don't use the issue tracker for discussions that are at best tangentially related to K-9 Mail. Use the forum instead.

cketti avatar May 09 '23 17:05 cketti

@cketti They are directly related to the issue at hand. The forum isn't best for that.

hockeymikey avatar May 09 '23 18:05 hockeymikey

Discussions about designing a proxy server that supports Unified Push is very much outside the scope of this issue and this repository.

cketti avatar May 09 '23 18:05 cketti

Discussions about designing a proxy server that supports Unified Push is very much outside the scope of this issue and this repository.

The proxy server would communicate with the app and be a setting in it to point to one. Very much well within the limits of the repo and issue, especially because it's the only solution really.

hockeymikey avatar May 09 '23 21:05 hockeymikey