Add visual JMAP Sieve mail rules - #129
Draft
BYK wants to merge 13 commits into
Draft
Conversation
Adds the managed rule model, browser editor, RFC 9661 persistence path, and test coverage. Existing external scripts remain preserved unless the user explicitly confirms activation.
Treat executable Sieve as authoritative, edit fully representable active scripts in place, and preserve unsupported scripts. Add recursive condition groups, guarded source projection, and keyboard-accessible controls.
Use a non-reserved label prop for custom selects and make Sieve call-test narrowing explicit.
Member
|
I haven't reviewed this at all yet but one thing that comes to mind is: |
Author
|
@Sancus that's also what I was concerned about. The initial implementation was only touching if we knew it was us or it was empty. The new, updated implementation uses an AST instead to parse it out and map to UI components as long as that's possible and bail out (read: do not modify) if we cannot. I'll be reviewing the code soon myself, just tested it in real life and seems to be working well with my limited experience and account. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the managed rule model, browser editor, RFC 9661 persistence path, and test coverage. Existing external scripts remain preserved unless the user explicitly confirms activation.
Disclaimer: This PR is AI-assisted and I'm keeping it as draft until I give it a full review myself first.
What changed?
Adds a browser-side visual editor for creating and managing server-side mail rules through JMAP for Sieve.
This prototype was developed collaboratively with OpenAI Codex. I defined the product scope and architecture, reviewed the iterations, and live-tested the result; Codex produced most of the implementation.
Why?
Server-side rules remain active when Stormbox is closed and behave consistently across clients. Thundermail already exposes the necessary Sieve capability, but Stormbox does not currently provide an accessible way to use it.
Related discussion: https://ideas.tb.pro/p/visual-server-side-mail-rules-using-jmap-sieve
How?
Rules are represented as a typed, versioned model and compiled into a limited Sieve subset. Stormbox reuses its existing authenticated JMAP connection and durable mutation pipeline, validates generated scripts before activation, detects concurrent changes, and preserves scripts managed by other clients.
Limitations and Notes
The initial scope intentionally excludes raw Sieve editing, arbitrary-script import, retroactive filtering, and shared-account management.
The prototype has been exercised against a live Thundermail account. Automated compiler, component, sync, and local-stack end-to-end coverage is included.
Applicable Issues
Closes #128
Screenshots