Add Mail Rule
add_mail_ruleAdd an inbound filtering rule to a mailbox. If a message matches (by from/to/subject/body), the action runs: drop, mark_read, forward (to action_arg), webhook_only (skip forward-to), or label (with action_arg). Rules run in priority order (lower first); first match wins. API: POST /api/emails/{address}/rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | Yes | Mailbox slug | |
| action | Yes | What to do on match | |
| domain | Yes | Mailbox domain | |
| enabled | No | Default true | |
| match_op | Yes | How to match | |
| priority | No | Lower runs first (default 0) | |
| action_arg | No | For 'forward': the destination email. For 'label': the label value. | |
| match_field | Yes | Which field to match on | |
| match_value | Yes | The value/pattern to match |