A field story about a phishing email that SpamAssassin scored correctly and still delivered — the one number almost nobody checks — and the threshold audit I now run before blaming the filter.
The screenshot arrived before the ticket did.
A phishing email, sitting in a user’s inbox. A fake sign-in link, a polite tone, a sender that looked almost right.
“Your spam filter is not working,” the customer wrote. “This should never have reached us.”
I understood the frustration. A phishing mail in the inbox is the one thing a mail server is supposed to stop.
I asked for one thing before anything else: “Can you send me the full headers of that message?”
They did.
The answer was in one line near the top.
X-Spam-Score: 60
That is a score of 6.0. SpamAssassin had looked at this message and said, clearly, “this is spam.”
And then it delivered it anyway.
That’s the Trap
The filter did not fail. It scored the message correctly.
The setting that decides what to do with that score was the problem. A spam score is only half a decision. The threshold is the other half. And the threshold hides in a file most people never open.
What the Threshold Actually Is
SpamAssassin gives every message a score. Each rule that matches adds points: a suspicious link, a missing header, a known spam phrase. Rules that look like good signs can take points away.
Then it compares the total with one number: required_score. If the score is equal to or above it, the message is marked as spam. If it is below, the message is marked as clean.
The default required_score is 5.
On a cPanel server, each account can have its own value. It lives here:
/home/<user>/.spamassassin/user_prefs In this case, that file said:
required_score 10 So the flow for this message was:
Phishing mail → SpamAssassin scores 6.0 → compare with 10 → 6.0 < 10 → "not spam" → inbox
With the default of 5, the same message would have been marked as spam. Nothing else needed to change.
Where I see thresholds raised like this:
- An account that once complained about a real email landing in spam, and someone “fixed” it by raising the number.
- A setting copied from an old server during a migration, with nobody remembering why it was there.
- A user who found the Spam Filters screen in cPanel and moved the slider to make the problem go away.
I don’t know who set it to 10 on this account. It doesn’t matter. What matters is that a raised threshold does not show up anywhere unless you go looking for it.
Why This Phishing Mail Scored Only 6
A score of 6.0 is low for a phishing email. Many score far higher.
The message carried a valid DKIM signature for the sender’s real domain, and it came out through a third-party hosting relay. A real signature from a real domain is a good sign as far as the rules are concerned, so the score drops.
Theory: a real mailbox at that sender had been compromised, and the attacker was sending from it. That would explain the valid signature. I can’t prove it from our side, because the proof sits in the sender’s own mail logs. To confirm it, the sender’s admin would check their outbound logs for that message.
Here’s the part that trips people up. Phishing from a compromised real mailbox can score only just above the default. It passes SPF. It passes DKIM. This one landed at 6.0. That is exactly the band a raised threshold of 10 lets through.
So a threshold of 10 does not just let in “a bit more spam.” It lets in the most dangerous kind: the kind that looks legitimate.
Why Nobody Sees It in Testing
When someone tests a spam filter, they usually send something obvious. A GTUBE test string, or a message full of spam words. That scores 20, 50, 1000. It gets caught at a threshold of 5 and at a threshold of 10.
The test passes. Everyone moves on.
The messages that slip through a threshold of 10 are the ones in the middle. Nobody writes a test for those.
And the account owner never notices, because the visible result of a high threshold is “less spam in my spam folder.” That feels like the filter working better.
A quiet spam folder is not proof of a good filter.
How to Actually Fix This
Step 1: Read the Score From the Headers
Before you change anything, find out what the filter actually decided. Open the message’s full headers (in Roundcube: More › View source; in Outlook: File › Properties › Internet headers).
Look for these lines:
X-Spam-Status: No, score=6.0 required=10.0 X-Spam-Score: 60 Two numbers matter. score is what the message earned. required is the threshold for that account. On cPanel, X-Spam-Score is the score times ten, so 60 means 6.0.
If score is above 5 and the status says No, the threshold is your problem, not the rules.
Plain takeaway: the headers tell you which half of the decision failed.
Step 2: Check the Account’s Threshold on the Server
This is read-only:
cat /home/<user>/.spamassassin/user_prefs Look for the required_score line. If it is missing, the account uses the default. If it says anything above 5, you have found it.
In cPanel you can see the same value at cPanel › Email › Spam Filters › Spam Threshold Score.
Step 3: Put It Back to 5
This changes the setting. The simplest path is the cPanel screen: cPanel › Email › Spam Filters › Spam Threshold Score, set it to 5, save.
Then check the file again:
grep required_score /home/<user>/.spamassassin/user_prefs Expected output:
required_score 5 Tell the users one thing before you do it: “For the first week, check your spam folder once a day.” Some legitimate mail that used to score between 5 and 10 will now be marked as spam. That is the point. Those messages were always borderline; now the users get to see them where they belong.
Step 4: Audit Every Account on the Server
One raised threshold usually means there are others. This is read-only and lists every account that has a custom value:
grep -H required_score /home/*/.spamassassin/user_prefs Any line with a number above 5 deserves a question to that account owner. Any line with a number below 5 is stricter than the default, which is a choice, not a risk.
Plain takeaway: the account that complained is rarely the only one.
Step 5: Verify With the Next Message
This step is where most tutorials stop and where mine starts.
Changing the number proves nothing until a real message is judged against it. Wait for the next borderline mail, or ask the user to forward the next suspicious one as an attachment, and read its headers again:
X-Spam-Status: Yes, score=6.0 required=5.0 Yes with required=5.0 is what you want to see.
If you still see required=10.0, the change didn’t land for that mailbox. Check that you edited the right account, and that no other filter rule is moving the message back to the inbox.
This result is not a bug. It is the verification.
Step 6: Add a Spoof Filter for Your Own Name
A threshold of 5 still lets through phishing that scores 4.9. For the most common lure, which is someone pretending to be your own organisation, you can add a simple rule.
In cPanel › Email › Global Email Filters, create a filter that matches mail where the From header contains your organisation’s name, but the sender is not from your own domain. Send those to the spam folder, or add a warning to the subject.
This catches the “IT Department” and “Accounts Team” messages that come from outside, whatever their score. It is a narrow rule. Test it for a week with the subject warning before you send matches to spam.
The Bigger Lesson
- Read the headers before blaming the filter.
X-Spam-Statustells you the score and the threshold in one line. - Know your default. SpamAssassin’s
required_scoredefault is 5. Anything else is a choice someone made. - Audit thresholds on every server.
grep -H required_score /home/*/.spamassassin/user_prefstakes a second. - Never raise the threshold to fix one false positive. Whitelist the one sender instead. Raising the number opens the door for everyone.
- Expect phishing just above 5. Compromised real mailboxes pass SPF and DKIM and score low.
- Add a spoof rule for your own name. It catches what a score never will.
- Warn users before you tighten anything. A week of checking the spam folder prevents a week of complaints.
What I Tell Every Customer Now
When a customer says “your spam filter let this through,” I don’t start with the rules any more. I start with one question:
“What is the spam threshold on the account that received it?”
If the answer is “five, the default,” we look at the rules and the sender. If the answer is “I don’t know,” we’re not done yet.
I write about the questions I ask in real customer rooms — the ones that change architectures and surface the problems no one else noticed. If you found this useful, drop your email below and I’ll send the next one when it’s ready.
FAQs
Why did a phishing email reach the inbox when SpamAssassin scored it as spam?
SpamAssassin gives each message a score and compares it with the account’s required_score. If the score is below that threshold, the message is marked as clean and delivered. In this case the score was 6.0 but the account threshold was 10, so it counted as clean.
What is the default SpamAssassin required_score?
The default is 5. A message that scores 5 or more is marked as spam. On cPanel, each account can override it in /home/<user>/.spamassassin/user_prefs or in cPanel › Email › Spam Filters.
What does X-Spam-Score: 60 mean in cPanel?
cPanel writes the SpamAssassin score multiplied by ten in the X-Spam-Score header. So 60 means a score of 6.0. The X-Spam-Status header shows the same score with a decimal point, next to the threshold used.
How do I find every cPanel account with a custom spam threshold?
Run grep -H required_score /home/*/.spamassassin/user_prefs on the server. It lists each account that has its own value. Accounts that are not listed use the default of 5.
Why do phishing emails from real domains score low?
Mail sent from a real, compromised mailbox usually passes SPF and carries a valid DKIM signature. Those are good signs to the rules, so the score drops. These messages can land just above the default threshold of 5, which is why a raised threshold lets them in.
Originally published at quabin.com.
