Description

This function modifies email filter order.


We strongly recommend that you use the following UAPI function instead of this function:

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=reorderfilters&mailbox=user@example.com&filter1=coffee&filter2=cheesecloth



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Modify filter order for user@example.com's mail filters.
$change_filter_order = $cpanel->api2(
    'Email', 'reorderfilters', 
    array(
        'mailbox'         => 'user@example.com',
        'filter1'         => 'coffee',
        'filter2'         => 'cheesecloth',
    ) 
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Modify filter order for user@example.com's mail filters.
my $change_filter_order = $cpliveapi->api2(
    'Email', 'reorderfilters',
    { 
        'mailbox'         => 'user@example.com',
        'filter1'         => 'coffee',
        'filter2'         => 'cheesecloth',
    }
);




cpapi2 --user=username Email reorderfilters mailbox=user%40example.com filter1=coffee filter2=cheesecloth



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "reorderfilters",
    "data": [
      {
        "ok": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Email"
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
mailboxstring

Required

The email address.

A valid email address on the account.

user@example.com
filter*string

Required

A mail filter.

For each mail filter to reorder, supply a filter* parameter, where * represents a number that represents the filter's order.

For example, to set coffee as the first email filter and cheesecloth as the second, set coffee as the filter1 parameter's value, and cheesecloth as the filter2 parameter's value.


The name of one of the email address's filters.

coffee

Returns

ReturnTypeDescriptionPossible valuesExample
okBooleanWhether the function succeeded.
  • 1 — The function succeeded.
  • 0 — The function failed.
1
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1