Spam emails can clutter your inbox and pose security risks. cPanel includes Apache SpamAssassin, a powerful spam filtering tool that scans incoming emails and scores them based on spam characteristics. You can also create custom Email Filters to block specific senders or domains. This guide covers both methods.
Enabling Apache SpamAssassin
- Log in to your cPanel account.
- Scroll to the Email section and click Spam Filters.
- Toggle on Process New Emails and Mark them as Spam.
- SpamAssassin will now examine every incoming email and assign a spam score.
Setting the Spam Threshold Score
The spam threshold determines how aggressively emails are flagged. A message that meets or exceeds this score is marked as spam.
- On the Spam Filters page, click Spam Threshold Score.
- Select a value from the dropdown menu:
- 1 — Very aggressive; many legitimate emails may be flagged.
- 5 (default) — Balanced; recommended for most users.
- 10 — Passive; only obvious spam is flagged.
- Alternatively, select Custom to enter your own value.
- Click Update Scoring Options.
Enabling the Spam Box (Spam Folder)
The Spam Box moves suspected spam into a separate spam folder instead of your inbox, so you can review messages before deleting them.
- On the Spam Filters page, toggle on Move New Spam to a Separate Folder (Spam Box).
- A folder named
spamwill be automatically created the next time you receive spam. - Important: Periodically empty your spam folder, as it counts towards your email quota.
To empty the spam folder:
- Click Configure Spam Box Settings.
- Click Empty the Spam Box folder for your email address, or Empty all Spam Box folders to clear spam for every email account.
Setting Up Auto-Delete for Spam
If you prefer to automatically delete spam without reviewing it, enable the Auto-Delete feature.
- On the Spam Filters page, toggle on Automatically Delete New Spam (Auto-Delete).
- Click Configure Auto-Delete Settings.
- Select an Auto-Delete Threshold Score. Messages meeting or exceeding this score will be permanently deleted.
- Click Update Auto-Delete Score.
Warning: Auto-Delete permanently removes emails. Legitimate messages may be deleted if the threshold is set too low. We recommend using the Spam Box instead unless you are confident in your settings.
Whitelisting and Blacklisting Senders
You can allow specific senders through (whitelist) or block them entirely (blacklist):
- On the Spam Filters page, click Show Additional Configurations.
To whitelist a sender:
- Click Edit Spam Whitelist Settings.
- Enter the email address (e.g.,
[email protected]) or domain (e.g.,*@example.com). - Click Update Whitelist.
To blacklist a sender:
- Click Edit Spam Blacklist Settings.
- Enter the email address or domain you want to block.
- Click Update Blacklist.
Blocking Senders with Email Filters
For more granular control, you can create email filters that discard or redirect messages from specific senders:
- In cPanel, go to Email → Email Filters (per-account) or Global Email Filters (all accounts).
- Click Create a New Filter.
- Enter a filter name (e.g.,
Block Sender). - Under Rules, set the first dropdown to From, the operator to equals, and enter the sender email address.
- Under Actions, select Discard Message to silently delete the email.
- Click Save.
Important Notes
- SpamAssassin and cPanel Email Filters serve different purposes. SpamAssassin scores emails based on content, while Email Filters apply rules you define (sender, subject, etc.).
- Using multiple simple filters is more efficient than a single complex filter.
- The Spam Box folder counts towards your email quota. Empty it regularly.
- If SpamAssassin is forced on by your hosting provider, you cannot disable it, but you can still adjust the threshold.
Troubleshooting
Legitimate emails are being marked as spam:
- Add the sender to your whitelist.
- Increase your Spam Threshold Score to a higher value (e.g., 7 or 8).
- Check your email filter rules to ensure no filters are accidentally redirecting legitimate mail.
Spam is still reaching your inbox:
- Ensure SpamAssassin is enabled.
- Lower your Spam Threshold Score (e.g., from 5 to 3).
- Enable the Spam Box feature to redirect spam to a separate folder.
Spam Box option is not visible:
- Your hosting provider may not have enabled the Spam Box feature in WHM. Contact support for assistance.