Need help? Chat now!

Hostwinds Tutorials

Search results for:


Table of Contents


How To Create SPAM Filter
Change Spam Threshold Score
Edit Global Filters
Delete SPAM emails

How To Create A SPAM Filter in cPanel

Tags cPanel,  Email 

How To Create SPAM Filter
Change Spam Threshold Score
Edit Global Filters
Delete SPAM emails

Hostwinds clients who are using cPanel and have a web hosting package with Apache SpamAssassin SPAM Filters enabled will be happy to use this feature to help deal with SPAM emails from being received. This guide will cover how to set up SPAM filters and use these on your cPanel account and is targeted towards Hostwinds Shared, Business, and Reseller clients. To continue with this guide, please log in to cPanel.

How To Create SPAM Filter

Step One: Navigate to the email section and select Spam Filters.

Step Two: Check whether Apache SpamAssassin is enabled. If it is not, click Enable Apache SpamAssassin using the toggle switch to turn it on (). You can confirm the settings by viewing the message below the on/off toggle switch to confirm if this is turned on or off and should read something similar to this:

Apache SpamAssassin is enabled. This will mark suspicious email messages as spam. The server will update the header of new messages whose calculated spam score exceeds the Spam Threshold Score (5).

Step Three: Navigate back to cPanel's Global Email Filters interface from the cPanel Home Page as shown below:

Step Four: Click Create a New Filter button () to create a new filter

Step Five: Enter the name of your filter in the Filter Name text box, such as SPAM Filter or any name that you will easily remember

Step Six: Select Spam Bar from the first menu in the Rules section

Step Seven: Select contains from the second menu in the Rules section.

Step Eight: Enter the spam score in the text box. Represent the desired spam score with plus (+) characters.

For this guide, to filter all of the mail to which Apache SpamAssassin has assigned a spam score of five or higher, enter +++++ in the text box.

Step Nine: Apache SpamAssassin examines every email message for spam characteristics and then assigns it an overall score based on the number of spam-related traits found within the message. We do not suggest editing the Spam Score unless you have a specific need to do so. This may lead to unintended consequences.

Step Ten: The spam score is counterintuitive, so the lower the spam score, the more aggressive the spam filter will be. A spam score of 1, for example, is much more aggressive than a spam score of 5, so it is important to monitor the messages that are being marked as spam for any false positives. A spam score of 10 should allow most emails not to be marked as spam, although the results may vary, and it is important to monitor this closely to ensure any emails you need to receive are not being marked as spam.

Step Eleven: Select Deliver to the folder from the menu in the Actions section

Step Twelve: Click the Browse button to select the folder to which you wish to send your spam email and to see a list of all available folders

Step Thirteen: Click Create to create, save, and activate the spam filter. This should end up looking similar to the following screenshot:

Change Spam Threshold Score

Step One: Navigate back to the Span Filters are in the Email section of cPanel.

Step Two: Click on the Spam Threshold Score link.

Step Three: Select the new score from the drop-down menu. The lower the number you select, the more aggressive the filter will be at scoring email as spam.

Step Four: Click the Update Scoring Options button to update this setting.

Spam messages score higher calculated spam scores than regular messages. If a message's calculated spam score meets or exceeds the Spam Threshold Score, the system will label that message as spam. For example, an account that uses a Spam Threshold Score of 10 will only mark messages that are obviously spam. A Spam Threshold Score of 2 will label many messages as spam, including messages that are likely not spam. We recommend that new users use the default setting of 5. We recommend that an ISP set this score to 8. The Spam Threshold Score does not affect the Auto-Delete Threshold Score.

Edit Global Filters

Step One: If you are happy with the results and are seeing this feature only mark spam emails and do not see any false positives, or if you change the score, as shown above, you will want to go to the Global Email Filters again in the Email section

Step Two: Click on the Edit button to the right of the filter that you have created. In this example, the filter name we have created is named SPAM Filter.

Step Four: Edit any of the settings in this area.

If you have lowered your spam score from five to four, for example, you would want to modify the +++++ to show ++++

If you would like to auto-delete these messages, you can select Discard Message from the drop-down menu

Delete SPAM emails

It is important to monitor the size of your spam folder so that your account remains in good standing. We also suggest making sure you have a backup of your email before deleting any email from the server if these need to be restored.

Step One: First, you will want to go to your Email Accounts in the Email section of cPanel.

Step Two: The Default Email Account should look similar to the below and contains the username for your cPanel/FTP account

Step Three: Login to the webmail for your account by clicking on the Access Webmail link

Step Four: Choose from the available webmail clients. In this example, we will use Roundcube.

Step Five: Find the folder that you are sending any email marked as spam to with the Global Filter set up previously in this guide. This guide is where the ./Junk mail folder resides from our spam filter we created previously in this guide.

Step Six: Use your mouse to select one of the images and use SHIFT + Left Click with your mouse to highlight all of the messages in your Junk folder

Step Seven: Use this same method to navigate to the Trash folder and remove any Junk Email so that these spam emails are completely removed from the server and do not count towards your disk space usage or inode usage as this may build up over time if you receive many spam emails

Written by Hostwinds Team  /  December 6, 2018