- Created by Documentation, last modified on Jan 09, 2019
cPanel Tags
(deprecated)
Bandwidth:: displaybwheader
Bandwidth:: displaybw
Bandwidth:: displayday
Bandwidth:: displaymainbwheader
BoxTrapper:: changestatus
BoxTrapper:: cleancfgfilelist
BoxTrapper:: editmsg
BoxTrapper:: fetchcfgfile
BoxTrapper:: getboxconfdir
BoxTrapper:: listmsgs
BoxTrapper:: logcontrols
BoxTrapper:: messageaction
BoxTrapper:: multimessageaction
BoxTrapper:: resetmsg
BoxTrapper:: savecfgfile
BoxTrapper:: saveconf
BoxTrapper:: showautowhitelist
BoxTrapper:: showemails
BoxTrapper:: showfromname
BoxTrapper:: showlog
BoxTrapper:: showmessage
BoxTrapper:: showqueue
BoxTrapper:: showqueuesearch
BoxTrapper:: showqueuetime
BoxTrapper:: status
BoxTrapper:: statusbutton
Branding:: file
Branding:: image
Branding:: killimg
Branding:: setbrandingpkg
Branding:: setmyacctspkg
Branding:: setupdirs
Branding:: tempsetbrandingpkg
Chkservd:: geteximport
Chkservd:: geteximport_ssl
ClamScanner:: bars
cPAddons:: mainpg
Cron:: crontab_perms
CustInfo:: getemail
DiskUsage:: showmanager
Email:: addautoresponder
Email:: adddforward
Email:: addfilter
Email:: addlist
Email:: addmx
Email:: addpop
Email:: addspam
Email:: addspambox
Email:: addspamfilter
Email:: changemx
Email:: checkfastmail
Email:: checkpipefwd
Email:: clearspambox
Email:: delautoresponder
Email:: deldforward
Email:: delfilter
Email:: dellist
Email:: delmx
Email:: delpop
Email:: delspam
Email:: delspambox
Email:: disable_spam_autodelete
Email:: editquota
Email:: enable_spam_autodelete
Email:: getaging
Email:: getarsbody
Email:: getarscharset
Email:: getarsfrom
Email:: getarshtml
Email:: getarsinterval
Email:: getarsstart
Email:: getarsstop
Email:: getarssubject
Email:: getmailserver
Email:: getmailserveruser
Email:: getpopquota
Email:: has_spam_as_acl
Email:: has_spam_autodelete
Email:: listmaildomains
Email:: listmaildomainsopt
Email:: listmaildomainsoptndef
Email:: mainacctdiskused
Email:: passwdlist
Email:: passwdpop
Email:: setmxaccept
Email:: spamboxstatus
Email:: spamstatus
Email:: tracefilter
Fileman:: changeperm
Fileman:: delfile
Fileman:: dofileop
Fileman:: emptytrash
Fileman:: extractfile
Fileman:: fileimg
Fileman:: fmmkdir
Fileman:: fmmkfile
Fileman:: fmpushfile
Fileman:: fmrename
Fileman:: fmsavefile
Fileman:: fmsavehtmlfile
Fileman:: fullbackup
Fileman:: getfile
Fileman:: htmleditor
Fileman:: killdir
Fileman:: listfiles
Fileman:: listfullbackups
Fileman:: listtemplates
Fileman:: restoreaf
Fileman:: restoredb
Fileman:: restorefile
Fileman:: restorefiles
Fileman:: savehtmlfile
Fileman:: showperm
Fileman:: uploadfiles
Fileman:: viewfile
Ftp:: addftp
Ftp:: delftp
Ftp:: ftpquota
Ftp:: ftpservername
Ftp:: ftpstatslogin
Ftp:: get_anonftp
Ftp:: get_anonftpin
Ftp:: get_welcomemsg
Ftp:: getftpquota
Ftp:: kill_ftp_session
Ftp:: listftpstatsurl
Ftp:: passwdftp
Ftp:: set_anonftp
Ftp:: set_anonftpin
Ftp:: set_welcomemsg
Htaccess:: checkprotected
Htaccess:: del_user
Htaccess:: getindex
Htaccess:: htdirls
Htaccess:: number_of_users
Htaccess:: phpselectable
Htaccess:: resname
Htaccess:: set_pass
Htaccess:: set_protect
Htaccess:: setindex
Htaccess:: setphpreference
Htaccess:: showusers
ImageManager:: convert
ImageManager:: dimensions
ImageManager:: hdimension
ImageManager:: scale
ImageManager:: thumbnail
ImageManager:: wdimension
LastLogin:: lastlogin
LeechProtect:: disable
LeechProtect:: enable
LeechProtect:: setup
LeechProtect:: showpasswdfile
LeechProtect:: status
MagicRevision:: uri
Mime:: add_handler
Mime:: add_hotlink
Mime:: add_mime
Mime:: add_redirect
Mime:: del_handler
Mime:: del_hotlink
Mime:: del_mime
Mime:: del_redirect
Mime:: linkallownull
Mime:: linkenable
Mime:: linkexts
Mime:: linkrurl
Mime:: linkurls
Mysql:: adddb
Mysql:: addhost
Mysql:: adduser
Mysql:: adduserdb
Mysql:: checkdb
Mysql:: deldb
Mysql:: delhost
Mysql:: deluser
Mysql:: deluserdb
Mysql:: gethost
Mysql:: initcache
Mysql:: listdbs
Mysql:: listdbsopt
Mysql:: listusers
Mysql:: listusersopt
Mysql:: number_of_dbs
Mysql:: number_of_users
Mysql:: repairdb
Mysql:: routines
Mysql:: updateprivs
News:: displaynews
NVData:: set
Postgres:: adddb
Postgres:: adduser
Postgres:: adduserdb
Postgres:: deldb
Postgres:: deluser
Postgres:: deluserdb
Postgres:: initcache
Postgres:: listdbsopt
Postgres:: listusersopt
Postgres:: number_of_dbs
Postgres:: number_of_users
ProxyUtils:: proxyaddress
Resellers:: accountlistopt
Resellers:: themelistopt
Serverinfo:: servicestatus
SetLang:: listlangsopt
SetLang:: setlang
SpamAssassin:: config
SpamAssassin:: saveconfig
SSH:: getport
SSL:: delete
SSL:: deletecrt
SSL:: deletecsr
SSL:: deletekey
SSL:: gencrt
SSL:: gencsr
SSL:: genkey
SSL:: getcabundle
SSL:: getcnname
SSL:: install
SSL:: installedhost
SSL:: listkeysopt
SSL:: showcrt
SSL:: showcsr
SSL:: showkey
SSL:: sslsharedstatus
SSL:: uploadcrt
SSL:: uploadkey
StatManager:: doForm
StatManager:: updateUserConfig
Stats:: analoglist
Stats:: awstats
Stats:: bwbar
Stats:: errlog
Stats:: lastvisitors
Stats:: showbandwidth
Stats:: webalizer
Stats:: webalizerftp
SubDomain:: addsubdomain
SubDomain:: cplistsubdomains
SubDomain:: disablesubrd
SubDomain:: listsubdomainsop
SubDomain:: setsuburl
Description
This function adds an account-wide email filter.
Warnings:
- We removed this function in cPanel & WHM version 70. You cannot run this function in cPanel & WHM version 70 or later. The function will fail and it may not provide an error message.
- cPanel API 1 is deprecated. Do not use this function. Instead, we strongly recommend that you use the following newer functions:
- UAPI (recommended) —
Email::store_filter
— This function creates a new email filter. - cPanel API 2 —
Email::storefilter
— This function creates an email filter.
- UAPI (recommended) —
Examples
$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.
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 Module="Email::addfilter( $FORM('match value','method','msgpart','dest') )">
cpapi1 --user=username Email addfilter match "This email is filtered." contains message_body filtered@example.com
Notes:
- You must URI-encode these values.
username
represents your account-level username.- For more information and additional output options, read our Guide to cPanel API 1 documentation or run the
cpapi1 --help
command. If you run CloudLinux™, you must use the full path of the
cpapi1
command:/usr/local/cpanel/bin/cpapi1
This function does not return output.
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
match value | string or integer | Required The value for which to search. | Any valid string or integer. | This email is filtered. |
method | string | Required The matching type.
| Numeric operators:
String operators:
| contains |
msgpart | string | Required The email message section to search. |
| message_body |
dest | string | Required The destination to which the system sends email messages that match this filter's criteria. |
| filtered@example.com |
Returns
This function does not return output.
Function information
Module:
Email
API Version:
Available in:
cPanel version 68 and earlier.
Methods:
GET, POST
Required Parameters:
match
value
, method
, msgpart
, dest
Return Formats:
(none)
About this module
The Email
module modifies cPanel email account settings.
About cPanel API 1
Warning:
cPanel API 1 is deprecated. We strongly recommend that you use cPanel API 2 or UAPI instead.
Notes:
- These functions may require a feature list. To view the available feature lists on a cPanel server, view WHM's Feature Manager interface.
- Unless you call this API via the WHM API, you must use the appropriate cPanel ports (
2082
or2083
). You can also call some functions via cPanel's Webmail ports (2095
or2096
).
Find a function
Related functions
-
Page:cPanel API 1 Functions - Email::addautoresponder — This function creates an autoresponder for an email account.
-
Page:cPanel API 1 Functions - Email::adddforward — This function adds a domain-level email forwarder.
-
Page:cPanel API 1 Functions - Email::addlist — This function adds a Mailman mailing list.
-
Page:cPanel API 1 Functions - Email::addspam — This function enables Apache SpamAssassin™ for a cPanel account.
-
Page:cPanel API 1 Functions - Email::addspamfilter — This function modifies the minimum Apache SpamAssassin™ spam score.