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:

FieldOperators Available
From (sender)contains, notContains, equals, notEquals, startsWith, endsWith
To (recipient)contains, notContains, equals, notEquals, startsWith, endsWith
Subjectcontains, notContains, equals, notEquals, startsWith, endsWith
Bodycontains, notContains

2. Matching Strategy

StrategyBehaviorBest Used For
ANDAll conditions must matchPrecise targeting (e.g. sender = boss@co.com AND subject starts with [URGENT])
ORAny single condition triggers the ruleBroad 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

  1. Go to SettingsFilters.
  2. Click Create New Rule.
  3. Set the name, target account, and matching strategy.
  4. Add conditions (e.g. From contains newsletter).
  5. Add actions (e.g. Move to FolderKanboard/Done, Mark as Read).
  6. Click Save.

The rule activates immediately for the next sync cycle.