> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langmail.me/llms.txt
> Use this file to discover all available pages before exploring further.

# preview_mail_rule

> Validate a proposed mail rule and estimate how much existing mail it would touch — without creating or changing anything.

Validates a proposed rule and reports its blast radius **without creating a rule or modifying any mail**: whether the rule is valid, warnings, how many existing messages and conversations currently match, and a plain-language summary of what would happen. Use it before [`create_mail_rule`](/reference/mcp/create-mail-rule) so the user can confirm — required practice before any large backfill.

## Parameters

Takes the same rule spec as `create_mail_rule`: optional `name`, `match` (`all`/`any`), `conditions`, `actions`, and an optional `existingMail` policy whose `scope` (`inbox` default, or `all`) decides where matches are counted.

## Example

```json Call theme={null}
{
  "name": "Archive GitHub Notifications",
  "conditions": { "from": "notifications@github.com" },
  "actions": [{ "type": "archive" }, { "type": "addTag", "tag": "GitHub" }],
  "existingMail": { "mode": "messages", "scope": "inbox" }
}
```

```text Result theme={null}
Rule is valid. Nothing was created or modified.

Would match when ALL of: sender contains "notifications@github.com"
Would then: archive, then add tag "github"

Approximately 184 existing Inbox message(s) match (92 conversation(s)).

To install it, call create_mail_rule with the same rule (add existingMail to also process the existing matches).
```

## Notes

* An invalid rule is reported in the result text (`Rule is INVALID: …`), not as a tool error — the question being asked is "would this work?".
* Counts above the 1000-message query window are reported as `1000+` (a lower bound).
* Warnings cover actions a backfill would skip (`forward`, `stopProcessing`) and the heuristic nature of `hasAttachment` matching.
