Child pages
  • cPanel API 1 Functions - Email::tracefilter

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function tests an account's email filters.


Note
titleNotes:
  • 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
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended) Email::trace_filter
    Excerpt Include
    DD:UAPI Functions - Email::trace_filterDD:
    UAPI Functions - Email::trace_filter
    nopaneltrue
  • cPanel API 2 Email::tracefilter
    Excerpt Include
    DD:cPanel API 2 Functions - Email::tracefilterDD:
    cPanel API 2 Functions - Email::tracefilter
    nopaneltrue

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledReceiveMailRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$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.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

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



Expand
titleCommand Line


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

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (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

ParameterTypeDescriptionPossible valuesExample
account

string

The name of the email account.

Note
titleNote:

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.