Cloud-based email filters process your sensitive messages on third-party servers. Local filtering runs entirely on your machine — your email content never leaves your device to be evaluated.
Here’s how cji.email implements a complete local rules engine with multi-condition boolean logic, multiple actions per rule, and portable JSON backups.
Rule Anatomy: Conditions, Strategies, and Actions
Every filter rule is composed of three parts:
1. Conditions
Each condition targets a specific part of the email:
| Field | Operators Available |
|---|---|
From (sender) | contains, notContains, equals, notEquals, startsWith, endsWith |
To (recipient) | contains, notContains, equals, notEquals, startsWith, endsWith |
Subject | contains, notContains, equals, notEquals, startsWith, endsWith |
Body | contains, notContains |
2. Matching Strategy
| Strategy | Behavior | Best Used For |
|---|---|---|
| AND | All conditions must match | Precise targeting (e.g. sender = boss@co.com AND subject starts with [URGENT]) |
| OR | Any single condition triggers the rule | Broad grouping (e.g. multiple newsletter senders) |
3. Actions
When a rule matches, one or more actions execute:
- Move to Folder — routes to any IMAP folder, including Kanban columns like
Kanboard/ToDo - Mark as Read — suppresses unread badge
- Mark as Important — flags with star
- Delete — trashes or permanently deletes based on your settings
Rule Execution at Sync Time
Rules run immediately when new messages arrive during IMAP sync. For each incoming message, the engine evaluates every active rule in order:
New message synced
→ Rule 1: Evaluate conditions (AND/OR)
Match → Execute actions (move, mark read, flag)
→ Rule 2: Evaluate conditions
No match → Skip
→ Rule 3: ...
→ Store final message state in IndexedDB
→ IMAP sync confirms server-side folder moves
Because rules execute locally, they have access to your full folder tree and complete offline cache. Folder moves are queued as IMAP operations and synced back to the server, keeping your other email clients in sync.
Portable Rule Backups
Filter rules are stored locally. To migrate them to another machine:
Export: Generates a JSON file with all rule conditions, strategies, and actions. Passwords and account credentials are never included.
Import: Reads the JSON schema, validates each rule, and merges it with the active rule set. Duplicate rule IDs are overwritten; new rules are appended.
This makes it trivial to share a standard rule set across a team or back up your configuration before wiping a machine.
Creating Your First Rule
- Go to Settings → Filters.
- Click Create New Rule.
- Set the name, target account, and matching strategy.
- Add conditions (e.g.
Fromcontainsnewsletter). - Add actions (e.g.
Move to Folder→Kanboard/Done,Mark as Read). - Click Save.
The rule activates immediately for the next sync cycle.