Rules
Philosophy
Section titled “Philosophy”Rules are data first. mxr lets you inspect, dry-run, enable, disable, and audit them before trusting them on live sync traffic.
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 historyThe Rules page gives you:
- Rule list on the left
- Guided workspace on the right
- Overview, History, Dry Run, and Edit states
- Multiline condition/action editing
- Starter examples and validation help in the form flow
Open it from:
3Ctrl-pthenOpen Rules Page
Common actions:
n: new ruleE: edit rulee: enable or disableD: dry-runH: historyEnter: refresh overview for the selected ruleCtrl-s: save the current form#: delete
Supported actions
Section titled “Supported actions”archivetrashstarmark-readmark-unreadadd-label:NAMEremove-label:NAMEshell:COMMAND
Runtime behavior
Section titled “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
Section titled “Recommended workflow”- Create a rule with
mxr rules addornin the TUI. - Validate it with
mxr rules validate. - Dry-run it before save or enable.
- Let sync execute it automatically.
- Inspect
mxr rules historyor the Rules history pane if anything looks off.