SpamAssassin spam filter on DirectAdmin Hosting

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

  1. Log in to DirectAdmin
  2. Go to E-Mail Manager → Spam Filters (or SpamAssassin)
  3. Select the email account you want to configure

Understanding Spam Scores

SpamAssassin assigns each email a numeric score based on hundreds of checks:

ScoreMeaningRecommendation
0–2Normal email — not spamDeliver to inbox normally
3–4Slightly suspiciousUsually still legitimate email
5–7Likely spamRecommended threshold range
8+Definite spamSafe 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:

Choose the Action for Spam Email

Three main options are available:

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:

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:

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:

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:

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:

  1. Log in to Roundcube (via DirectAdmin → Email → Webmail)
  2. Check the Spam folder in the left sidebar
  3. 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.

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:

  1. Enable SpamAssassin in Email Manager → set Required Score to 5 → Action: Move to SpamBox
  2. Add Whitelist entries for trusted senders and domains (regular customers, newsletters, internal systems)
  3. Add Blacklist entries for known persistent spammers
  4. Configure SPF in DNS — v=spf1 include:mail.yourdomain.com ~all
  5. Enable DKIM in DirectAdmin → Email → DKIM Keys
  6. Add DMARC record — start with v=DMARC1; p=none; rua=mailto:[email protected]
  7. Review SpamBox weekly during the first month and refine your Whitelist based on real patterns
  8. 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

View all cheap Thailand web hosting plans →