{"id":431,"date":"2021-07-23T12:29:42","date_gmt":"2021-07-23T12:29:42","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/how-to-configure-email-filters\/"},"modified":"2021-07-23T12:29:42","modified_gmt":"2021-07-23T12:29:42","slug":"how-to-configure-email-filters","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/how-to-configure-email-filters\/","title":{"rendered":"How to Configure Email Filters"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"overview\">Overview<\/h2>\n<p>Email filters use the criteria that you specify to determine how to handle email messages. The following cPanel interfaces allow you to configure email filters:<\/p>\n<ul>\n<li>\n<p>The <em>Global Email Filters<\/em> interface (<em>cPanel &gt;&gt; Home &gt;&gt; Email &gt;&gt; Global Email Filters<\/em>) \u2014 Global email filters affect the cPanel account\u2019s email addresses.<\/p>\n<\/li>\n<li>\n<p>The <em>Email Filters<\/em> interface (<em>cPanel &gt;&gt; Home  &gt;&gt; Email &gt;&gt; Email Filters<\/em>) \u2014 User-level filters affect specific email addresses on the cPanel account.<\/p>\n<\/li>\n<\/ul>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n        We <strong>strongly<\/strong> recommend that you use multiple, simple filters instead of a single large filter. Exim, the server\u2019s mail transfer agent, handles many small rules more efficiently than a single large rule.\n    <\/div>\n<\/div>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        In these interfaces, click <code>+<\/code> to add a rule, or click <code>-<\/code> to remove rules.\n    <\/div>\n<\/div>\n<h2 id=\"filter-rules-and-criteria\">Filter rules and criteria<\/h2>\n<p>The first set of options specifies which part of the email message the system examines to determine whether the message matches your filter parameters.<\/p>\n<p>You can choose from the following options:<\/p>\n<ul>\n<li><em>From<\/em> \u2014 The message sender\u2019s address.<\/li>\n<li><em>Subject<\/em> \u2014 The message\u2019s subject line.<\/li>\n<li><em>To<\/em> \u2014 The address to which the sender sent the message.\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        Generally, the recipient does <strong>not<\/strong> receive the BCC field in an email\u2019s header. For this reason, you <strong>cannot<\/strong> use the BCC field in a filter.\n    <\/div>\n<\/div>\n<\/li>\n<li><em>Reply Address<\/em> \u2014 The address at which the sender receives replies.<\/li>\n<li><em>Body<\/em> \u2014 The message\u2019s content.<\/li>\n<li><em>Any Header<\/em> \u2014 Any Header refers to any part of the header in an email, including: <em>To<\/em>, <em>From<\/em>, <em>Envelope-To<\/em>, <em>Content-Type<\/em>, etc.<\/li>\n<li><em>Any recipient<\/em> \u2014 Any recipient of the message.<\/li>\n<li><em>Has not been previously delivered<\/em> \u2014 The system <strong>only<\/strong> examines messages that remain in the queue for delivery.<\/li>\n<li><em>is an Error Message<\/em> \u2014 The system <strong>only<\/strong> examines error messages that an auto-response system sends.<\/li>\n<li><em>List ID<\/em> \u2014 The account\u2019s mailing lists.<\/li>\n<li><em>Spam Status<\/em> \u2014 Whether Apache SpamAssassin\u2122 marked the message as spam. The <em>Spam Status<\/em> line begins with <code>Yes<\/code> or <code>No<\/code>.<\/li>\n<li><em>Spam Bar<\/em> \u2014 The content of the <em>Spam Bar<\/em> header that Apache SpamAssassin generated for this message. The more plus signs (<code>+<\/code>) that Apache SpamAssassin assigns to a message, the greater the likelihood that the system marks the message as spam.<\/li>\n<li><em>Spam Score<\/em> \u2014 The total number of plus signs (<code>+<\/code>) in the <em>Spam Bar<\/em> value, expressed as an integer. For more information about the <em>Spam Score<\/em> option, read the Spam Score section below.<\/li>\n<\/ul>\n<h3 id=\"operators\">Operators<\/h3>\n<p>After you select the portion of the email message that the system will examine, select the type of comparison between that portion of the email and the criteria that you enter.<\/p>\n<p>You can choose from the following options:<\/p>\n<ul>\n<li><em>equals<\/em> \u2014 The message exactly matches a defined string.<\/li>\n<li><em>matches regex<\/em> \u2014 The message matches a regular expression that you define.\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        The filter text box accepts regular expressions when you select this option, rather than commonly-used wildcard characters (for example, <code>*<\/code> or <code>?<\/code>).\n    <\/div>\n<\/div>\n<\/li>\n<li><em>contains<\/em> \u2014 The message a string that you define.<\/li>\n<li><em>does not contain<\/em> \u2014 The message does <strong>not<\/strong> contain the defined string.<\/li>\n<li><em>begins with<\/em> \u2014 The message begins with the defined string.<\/li>\n<li><em>ends with<\/em> \u2014 The message ends with the defined string.<\/li>\n<li><em>does not begin<\/em> \u2014 The message does <strong>not<\/strong> begin with the defined string.<\/li>\n<li><em>does not end with<\/em> \u2014 The message does <strong>not<\/strong> end with the defined string.<\/li>\n<li><em>does not match<\/em> \u2014 The message does <strong>not<\/strong> exactly match the defined string.<\/li>\n<\/ul>\n<h3 id=\"spam-score\">Spam Score<\/h3>\n<p>The following options are <strong>only<\/strong> applicable when you select the <em>Spam Score<\/em> option:<\/p>\n<ul>\n<li><em>is above (#s only)<\/em> \u2014 The message\u2019s Spam Score is greater than the number that you define.<\/li>\n<li><em>is not above (#s only)<\/em> \u2014 The message\u2019s Spam Score is equal to or less than the number that you define.<\/li>\n<li><em>is below (#s only)<\/em> \u2014 The message\u2019s Spam Score is less than the number that you define.<\/li>\n<li><em>is not below (#s only)<\/em> \u2014 The message\u2019s Spam Score is greater than or equal to the number that you define.\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<p>When you create a filter that uses several operators, the system processes the and operator <strong>before<\/strong> the <code>or<\/code> operator. For example:<\/p>\n<ul>\n<li>The system processes <code>A or B and C<\/code> as <code>A or (B and C)<\/code>.<\/li>\n<li>The system processes <code>A and B or C<\/code> as <code>(A and B) or C<\/code>.<\/li>\n<\/ul><\/div>\n<\/div>\n<\/li>\n<\/ul>\n<h3 id=\"criteria\">Criteria<\/h3>\n<p>Enter the criteria to use in the text box under the <em>Rules<\/em> menus. The type of data that you enter determines the comparison that the system performs.<\/p>\n<p>For example, if you select the <em>From<\/em> and <em>Equals<\/em> filters, enter <code>user@example.com<\/code> as the criteria. The system determines that any email from <code>user@example.com<\/code> matches the filter, but does <strong>not<\/strong> match <code>seconduser@example.com<\/code> because it contains additional letters.<\/p>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n        Exim converts newlines into spaces in the <code>$message_body<\/code> field. Do <strong>not<\/strong> add <code>n<\/code> characters to any body filters that you create.\n    <\/div>\n<\/div>\n<h3 id=\"multiple-rules\">Multiple rules<\/h3>\n<p>To create additional rules for a filter, click a plus symbol to the right of a rule. A new option menu, operator menu, and criteria text box will appear on the interface.<\/p>\n<p>To delete a rule, click the minus symbol to the right of that rule. The system will remove that rule from the interface.<\/p>\n<p>Select how the system processes the list of rules with the <em>or<\/em> menu to the right of the  rules:<\/p>\n<ul>\n<li><em>or<\/em> \u2014 Any rule in the list must be true for the system to perform the actions.<\/li>\n<li><em>and<\/em> \u2014 All rules in the list must be true for the system to perform the actions.<\/li>\n<\/ul>\n<h2 id=\"actions\">Actions<\/h2>\n<p>When cPanel determines that an email message matches your filter, it handles that message with the any of the following actions that you specify:<\/p>\n<ul>\n<li><em>Discard Message<\/em> \u2014 The system discards the incoming message with no failure notice.<\/li>\n<li>\n<p><em>Redirect to email<\/em> \u2014 The system forwards the message to another email address that you specify. <\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        This action does <strong>not<\/strong> retain a copy of the message in the mailbox. To retain a copy of the message in the inbox and forward it to another address, add a <em>Deliver to folder<\/em> action to the filter <strong>and<\/strong> set it to deliver it to the <em>INBOX<\/em> folder.\n    <\/div>\n<\/div>\n<\/li>\n<li>\n<p><em>Fail with message<\/em> \u2014 The system discards the message and automatically send a failure notice to the sender.<\/p>\n<\/li>\n<li>\n<p><em>Stop Processing Rules<\/em> \u2014 The system stops performing further actions or applying any remaining filters on this message.<\/p>\n<\/li>\n<li>\n<p><em>Deliver to folder<\/em> \u2014 The system delivers the message to a specified folder.<\/p>\n<\/li>\n<li>\n<p><em>Pipe to a program<\/em> \u2014 The system sends the incoming message to a specified program. For more information, read the Pipe to a Program section below.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"pipe-to-a-program\">Pipe to a Program<\/h3>\n<div class=\"callout callout-warning\">\n<div class=\"callout-heading\">Important:<\/div>\n<div class=\"callout-content\">\n<ul>\n<li>Make <strong>certain<\/strong> that your script uses the proper file permissions (<code>0700<\/code>). To change your script\u2019s file permissions, run the <code>chmod 0700 myscript.php<\/code> command, where <code>myscript.php<\/code> represents your script\u2019s location and file name.<\/li>\n<li>This option <strong>only<\/strong> appears if your hosting provider enables it.<\/li>\n<\/ul><\/div>\n<\/div>\n<p>Use the <em>Pipe to a Program<\/em> option to parse and enter email information into a different system. For example, use the <em>Pipe to a Program<\/em> option to pipe email information to a program that enters email information into a ticket system.<\/p>\n<ul>\n<li>STDIN pipes email and headers to the program.<\/li>\n<li>Pipes can accept variables from the <code>$_SERVER<\/code> array and variables on the command line.<\/li>\n<li>The language or environment that you use may cause memory limit issues.<\/li>\n<li>If your script produces any output, even a blank line, the system will create a bounce message that contains that output.<\/li>\n<\/ul>\n<p>When you use the <em>Pipe to a Program<\/em> option, enter a path that is relative to your home directory. For example, to use the <code>\/home\/user\/script.pl<\/code> script, enter <code>script.pl<\/code> in the <em>Pipe to a Program<\/em> text box, where <code>user<\/code> represents your username.<\/p>\n<div class=\"callout callout-info\">\n<div class=\"callout-heading\">Note:<\/div>\n<div class=\"callout-content\">\n        If you use PHP, make certain that you appropriately wrap your code in start and end tags.\n    <\/div>\n<\/div>\n<h3 id=\"multiple-actions\">Multiple actions<\/h3>\n<p>To create additional actions for a rule, click a plus symbol to the right of an action. A new action menu will appear on the interface.<\/p>\n<p>To delete an additional action, click the minus symbol to the right of the action. The system will remove that action from the interface.<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Overview Email filters use the criteria that you specify to determine how to handle email messages. The following cPanel interfaces allow you to configure email filters: The Global Email Filters interface (cPanel &gt;&gt; Home &gt;&gt; Email &gt;&gt; Global Email Filters) \u2014 Global email filters affect the cPanel account\u2019s email addresses. The Email Filters interface (cPanel &hellip;<\/p>\n","protected":false},"author":1,"featured_media":432,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/431"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=431"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/431\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/432"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}