Email filters are useful to create rules to block unwanted emails, based on certain rules you choose. You can specify some rules like a message containing a specific word that should be deleted or passed to a specific program Or mails from a specific user must be discarded likewise we can define the rules for our email accounts for that.
1:login into cPanel.
2:Navigate into email filters under the email section where you can see the total list of email accounts in that cPanel.
We can assign rules to reach the account individually for that click on Manage filters on the right side of the email account.
3: After that you will be prompted to a window as shown below click on Create filter option to add a filter to your mail account.
4:After clicking creates a new filter you will be prompted to a window as shown below which helps us to create an email filter for your account.
You can enter a filter name as your wish and then select a rule accordingly
Then you need to select and a rule then appropriate criteria and also the action must be done.
Rules:
From: specifies the sender’s Email address.
Subject: specifies the subject line from any incoming Email message.
To: specifies the recipient’s Email address.
Reply: specifies the Email address at which the sender receives replies.
Body: specifies the entire content of the message.
Any Header: specifies any part of the message header.
Any Recipient: specifies any recipient of the message.
Has Not Been Previously Delivered: the server will only analyze messages that have remained in the delivery cue.
Is an Error Message: the server will only analyze error messages sent by auto-reply systems.
List-ID: will contain the mailing lists of the account.
Spam Status: whether the Apache Spam Assassin has marked the message as Spam. This option demands a string value of “YES” or “NO” in the value box.
Spam Bar: this is similar to a risk indicator. The more plus (+) sings the Spam Assassin attributes to a message, the more likely it is that it will be marked as Spam.
Spam Score: indicates the total number of (+) signs in the Spam Bar, expressed as a number.
Note:
in order for the Spam Status, Spam Bar and Spam Score to be available, you must make sure that the Apache Spam Assassin is enabled in your cPanel.
For checking wheater spam Assassin is enabled in your cPanel click on the spam filter from your cPanel dashboard.
After that, you will be able to see a window as shown below
After that please confirm wheater the Apache Spam Assassin option is enabled or not?
After selecting the rule select the appropriate criteria
Criteria:
•Contains: specifies a user-defined string to search for
•Matches regex: matches a user-defined regular expression
•Does not contain: the message does not contain a user-defined string
•Equals: the message is exactly the same as the entered string
•Begins with: the message begins with the defined string
•Ends with: the message ends with the defined string
•Does not begin: the message does not begin with the defined string
•Does not end with: the message does not end with the defined string
•Does not match: the message does not match the defined string
•Is above (numbers only): message value is above a given integer
•Is not above (numbers only): message value is not above a given integer
•Is bellow (numbers only): message value is below a given integer
•Is not bellow (numbers only): message value is not bellow a given integer
After selecting the rule and criteria choose the appropriate action for the rule
Action to be done:
Discard Message: it will automatically discard (drop) the message without a failure notice.
Redirect to Email: it will redirect (forward) the message to another user-defined Email account.
Fail With Message: the system will automatically discard the message and return a specific failure notice to the sender.
Stop Processing Rules: it will stop processing any further rules.
Deliver to Folder: it will move the message to a specified folder.
Pipe to a Program: it will send the message to a particular software or program.
For example, if you have selected the rule From, criteria as contains and mail id is example@domain.com and action as discard the message. The filter will discard all the emails from example@domain.com to our email account
You can add multiple rules to match subjects, addresses, or other parts of the message. You can then add multiple actions to take on a message such as to deliver the message to a different address and then discard it.
You can also set an email filter via the global email filter interface the only difference is that in the global email interface the filter that you have created must be applicable to all email accounts under the cPanel and in the user
email filter we can set filter to individual email accounts.