Get filters¶
Fetch all sieve (message) filters
- HTTP Method:
GET
- URL:
https://example.domain.tld/api/v1/sieve_filters/
- Require authentication:
Yes
- Permission level required:
MailUser
Response parameters¶
Parameter | Type | Description |
---|---|---|
sieve_filters | list | List of all sieve filters |
filter_position | int | Filter position from 1 to 99 |
filter_name | str | Friendly name (identifier) of filter |
match_type | str | all_rules / any_rule / all_messages |
rules | list | List of rules to be matched |
search_property | str | Size OR any header like Subject / From / To / Cc / X-Spam |
search_type | str | contains / does_not_contain / is / is_not OR greater_than / less_than for search_property : Size |
search_term | str/int | Search term as string; integer (KB) for search_property : Size |
actions | list | List of actions to be carried out |
perform_action | str | move / copy / keep / forward / keep_and_forward / reject / discard / stop |
action_arg | str | Action argument; mailbox folder name for move / copy , email address for forward / keep_and_forward , reject reason for reject , empty string for others |
status | str | Status |
Example request (Python)¶
import requests
import json
from pprint import pprint
url = "https://example.domain.tld/api/v1/sieve_filters/"
r = requests.get(url, auth=("u1@vonmail.com","long-auth_token-here"))
try:
pprint(r.json())
except:
print(r.text)
Example response (JSON)¶
{'sieve_filters': [{'actions': [{'action_arg': 'This message seems like spam and '
'I refuse to accept it.',
'perform_action': 'reject'}],
'filter_name': 'My filter 1',
'filter_position': 1,
'match_type': 'any_rule',
'rules': [{'search_property': 'Subject',
'search_term': 'jackpot',
'search_type': 'contains'}],
'status': 'enabled'}]}