Description
This function lists data for old-style email filters in the cPanel account's .filter
file.
Warning:
We strongly recommend that you use the following UAPI function instead of this function:
-
Email::list_filters
— This function lists account-level mail filters.
Examples
{
"cpanelresult": {
"apiversion": 2,
"func": "listfilters",
"data": [
{
"dest": "/dev/null",
"nicedest": "Discard",
"filter": "$h_X-Spam-Bar: contains "+++++""
},
{
"dest": "/dev/null",
"nicedest": "Discard",
"filter": "$header_subject: contains "coconut""
}
],
"event": {
"result": 1
},
"module": "Email"
}
}
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
This function does not accept parameters.
Returns
Return |
Type |
Description |
Possible values |
Example |
dest |
string |
The filtered mail's destination. |
|
/dev/null |
nicedest |
string |
The filter's action. |
A valid string. |
Discard |
filter |
string |
The filter's criteria. |
An email section, a match type, and the value to match. |
$h_X-Spam-Bar: contains "+++++" |
reason |
string |
A reason for failure. Note: This function onlyreturns a reasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
Boolean |
Whether the function succeeded. |
|
1 |