How to Stop Spam with the cPanel Spam Filter

Many popular email providers have their own spam filters, but when you switch to using your own webmail inbox, you may become vulnerable to spam emails. Fortunately, cPanel offers a handy feature to filter out any spam emails sent to email accounts on your web hosting.


Spam Filters

Apache SpamAssassin, available under Spam Filters in the Email section on your cPanel, can be switched on with a simple toggle button. Once on, it will begin to scan any subsequent incoming messages for possible spam content. Depending on your hosting provider, you may already have Apache SpamAssassin turned on. In some cases, you may not be able to disable this setting if it has been globally forced on by your hosting provider.

Furthermore, the spam filter allows you to customize the level of spam content required for a message to be marked as spam, known as the “spam threshold”. This level ranges from one to ten, with a lower number meaning the more likely a message will qualify for “spam”, while a higher number requires more content matches for the message to be marked as spam. For example, setting the level to one will aggressively enforce the spam filter, but also likely causing even non-spam messages to be marked as spam as long as they meet a very strict criteria. This may be useful if you are constantly dealing with unsolicited messages and do not use your webmail inbox for receiving normal email messages. On the other hand, setting the level to ten will cause only messages that are clearly spam to be marked as such. Most recommend a level of five initially, but some entities (such as businesses) may need a more relaxed level to avoid missing emails.


What Happens to Spam Emails?

You can also configure the actions your email system takes once it identifies a message as spam. By default, emails marked as spam will still be delivered to your inbox, but their subject lines may be prefixed with “***SPAM***” by Apache SpamAssassin, depending on the settings configured by your hosting provider.


Spam Box

If the Spam Box feature is available to you in cPanel, you can set this to redirect all spam emails to the Spam Box folder. Messages sent there will be kept, which allows you to review the messages in the event a non-spam email was mistakenly marked as spam. This is the usual behavior of the spam filter on most regular email providers. If you enable Spam Box, you should periodically check the folder and delete unwanted messages as accumulated messages will take up email quota. This will need to be checked via webmail or an email client, simply forwarding or importing emails to another provider may mean you only see the emails that reach your in-box.



Alternatively, you may choose to have the system automatically delete any email it identifies as spam. This can be great for people who receive many bulk spam emails and do not have the time to go through all of them to confirm if they are really spam. However, if you plan to receive normal messages in your email inbox, it is advisable to use this feature with care, as it could cause wrongly identified non-spam messages to be permanently deleted.

The auto-delete feature has a separate threshold level from the spam filter, meaning that you can set two different levels for spam detection – one for messages to be automatically deleted, and another for messages to simply be marked as spam but still reach your inbox. It is wise to experiment with the spam filter levels before turning on auto-delete.


Blacklist Spam Senders

If you have the option to Edit Spam Blacklist Settings in the cPanel, you can manually add known spam senders you wish to blacklist. Emails coming from blacklisted addresses will not reach your inbox at all.

The blacklist format allows wildcard characters, allowing you to block all senders from any particular domain. Blacklisted addresses are also applied per email account, so different users could have their own list of blocked addresses.

There is also a whitelist, which is useful if you need to get emails from important senders. Simply add them to the whitelist and they should be delivered regardless of whether or not they would normally trigger the spam filter.


What If I am Still Getting Spam?

In some cases, spam emails may still slip beneath the most rigorous auto detection filters and make their way to your inbox. Fortunately, cPanel also allows you to set up custom filters. Find the Email Filters feature under the Email section in your cPanel and create a new filter. This allows you to define matching terms or phrases that, if present in an incoming message, will cause the email system to perform a certain action on the message. This action can be anything you decide, from sending it to another folder to auto-replying or forwarding it to another email address.

If you use custom filters for spam messages, you can choose to send any detected messages to the spam folder. For example, you can dictate that any message with a subject line containing the word “winner” will be sent to your spam folder. Also, note that the keywords you enter in custom filters are not case-sensitive, so any email that matches the filter, regardless of case, will be acted upon. You can add any number of rules to one filter, which can help you in narrowing down spam messages. Specific email senders can also be blacklisted via a custom filter.

When you are done saving the filter, make sure to test it with the Filter Test option to ensure it has been set up correctly.


We hope the above tips help to keep your devices safe and free from spam emails. Whether you are using shared hosting, a virtual private server (VPS), or a dedicated server … cPanel makes managing things easier.