cPanel API 1 Functions - Email::tracefilter

Description

This function tests an account's email filters.

Notes:

  • This function only tests filters for a cPanel account's main domain that search the body of email messages.
  • In cPanel & WHM version 11.50 and later, if the domain or account does not contain a filter file, this function will fail.

Warning:

cPanel API 1 is deprecatedDo not use this function. Instead, we strongly recommend that you use the following newer functions: 

Examples 


 LiveAPI PHP Class

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$test_email_filter = $cpanel->api1('Email', 'tracefilter', array('user@example.com', 'This email is filtered.') ); // Call the function.

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $test_email_filter = $cpliveapi->api1('Email', 'tracefilter', ['user@example.com', 'This email is filtered.'] ); # Call the function.

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. This example is present in order to help developers move from the old cPanel tag system to our LiveAPI.

We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

 

<cpanel Module="Email::tracefilter( $FORM('account','msg') )">

 Command Line

cpapi1 --user=username Email tracefilter msg='This email is filtered.' email=user@example.com

Notes:

  • You must URI-encode these values.
  • username represents your account-level username.

 Output (plaintext)

This function returns a message of success or failure, the name of the file that the function examined, and the destination of the filter.  

Parameters

 Parameter 

Type

Description

Possible values

Example

 account

 string 

 The name of the email account.

 Note:

 This function tests old-style cPanel filters in the account's /home/filters directory only

 If you do not specify a value, the function tests the main domain's filters in the /etc/vfilters/directory.

 An email account on the server. 

 user@example.com

 msg

 string

 Required

 The string to test filters against.

 Any string.

 This email is filtered. 

 

Returns

This function returns a message of success or failure, the name of the file that the function examined, and the destination of the filter.

 

  • 9 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....