Skip to content

Add visual JMAP Sieve mail rules - #129

Draft
BYK wants to merge 13 commits into
thunderbird:mainfrom
BYK:feature/mail-rules-jmap-sieve
Draft

Add visual JMAP Sieve mail rules#129
BYK wants to merge 13 commits into
thunderbird:mainfrom
BYK:feature/mail-rules-jmap-sieve

Conversation

@BYK

@BYK BYK commented Sep 7, 2026

Copy link
Copy Markdown

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

image image

@Sancus

Sancus commented Sep 7, 2026

Copy link
Copy Markdown
Member

I haven't reviewed this at all yet but one thing that comes to mind is:
What happens when the Sieve rules are changed by some other Sieve client in a way this patch doesn't support? Does saving the rules again in Stormbox break everything, just those changes, or ?

@BYK

BYK commented Sep 8, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add visual server-side mail rules using JMAP Sieve

2 participants