Rules
Philosophy
Rules are data first. mxr lets you inspect, dry-run, enable, disable, and audit them before trusting them on live sync traffic.
CLI
mxr rulesmxr rules show RULE_IDmxr rulesmxr rules add "Archive newsletters" --when "label:newsletters unread" --then archivemxr rules edit RULE_ID --then mark-read --disablemxr rules validate --when "from:billing@example.com" --then "add-label:finance"mxr rules enable RULE_IDmxr rules disable RULE_IDmxr rules delete RULE_IDmxr rules dry-run RULE_IDmxr rules dry-run --allmxr rules historyTUI
The Rules page gives you:
- Rule list
- Details panel
- History panel
- Dry-run panel
- Form-driven create and edit flows
Open it from:
Ctrl-pthenOpen Rules Page
Common actions:
n: new ruleE: edit rulee: enable or disableD: dry-runH: history#: delete
Supported actions
archivetrashstarmark-readmark-unreadadd-label:NAMEremove-label:NAMEshell:COMMAND
Runtime behavior
- Rules run after sync writes messages locally.
- Matching is deterministic and priority ordered.
- Execution history is stored in SQLite.
- Shell hooks are opt-in escape hatches, not the foundation.
- Sync-time execution and dry-run share the same rule model.
Recommended workflow
- Create a rule with
mxr rules add. - Validate it with
mxr rules validate. - Check impact with
mxr rules dry-run. - Let sync execute it automatically.
- Inspect
mxr rules historyif anything looks off.