Sometimes, you may receive emails you did not expect or want. These emails are called spam mail. In our shared hosting emails, we employ an antispam filter. The filter however is not 100% effective and may result in some spam mails reaching your inbox.
To prevent this, you can add create custom filters from your cPanel that will filter spam mail based on more firm criteria.
In this guide, we will go though how to create a filter that will prevent emails with specific content in them from reaching your inbox.
1.Login to cPanel
2.Click Global Email Filters icon under Email section

2.Click Create Filter button to begin creating a filter

3.Fill in the details below:
- Name of the filter rule – let this be a descriptive name so you can refer to it later if you want to edit it
- Rules – describe rules you want checked. Several options exist. For example I can describe a rule that checks emails from a specific address [email protected] as follows:

- Actions – here, describe one or more actions you want taken when your rule test described above is passed.
4. Below is a simple example that prevents delivery of emails with the word bitcoin inside the email body

5. Once done defining your filter, click Create.
6. After creating a filter, you can test it to see of it works. This can be done on the same page you created the filter using the Filter Test section.

To test, first update the email message there to match your filter criteria. For example, if I wanted to deliver emails from [email protected] to my inbox, I would update the field From: test@localhost to From: [email protected] then click Test Filter.
Likewise, if I want to test if by bitcoin spam filter described above works, I would update the content ‘This is a test message’ to include the word bitcoin too then click Test Filter.
Once it works as expected, you’re all good. If not, you can always click Edit and make necessary changes.