Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function modifies the filter order for an email address.  For more information about Exim filters, read Exim's documentation.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Email/reorder_filters?mailbox=user%40example.com&filter0=coffee&filter1=cheesecloth&filter2=oil

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Reorder the filters for user@example.com.
$filter_order = $cpanel->uapi(
    'Email', 'reorder_filters',
    array(
        'mailbox'     => 'user@example.com',
        'filter0'     => 'coffee',
        'filter1'     => 'cheesecloth',
        'filter2'     => 'oil',
         )
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Reorder the filters for user@example.com.
my $filter_order = $cpliveapi->uapi(
    'Email', 'reorder_filters',
    {
        'mailbox'     => 'user@example.com',
        'filter0'     => 'coffee',
        'filter1'     => 'cheesecloth',
        'filter2'     => 'oil',
    }
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Reorder the filters for user@example.com. -->
[% execute( 'Email', 'reorder_filters', { 'mailbox' => 'user@example.com', 'filter0' => 'coffee', 'filter1' => 'cheesecloth', 'filter2' => 'oil', } ) %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username Email reorder_filters mailbox=user%40example.com filter0=coffee filter1=cheesecloth filter2=oil

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": null,
  "metadata": {
    "transformed": 1
  }
}

Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
mailboxstring

Required

The email address.

A valid email address on the cPanel account.

user@example.com
filter*string

Required

A mail filter name.

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

For each mail filter to reorder, supply a filter* parameter, where * is 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 value for the filter2 parameter.

coffee

Returns

This function only returns metadata.