Stop Spam Being Received On cPanel Servers (Filter out Spam)
This guide is about stopping spam being received on a cPanel
Spam on any server is always a problem but on cPanel servers Spam can be more of a problem because in it’s default state cPanel will not do anything to stop spam being received by your end users. cPanel does have built-in protection to combat and stop spam but this need to be turned on and tuned slightly to get effective results.
Some users might be inclined to use BoxTrapper but 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 and the default settings can also be forced globally 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. SpamAssassin is installed by default on all cPanel servers so, you just need to switch it on.
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
Next, on the RBL page enable the SpamCop RBL, this will deny any messages from servers listed on the SpamCop Database, this option is optional but any server administrator who manages a mail server should and would ensure their IP is not listed on any RBL so this should be safe to turn on. Click the save button at the bottom of the page
RBL: bl.spamcop.net (ON)
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
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. This will send all spam messages to the “Spam Folder” and not to users inboxes. We are also denying any mail being sent from servers listed on the SpamCop RBL from being processed by the mail server.
These steps should be enough to filter out spam being received on a cPanel server. 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. If you find that mail is being marked as Spam when it is not then you can change the value in the file /etc/mail/spamassassin/local.cf
back to 5 or even increase it. The higher the number the fewer emails will be caught as Spam. We find 4 is a good starting point and usually enough.
How was this article? -Stop Spam Being Received On cPanel Servers (Filter out Spam)