Overview
To stop spam in cPanel, open Email > Spam Filters, turn on Process New Emails and Mark them as Spam, leave the Spam Threshold Score at 5, and turn on Move New Spam to a Separate Folder (Spam Box). Spam then lands in a folder called spam instead of your inbox, and you can check it for anything legitimate before it’s deleted.
This guide is for anyone with a cPanel hosting account whose inbox is filling with junk. It covers the cPanel spam filters settings in the order you should change them, how to read the spam score cPanel puts in every message so you can tune the threshold from real mail rather than guesswork, safe whitelists and blacklists, and a test message that proves the filter works.
Prerequisites
- Your cPanel login. Individual mailbox users can change their own settings in Webmail under Spam Filters or Fight Spam, depending on the cPanel version.
- A few recent spam messages still in your inbox. You’ll use their headers in Step 1.
- Your mailboxes set up in a mail app, ideally over IMAP so the Spam Box folder shows up. cPanel email settings for Outlook, iPhone and Android has the settings.
Step-by-Step: Set Up cPanel Spam Filters
Step 1: Check the spam score on a message that got through
cPanel’s filter is Apache SpamAssassin. It runs dozens of tests on each message and adds up a score; anything at or above your threshold is treated as spam. When the filter is on, it writes the result into the message headers. Open a spam message, view its full headers (in Outlook: File > Properties; in Apple Mail: View > Message > All Headers; in Roundcube: More > View source) and find the line that starts with X-Spam-Status:
X-Spam-Status: No, score=4.1 required=5.0 tests=BAYES_50,HTML_MESSAGE,
RDNS_NONE,SPF_HELO_NONE autolearn=no
This one scored 4.1 against a threshold of 5, so it reached the inbox. That number is what you tune against. If most of your spam scores between 3.5 and 5, lowering the threshold will catch it. If spam arrives with no X-Spam-Status line at all, the filter isn’t running on your account yet, which is Step 2.
Step 2: Turn on the spam filter
- Log in to cPanel and open Email > Spam Filters.
- Switch Process New Emails and Mark them as Spam to enabled.
On many servers this is already forced on by the host, in which case the toggle is greyed out. That’s fine. Marking alone doesn’t move anything: messages are tagged, but they still land in the inbox until you turn on the Spam Box.
Step 3: Set the Spam Threshold Score
Click Spam Threshold Score, pick a value and click Update Scoring Options. Lower numbers are stricter. My starting rule on customer accounts:
- 5 (the SpamAssassin default) for the first week. It rarely catches real mail.
- 4 if the scores you found in Step 1 are mostly between 4 and 5.
- 3 only for a mailbox that gets heavy spam and little mail from new contacts, such as an old address printed on a website. Below 3, invoices and newsletters start going missing.
Change it one point at a time and give each setting a few days.
Step 4: Turn on the Spam Box
Switch Move New Spam to a Separate Folder (Spam Box) to enabled. From now on, anything scoring at or above the threshold goes to a folder named spam in each mailbox. cPanel creates it the first time a spam message arrives, so don’t worry if you can’t see it straight away.
The folder counts against the mailbox quota, so a busy mailbox can fill up with spam it never shows you; use Configure Spam Box Settings to empty it, or set up Auto-Delete in Step 5. Some mail apps only show new folders after you subscribe to them; in Outlook, right-click the account and choose IMAP Folders. POP3 users can’t see server folders at all, which is one more reason to move to IMAP (see IMAP vs POP3).
Note: if the Spam Box option is missing, your host has turned it off in WHM. Ask support to enable it.
Step 5: Add Auto-Delete only after a couple of weeks
Auto-Delete removes messages permanently at or above a separate Auto-Delete Threshold Score. They’re never delivered and can’t be recovered. Leave it off until you’ve checked the Spam Box for a couple of weeks and found nothing legitimate in it.
When you do turn it on, click Configure Auto-Delete Settings and set the score well above your spam threshold, for example 10 with a threshold of 5. Messages between 5 and 10 still go to the Spam Box for you to check; only the obvious junk is deleted. Never set both scores to the same number, or every message marked as spam is deleted outright.
Step 6: Whitelist the senders you can’t afford to lose
Click Show Additional Configurations, then Edit Spam Whitelist Settings. Add one sender per entry and click Update Whitelist (whitelist_from). Wildcards work: * matches any characters and ? matches one.
accounts@yourbank.ca
*@yoursupplier.com
noreply@client-portal.example.com
Warning: never whitelist a whole free-mail domain such as *@gmail.com or *@outlook.com. Spammers use those addresses too, and a whitelist entry lets them skip the filter completely. The whitelist also trusts the From address, which can be forged, so keep it short and specific.
If a legitimate sender keeps landing in spam, look at the tests= part of their X-Spam-Status line. Tests such as SPF_FAIL, DKIM_INVALID or DMARC_FAIL mean their mail setup is broken, and they should fix it; send them how to create an SPF record.
Step 7: Blacklist persistent senders
Under Edit Spam Blacklist Settings, add addresses or domains that should always count as spam, in the same format, and click Update Blacklist (blacklist_from). This is worth doing for a sender that ignores unsubscribe requests. It does little against real spam, which changes sender address on every run.
For patterns the score misses, such as a recurring subject line, use Email > Global Email Filters (all mailboxes) or Email Filters (one mailbox): a rule like “Subject contains crypto recovery” with the action Deliver to Folder spam is safer than Discard Message, because you can still check the folder.
Verify the Filter Works
SpamAssassin recognises a standard test string called GTUBE and gives any message containing it a huge score. From an email account at a different provider, send a message to your mailbox with this line in the body:
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
It should arrive in the spam folder, with X-Spam-Status: Yes and a score around 1000 in the headers. Some large providers refuse to send it at all; if yours bounces it, try another account. If the message lands in the inbox, the filter isn’t processing that domain’s mail; check the domain’s MX records point to your cPanel server (see DNS records explained), because mail routed through an outside filter or forwarded from elsewhere can skip it.
Common Issues & Troubleshooting
Legitimate mail is going to the Spam Box
Cause: The threshold is too low, or the sender’s SPF, DKIM or DMARC is failing.
Fix: Read the score and tests in the message headers. Raise the threshold by one point if real mail scores just above it, whitelist that one sender, and ask them to fix any authentication failures.
Spam still reaches the inbox
Cause: Its score is below the threshold, the Spam Box is off, or the mail is forwarded in from another account.
Fix: Check the X-Spam-Status score, lower the threshold a point, and confirm the Spam Box is on. Avoid forwarding a spam-heavy outside address into cPanel; email forwarding in cPanel explains why forwarded spam can also hurt your server’s reputation.
Mailbox full, but the inbox is nearly empty
Cause: The spam folder has grown and counts against the quota.
Fix: Empty it from Configure Spam Box Settings or Email Disk Usage, then add Auto-Delete with a high score. If mail is bouncing, see cPanel email not receiving or sending.
The Spam Box folder doesn’t appear in my mail app
Cause: No spam has arrived since you enabled it, the app hasn’t subscribed to the folder, or the account uses POP3.
Fix: Send the GTUBE test, then refresh or subscribe to folders in the app. Check the folder in Webmail to confirm it exists.
Your own outgoing mail landing in other people’s spam is a different problem with different fixes; preventing email spam and blacklisting covers that side. Spam filtering, Spam Box and Webmail are included with every mailbox on our cPanel shared hosting plans.
Frequently Asked Questions
Where are spam filters in cPanel?
Log in to cPanel and open Email > Spam Filters. Mailbox users without cPanel access can change their own spam settings from Webmail. The filter is Apache SpamAssassin, which scores each message and marks anything at or above your threshold as spam.
What spam score should I use in cPanel?
Start with the default of 5. If the spam that gets through mostly scores between 4 and 5 in the X-Spam-Status header, lower it to 4. Going below 3 usually starts catching real invoices and newsletters.
Where does cPanel put spam emails?
With the Spam Box turned on, spam goes to a folder named spam in each mailbox. cPanel creates it when the first spam message arrives, and its contents count toward the mailbox quota.
Is it safe to turn on Auto-Delete for spam?
Only once you’ve checked the Spam Box for a couple of weeks and found nothing legitimate. Set the Auto-Delete score well above the spam threshold, such as 10 with a threshold of 5, because deleted messages can’t be recovered.
How do I stop a trusted sender going to spam in cPanel?
Add their exact address to the whitelist under Spam Filters > Show Additional Configurations > Edit Spam Whitelist Settings. Don’t whitelist whole free-mail domains such as gmail.com, and ask the sender to fix any SPF or DKIM failures shown in the headers.