cPanel & WHMEmail

How to stop receiving spam on cPanel Servers

This guide is about stopping spam from being received on a cPanel Server. If you have a user that is sending Spam. We have a separate guide on how to find and stop users sending spam on cPanel servers.

Spam on any server is always a problem. On cPanel servers, Spam can be a problem. Unfortunately, cPanel in its default state will not do anything to stop spam from being received by your end-users. But cPanel does have built-in protection to combat and stop spam. This needs to be turned on and tuned slightly to get effective results.

SpamAssassin vs BoxTrapper

Some users might be inclined to use BoxTrapper. This means having to manually approve messages held in a queue. Or users being asked to approve emails before they are delivered to your inbox. Using BoxTrapper you can gradually build up a safe list because every person you send an email to will automatically be added to the white list and won’t be asked to confirm they are a real person.

SpamAssassin can be configured globally on cPanel servers. The default settings can also be forced to fight against spam. We are going to switch on SpamAssassin for the whole server and set the default score to catch most if not all spam.

Enable SpamAssassin Globally

In WHM navigate to “Exim Configuration Manager” and click the SpamAssassin tab. From here switch SpamAssassin on globally;

  • Forced Global ON

So next, increase the size of messages scanned to 400KB. There is no need to increase the size any further as this is already a generous size. Most spam messages are under 100KB.

Enable SpamCop RBL Detection cPanel

On the RBL page enable the SpamCop RBL. This will deny any messages from servers listed on the SpamCop Database. This option is optional. Click the save button at the bottom of the page

  • RBL: bl.spamcop.net (ON)

Stop Spam cPanel Servers

Now we are going to change the default score for SpamAssassin for all users. So log in as the root user via a command prompt and issue the below command

/etc/mail/spamassassin/local.cf 

Finally, use the Page Down button to navigate to the bottom of the file and remove the comment (#) next to required_score 5. Change the value of 5 to 4 and save the file.

So far we have enabled SpamAssassin globally for all users and changed the default score from 5 to 4. But this will send all spam messages to the “Spam Folder” and not to users’ inboxes. You can further tune this setup by adding servers to your whitelist which is located on the Spam Assassin tab in the Exim configuration manager.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button