Fight Spam On cPanel Servers
This guide is about stopping spam being received on a cPanel
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 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

Next, increase the size of messages scanned to 400KB. There is no need to incr4ease the size any further as this is already a generous size. Most spam messages are under 100KB.
Enable SpamCop RBL Detection
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)

Strop Spam Cpanel Servers
Now we are going to change the default score for SpamAssassin for all users. Log in as the root user via a command prompt and issue the below command
/etc/mail/spamassassin/local.cf
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.
Comment
How was this article?
You might also like
More from cPanel
How To Install A Cloudflare Origin SSL Certificate In cPanel
Free SSL Certificates from places like cPanel or Let's Encrypt are great. When Let's Encrypt first introduces free SSL Certificates …
Create a SWAP partition on CentOS, RHEL and AlmaLinux without a reboot
SWAP is a memory type that Linux NVMe VPS Servers use to process requests. Memory will be held in SWAP …
Help fixing Error: last request failed: [AUTH] Authentication failed.
The Error: last request failed: [AUTH] Authentication failed error can be caused by a range of things. It could be …