r/mimecast • u/SID00010 • 3d ago
Mimecast: How we built a custom spam score threshold (since you can only pick Relaxed/Moderate/Aggressive)
Hey all,
One thing that has bugged us about Mimecast for a while: the spam scanner only lets you choose predefined detection levels. "Relaxed" means anything with a spam score of 7 or higher gets treated as spam. If that still blocks too much legit mail and you want to raise the threshold, there's no built-in way to do it.
So we built a workaround with Content Examination policies. Sharing it in case it helps someone else.
The idea
The spam scanner only tags the score in the headers and doesn't act on it. Content Examination definitions then read that header and decide what happens based on the score.
Step 1: Spam Scanning definition
Spam Scanner Settings:
- Description: Spam Override Definition
- Spam Detection Level: Relaxed
- Spam Detection Action: Tag Headers
- Auto Allow Spam Detection Level: Relaxed
- Auto Allow Spam Detection Action: Do Nothing
- Enable Graymail Control: ✅ (optional)
- Graymail Detection Action: Tag Headers as Graymail (optional)
With "Tag Headers", Mimecast no longer holds or blocks spam itself. It just adds the X-Mimecast-Spam-Score header to every message, which we evaluate in the next steps.
Step 2: Content Examination definition for score 7–14 (warning banner)
Policy Definition:
- Description: SPAM-Override-7-14
- Definition Type: Independent Content Definition
- Activation Score: 1
- Fuzzy Hash Setting: Do not use Fuzzy Hash techniques
Scanning Options, Word / Phrase Match List:
1 regex ^X-Mimecast-Spam-Score:\s*(?:7|8|9|1[0-4])\s*$(The leading 1 is the score for this entry, so a single match reaches the activation score of 1.)
- Case Sensitive Match: ☐
- Match Multiple Words: ☐
- Scan Subject Line: ☐
- Scan Message Headers: ✅
- Scan Message Body: ☐
- Scan Attachments: ☐
Inbound and Outbound Settings:
- Enable Inbound and Outbound Check: ✅
Policy Override Options:
- Policy Action: None
- Stationery Override: your warning banner stationery (ours is called "SPAM-0-14")
- Disable Stationery: ☐
- Everything else left at default / not set
Result: the mail is delivered normally, but with a banner on top warning the user that it may be spam. You need to create that stationery first (Stationery section in the admin console) with whatever warning text you want.
Step 3: Content Examination definition for score 15+ (hold)
Policy Definition:
- Description: SPAM-Override-15above
- Definition Type: Independent Content Definition
- Activation Score: 1
- Fuzzy Hash Setting: Do not use Fuzzy Hash techniques
Scanning Options, Word / Phrase Match List:
1 regex ^X-Mimecast-Spam-Score:\s*(1[5-9]|[2-9][0-9]|[1-9][0-9]{2,})\s*$This matches 15–19, 20–99 and anything 100 or above.
- Case Sensitive Match: ☐
- Match Multiple Words: ☐
- Scan Subject Line: ☐
- Scan Message Headers: ✅
- Scan Message Body: ☐
- Scan Attachments: ☐
Inbound and Outbound Settings:
- Enable Inbound and Outbound Check: ✅
Policy Override Options:
- Policy Action: Hold for Review
- Hold Type: User
- Moderator Group: not set (optional)
- Stationery Override: not set
- Everything else left at default / not set
Result: these messages land in the held queue, just like regular spam would.
Don't forget
Both Content Examination definitions need an actual Content Examination policy that applies them to your inbound mail (e.g. from Everyone to Internal Addresses). The definition alone does nothing.
Result
Your effective spam threshold is now whatever you want. Want to hold from 20 instead of 15? Change the regexes. You can also add more tiers, e.g. a different banner or action per score range.
Has anyone solved this differently, or is there a native option we missed?