Summary
Add a visual Mail Rules editor to Stormbox that creates server-side filters through JMAP for Sieve.
This follows the contributor direction on the [Thundermail Ideas proposal](https://ideas.tb.pro/p/visual-server-side-mail-rules-using-jmap-sieve). A working prototype is available on https://github.com/BYK/stormbox/tree/feature/mail-rules-jmap-sieve and is also deployed at https://webmail.byk.im/ and tested successfully.
There can be UX follow-ups such as auto-complete for email addresses or criteria previews but I think this is a good first pass.
Why
Server-side rules keep working when Stormbox is closed and apply consistently across every mail client. Thundermail’s backend already exposes JMAP for Sieve, but users currently need another client or manually authored Sieve to configure filtering.
Proposed experience
Users can create, edit, enable, disable, reorder, and delete ordered rules with:
- Conditions: From, To, To/Cc, Subject, and custom headers
- Matching: is, contains, and wildcard
- Multiple conditions using all or any
- Actions: move to folder, mark as read, star, forward a copy, discard, and stop processing
Implementation approach
Keep the feature browser-side and use Stormbox’s existing authenticated JMAP connection, SharedWorker, and durable mutation outbox:
- Store rules as a typed, versioned document and compile them into a deliberately limited Sieve subset.
- Detect advertised Sieve extensions and expose only supported actions.
- Upload and validate scripts through JMAP for Sieve before activation.
- Target folders using stable JMAP mailbox IDs.
- Clearly mark Stormbox-managed scripts and retain the visual rule document as metadata.
- Preserve scripts owned by other clients and require explicit confirmation before replacing an externally managed active script.
- Detect concurrent server changes rather than silently overwriting them.
Acceptance criteria
- Rules can be created, edited, reordered, enabled, disabled, and deleted.
- Generated Sieve is server-validated before activation.
- Existing external scripts are preserved unless replacement is explicitly confirmed.
- Concurrent server changes are detected.
- The feature is unavailable when JMAP Sieve is unsupported.
- Compiler, store, sync, component, and end-to-end coverage is included.
Initial non-goals
- Raw Sieve editing or importing arbitrary Sieve
- Retroactively applying rules to existing messages
- Shared-account rule management
Summary
Add a visual Mail Rules editor to Stormbox that creates server-side filters through JMAP for Sieve.
This follows the contributor direction on the [Thundermail Ideas proposal](https://ideas.tb.pro/p/visual-server-side-mail-rules-using-jmap-sieve). A working prototype is available on https://github.com/BYK/stormbox/tree/feature/mail-rules-jmap-sieve and is also deployed at https://webmail.byk.im/ and tested successfully.
There can be UX follow-ups such as auto-complete for email addresses or criteria previews but I think this is a good first pass.
Why
Server-side rules keep working when Stormbox is closed and apply consistently across every mail client. Thundermail’s backend already exposes JMAP for Sieve, but users currently need another client or manually authored Sieve to configure filtering.
Proposed experience
Users can create, edit, enable, disable, reorder, and delete ordered rules with:
Implementation approach
Keep the feature browser-side and use Stormbox’s existing authenticated JMAP connection, SharedWorker, and durable mutation outbox:
Acceptance criteria
Initial non-goals