cPanel API 1 Functions - Email::addfilter

Description

This function adds an account-wide email filter.

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.
$new_email_filter $cpanel->api1('Email''addfilter'array('This email is filtered.''contains''message_body''filtered@example.com') ); // Call the function.

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $new_email_filter $cpliveapi->api1('Email''addfilter', ['This email is filtered.''contains''message_body''filtered@example.com'] ); # 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::addfilter( $FORM('match value','method','msgpart','dest') )">


 Output (none)

This function does not return output.

Parameters

 Parameter 

Type

Description

Possible values

Example

 match  value 

 string

 or

 integer 

 Required

 The string for which to search.

 Any valid string.

 This email is filtered.

 method

 string

 Required

 The matching type.

  • If the match valueparameter is an integer, use a numeric operator.
  • If the match valueparameter is not an integer, use a string operator.

 Numeric operators:

  • is above
  • is not above
  • is below
  • is not below
  • equals

 String operators:

  • contains
  • begins

 contains

 msgpart

 string

 Required

 The email message section to search.

  • header_from
  • header_subject
  • header_to
  • reply_address
  • message_body
  • message_headers
  • h_to
  • h_cc

 Note:

 Generally, the recipient does not receive the BCC field in an email's header. For this reason, you cannot use theBCC field in a  filter.

 

  • not delivered
  • error_message
  • h_X-Spam-Status
  • h_X-Spam-Score
  • h_X-Spam-Bar

 message_body

 dest

 string

 Required

 The destination to which the system sends email messages that match this filter's  criteria.

  • Any valid email address.
  • Discard
  • A pipe to a shell application.

 filtered@example.com

 

Returns

This function does not return output.

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