Preview a Proton Sieve filter
preview_sieve_filterPreview a Proton Sieve filter for incoming mail and return its exact script without changing anything, so users can add the rule in Proton’s filter settings.
Instructions
Preview one Proton Sieve filter for new incoming mail and return its exact script; changes nothing.
Use it when the user wants Proton itself to file mail as it arrives. With Proton Mail Bridge, apply.available is false and create_sieve_filter refuses: show the script for the user to add in Proton's own filter settings (Add sieve filter), and do not call create_sieve_filter. For a rule this server applies to INBOX, use preview_add_rule; to move mail already received, preview_action.
conditions are 1 to 10 objects such as {"field": "from", "contains": "example.test"}; from and to match the address, subject the header, case-insensitively, and match="any" needs only one. Filters only file into folder and mark read only with mark_read=true; they never delete, discard, forward or reply, and never run on spam.
Returns the normalized filter, fileinto, the exact script, script_sha256, apply, a single-use token for create_sieve_filter (unusable on Bridge), expires_at and action_hash. A folder that is not an existing Folders/ name refuses.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | A name for the filter, at most 100 characters. | |
| match | No | all needs every condition to match; any needs one. | all |
| folder | Yes | An existing real Folders/ name, as search_mail reports it. | |
| mark_read | No | Also mark matching mail read. | |
| conditions | Yes | 1 to 10 objects, each {"field": "from"|"to"|"subject"} plus exactly one of contains or is. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||