JMAP restrict push notification to specific labels or folders

Your question

Currently, I am testing JMAP clients on iOS to determine if push notifications are functioning correctly.
Initially, I tested Boogie, but the push notifications did not work. Subsequently, I tested Plume, and push notifications were immediately working.

However, with the successful implementation of push notifications, a minor issue arose. I receive notifications for every email, even for emails that are delivered directly to the spam folder. I have a sieve script that moves emails to a specific folder to remove them from my inbox. Despite this, I still receive notifications for every new email. I have set the “seen” flag for each email, but this does not seem to have any effect either.

Therefore, I am seeking a solution to receive notifications only for specific folders or labeled emails. Ultimately, there should be no notifications for spam emails.

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

This confirms Stalwart doesn’t offer per-mailbox or per-label filtering for push notifications at the server level. Push subscriptions in JMAP (RFC 8620/8030) support a types filter for object types (e.g. Email, Mailbox) via the PushSubscription object’s types property, not per-folder filtering, and Stalwart follows this: notifications are triggered by state changes to types, with no folder/label scoping option server-side.

This confirms push subscription types filter only by data type (Email, Mailbox, etc.), not by folder/mailbox instance or label. There’s no mailbox-specific filtering in the JMAP spec’s push mechanism itself.

Given this, I’m confident that the current Stalwart JMAP push implementation has no mechanism to restrict notifications by mailbox/folder or label.

Based on this, there is no support in Stalwart’s JMAP push notification system for filtering by mailbox/folder or label. The types parameter on push subscriptions and the event source only filters by data type (Email, Mailbox, Thread, etc.), not by which mailbox a message belongs to. Any change notification to the Email data type in the account fires regardless of which folder the message lands in.

JMAP push notifications in Stalwart are scoped to a subscription’s types list (e.g. Email, Mailbox, EmailSubmission, etc.), not to specific mailboxes or folders. There is no field in the PushSubscription or EventSource mechanism that filters by mailbox, label, or the Junk/Spam folder specifically. Every state change of a subscribed type (including a message being sieve-filed into a spam folder) triggers a notification, since JMAP’s state-change model tracks changes to a data type across the account, not per-container.

This is a limitation of the JMAP push model as implemented (it mirrors the RFC 8620/8030 design, which only exposes type-level granularity), not something configurable via Stalwart settings. Filtering notifications by folder would have to happen client-side, if the client supports checking which mailbox an email landed in before alerting the user. See the push notifications reference for the fields that are configurable: Push notifications | Stalwart

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

After let claude also do a research, it looks like there is an early draft draft-ietf-jmap-emailpush-03 which address this. It has also implemented in client to manage specific subscriptions.

Any chance to see this implemented, or do we have to wait till it’s an RFC?

It’s implemented, but there are no clients that support setting the filters yet.