Description

This function tests an account's email filters.


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


Examples 




$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.



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 Module="Email::tracefilter( $FORM('account','msg') )">




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


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

ParameterTypeDescriptionPossible valuesExample
account

string

The name of the email account.

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
msgstring

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.