UAPI Functions - Email::reorder_filters

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

 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',
         )
);

 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',
    }
);

 cPanel Template Toolkit

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

 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.

 Output (JSON)

{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": null,
  "metadata": {
    "transformed": 1
  }
}

 

Note:

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

 

Parameters

 Parameter 

 Type 

Description

Possible values

Example

mailbox

 string 

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.

 

  • 11 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....