This function creates a new email filter. For more information about Exim filters, read Exim's documentation.
Important:
When you disable the Receive Mail role, the system disables this function.
You may create up to 4,096 separate sets of conditions in one filter. To do this, append numbers to the parameter names.
To create a filter with two sets of actions and conditions, use the following parameters:
action1
, dest1
, match1
, opt1
, part1
, and val1
parameters.action2
, dest2
, match2
, opt2
, part2
, and val2
parameters.To create a filter that uses one set of actions but two sets of conditions, use the following parameters:
action1
and dest1
parameters.match1
, opt1
, part1
, and val1
parameters.match2
, opt2
, part2
, and val2
parameters.required | string The filter's action.
Important:
action*=action1=deliver action2=save action*=deliver |
filtername required | string The filter name. Example: filtername=coffee |
required | string The filter's match type.
String operators:
Numeric operators:
Important: You must increment each match type. For example, pass the first match type as match*=match1=contains match2=matches match*=contains |
required | string The email section to query.
Important: You must increment each section. For example, pass the first section as Note: Generally, the recipient does not receive the part*=part1=$header_from part2=$message_body part*=$header_from |
required | string or integer The value to match. Important: You must increment each value. For example, pass the first value as val*=val1=coconut val2=12 val*=coconut |
account | string <email> The email address, for user-level filters. If you do not use this parameter, the function creates an account-level filter. Example: account=user@example.com |
string or string Default: "" The destination for filtered mail. Important:
dest*=dest1=user@example.com dest2=user2@example.com dest*=user@example.com | |
oldfiltername | string The name of an existing filter, to rename it. If you do not use this parameter, the function creates a new filter. Example: oldfiltername=pool |
string Default: "and" The connection between multiple conditions. Important: You must increment each connection. For example, pass the first connection as opt*=opt1=and opt2=and opt*=and |
uapi --output=jsonpretty \ --user=username \ Email \ store_filter \ filtername='coffee' \ action*='deliver' \ match*='contains' \ part*='$header_from' \ val*='coconut'
{- "apiversion": 3,
- "func": "store_filter",
- "module": "Email",
- "result": {
- "data": {
- "account": "user@example.com"
}, - "errors": null,
- "messages": null,
- "metadata": {
- "transformed": 1
}, - "status": 1,
- "warnings": null
}
}