SpamAssassin is the built-in spam filtering system included with all DirectAdmin Hosting plans. It scores each incoming email based on hundreds of rules — if the score exceeds your threshold, the email is treated as spam and either moved to SpamBox or deleted automatically. Proper configuration can filter out over 95% of spam without affecting legitimate email.
Access SpamAssassin in DirectAdmin
- Log in to DirectAdmin
- Go to E-Mail Manager → Spam Filters (or SpamAssassin)
- Select the email account you want to configure
Understanding Spam Scores
SpamAssassin assigns each email a numeric score based on hundreds of checks:
| Score | Meaning | Recommendation |
|---|---|---|
| 0–2 | Normal email — not spam | Deliver to inbox normally |
| 3–4 | Slightly suspicious | Usually still legitimate email |
| 5–7 | Likely spam | Recommended threshold range |
| 8+ | Definite spam | Safe to delete or move to SpamBox |
Set the Spam Score Threshold
In SpamAssassin settings, configure the Required Score — the threshold above which emails are classified as spam:
- 5 — Recommended for business email (catches most spam; minor false positives possible)
- 7 — Conservative setting (fewer false positives; lets through more spam)
- 3 — Aggressive (catches nearly all spam; higher risk of blocking legitimate email)
Choose the Action for Spam Email
Three main options are available:
- Delete — Permanently deletes spam immediately (most aggressive — not recommended until you've verified your threshold)
- Move to SpamBox — Moves to a separate Spam folder (recommended — reviewable after the fact)
- Flag as Spam — Adds the
X-Spam-Status: Yesheader but delivers to inbox (lets your email client handle it)
Recommendation: Start with Move to SpamBox and a Required Score of 5 for one week. Check whether any legitimate email ended up in SpamBox. If none did, consider switching to Delete.
Set Up Whitelist — Trusted Senders
Add trusted senders to the Whitelist so their emails always bypass spam filtering:
whitelist_from [email protected]— trust a specific addresswhitelist_from *@trustedcompany.com— trust an entire domain
In DirectAdmin: Spam Filters → Whitelist/Blacklist → add the address or domain.
Set Up Blacklist — Known Spammers
For senders you know are spammers, add them to the Blacklist to block outright:
blacklist_from [email protected]blacklist_from *@spammy-domain.com
Reading Email Headers to Diagnose Spam Score Issues
Every email processed by SpamAssassin includes additional headers that reveal exactly how it was scored. These are invaluable for diagnosing false positives and tuning your configuration:
X-Spam-Status: Yes, score=8.2— email flagged as spam with its scoreX-Spam-Flag: YES— confirms spam classificationX-Spam-Report:— lists each rule that contributed to the score, such asRCVD_IN_DNSWL_BLOCKEDorHTML_MESSAGEX-Spam-Score: 8.2— the total score across all rules
To view headers in Roundcube: open the email → click More → Show Source, then look for X-Spam headers near the top. Reading the X-Spam-Report shows which rules triggered, helping you decide whether to add the sender to your Whitelist or adjust your threshold.
Adding Custom SpamAssassin Rules
Beyond the hundreds of built-in rules, you can add custom rules through a user_prefs file located in each email account's home directory at ~/.spamassassin/user_prefs.
Useful Custom Rule Examples
# Increase score for emails with suspicious subject patterns
score SUBJECT_FREE 2.0
# Reduce score for emails from a trusted partner domain
whitelist_from_rcvd [email protected] mail.partner.com
# Increase score for emails missing a Message-ID header (common spam trait)
score MISSING_MID 2.5
# Block an entire domain outright
blacklist_from *@spam-sender.net
Edit the user_prefs file directly through DirectAdmin File Manager. Changes take effect immediately — no server restart required. This lets you fine-tune filtering beyond what the interface exposes.
Tip: If newsletters from trusted marketing platforms keep landing in SpamBox, whitelist their sending domain: whitelist_from *@email.mailchimp.com. This is safer than raising your threshold globally.
Recommended Settings for Different Email Scenarios
The right SpamAssassin configuration depends on your inbox volume and use case. Here is a practical reference:
| Scenario | Recommended Setting | Reason |
|---|---|---|
| General business email | Score 5 → Move to SpamBox | Balanced — low false positives |
| Heavy newsletter subscriptions | Score 7 + Whitelist domains | Prevents newsletters being filtered |
| Under heavy spam attack | Score 3 + Blacklist domains | Aggressive filtering — review SpamBox daily |
| Customer-only inbox | Score 5 → Delete | Auto-reduces storage, no SpamBox review |
Check your SpamBox at least once a week during the first month. Adjust Whitelist and Blacklist entries based on real patterns. Once SpamAssassin learns your email habits, false positives drop significantly and reviews become less frequent.
Combine with SPF, DKIM, DMARC
SpamAssassin filters based on content. SPF, DKIM, and DMARC prevent email spoofing (forged sender addresses). Using both layers together provides comprehensive protection:
- SPF — Specifies which servers are authorized to send email for your domain
- DKIM — Digital signature verifying the email hasn't been tampered with in transit
- DMARC — Policy defining what to do with emails that fail SPF/DKIM checks
Configure these via DirectAdmin → DNS Management (add TXT Records). See the full guide: Configure SPF, DKIM, DMARC.
Review SpamBox in Roundcube
If you've enabled Move to SpamBox, review flagged emails through Roundcube Webmail:
- Log in to Roundcube (via DirectAdmin → Email → Webmail)
- Check the Spam folder in the left sidebar
- If legitimate email was incorrectly filtered, click Not Spam / Mark as Not Junk
Greylisting: An Additional Layer of Spam Defense
Greylisting is a server-level spam prevention technique that works differently from SpamAssassin. Instead of analyzing email content, it temporarily defers emails from servers it hasn't seen before — returning a 451 "Try Again Later" SMTP response.
This works because most spam bots attempt delivery once and move on. Legitimate mail servers, following standard SMTP behavior, retry the delivery within minutes. The first-time delay is typically 5–15 minutes — after which the email is delivered normally and the server is added to a local allowlist.
- Advantage: Blocks a large percentage of spam with zero content analysis — reduces SpamAssassin's workload significantly
- Disadvantage: First-contact emails from new senders arrive with a short delay, which may affect time-sensitive OTPs or confirmation emails
- Combined approach: Greylisting → SpamAssassin content filter → SPF/DKIM/DMARC spoofing prevention
Some DirectAdmin hosting servers support greylisting via Exim (the default mail transfer agent). Contact AsiaGB support to check if your server has it available.
Complete Spam Protection Setup Checklist
Here is a practical checklist for setting up comprehensive email spam protection on DirectAdmin Hosting:
- Enable SpamAssassin in Email Manager → set Required Score to 5 → Action: Move to SpamBox
- Add Whitelist entries for trusted senders and domains (regular customers, newsletters, internal systems)
- Add Blacklist entries for known persistent spammers
- Configure SPF in DNS —
v=spf1 include:mail.yourdomain.com ~all - Enable DKIM in DirectAdmin → Email → DKIM Keys
- Add DMARC record — start with
v=DMARC1; p=none; rua=mailto:[email protected] - Review SpamBox weekly during the first month and refine your Whitelist based on real patterns
- Adjust threshold after one month — if false positives are rare, consider tightening the score or switching to Delete
Following this checklist should filter over 98% of spam with minimal impact on legitimate email. It also builds long-term domain reputation, since other mail servers will recognize your domain as properly configured and trustworthy.
Need Hosting with Full Anti-Spam Protection?
All AsiaGB Hosting plans include SpamAssassin, DKIM, SPF, and email filtering. Starting at ฿500/year.
View Hosting Plans