Email

DirectAdmin Email Spam Filter Setup — Block Junk Mail

Configure SpamAssassin, Blocklist, Whitelist and Greylist on DirectAdmin to eliminate junk mail from your inbox — complete guide

Updated: November 1, 2026 · 8 min read
DirectAdmin Email Spam Filter Setup

1. What Is DirectAdmin Spam Filter

A spam filter analyzes incoming and outgoing emails to determine if they are junk. DirectAdmin ships with SpamAssassin, a popular open-source spam filter, along with Blocklist/Whitelist management and Greylist support.

Benefits of a well-configured spam filter:

FeatureDescription
SpamAssassinScores emails by analyzing headers, content, and RBL checks
BlocklistPermanently blocks specified IPs, domains, or addresses
WhitelistAllows trusted senders, bypassing all filters
GreylistTemporarily rejects first delivery — bots don't retry, real servers do

2. Setting Up SpamAssassin

Log into DirectAdmin and follow these steps:

  1. Access DirectAdmin at yourdomain.com:2222
  2. Go to Email Manager
  3. Click Spam Filters
  4. Enable SpamAssassin by clicking Enable SpamAssassin
Note: If you don't see Spam Filters in the menu, SpamAssassin may need to be enabled by your hosting provider. Contact AsiaGB Support for assistance.

Key SpamAssassin Settings

OptionRecommended ValueDescription
Required Score5.0Minimum score to classify as spam
Rewrite SubjectOnPrepends [SPAM] to the subject line
Add HeaderOnAdds X-Spam-Status header
Move to Spam FolderOnMoves spam to Junk/Spam folder

3. Spam Score and Actions

The spam score is the numerical rating SpamAssassin assigns each email. Higher scores indicate a greater likelihood of spam. The default threshold is 5.0.

Score Range Guidelines

Warning: Setting the score too low (e.g., 2-3) may cause legitimate emails to be filtered as spam. Start at 5.0 and adjust based on real results.

Available Actions

4. Blocklist and Whitelist

Beyond SpamAssassin, you can manage Blocklist and Whitelist entries directly.

Adding to Whitelist (Allow Sender)

  1. In Spam Filters, click Whitelist
  2. Enter the email or domain, e.g., [email protected] or @partner.com
  3. Click Add

Adding to Blocklist (Block Sender)

  1. In Spam Filters, click Blocklist
  2. Enter the email or domain to block
  3. Click Add
Pattern TypeExampleEffect
Single address[email protected]Blocks/allows that specific address
Whole domain@spammer.comBlocks/allows all email from that domain
Wildcard*@*.xyzBlocks all .xyz TLD senders

5. Configuring Greylist

Greylist is a smart spam prevention technique — when a new mail server sends an email for the first time, the system issues a temporary rejection with error code 451. Real mail servers automatically retry in 5-30 minutes, but spam bots typically don't.

Greylist Pros and Cons

ProsCons
Reduces spam by 70-90%First-time emails may be delayed 5-30 minutes
Near-zero false positivesNeed to whitelist for instant delivery
Low resource usageRare mail servers don't retry

Enabling Greylist on DirectAdmin

  1. Go to Email Manager → Spam Filters
  2. Click Greylist
  3. Click Enable
  4. Set Initial Delay: 5 minutes (recommended)
  5. Set Retry Window: 4 hours
Pro tip: Whitelist IP ranges of commonly used mail servers like Google Workspace and Office 365 in Greylist settings for instant delivery without delay.

6. SPF, DKIM and DMARC

These DNS records help your outgoing emails pass recipient spam filters and receive lower spam scores from SpamAssassin.

SPF Record

SPF specifies which mail servers are authorized to send email on behalf of your domain.

v=spf1 include:mail.yourdomain.com ~all

DKIM

DKIM adds a digital signature to prove email content hasn't been tampered with.

  1. Go to DirectAdmin → Email Manager → DKIM Keys
  2. Click Generate for your domain
  3. Copy the TXT record to your DNS at your registrar

DMARC

DMARC tells recipients what to do when SPF or DKIM fails.

v=DMARC1; p=quarantine; rua=mailto:[email protected]
RecordPurposeEffect on Spam Score
SPFVerifies sending server-1 to -2 points
DKIMVerifies content integrity-1 to -3 points
DMARCSets policy on failureIncreases trustworthiness

7. Fixing False Positives

A false positive is when a legitimate email is incorrectly marked as spam. Here's how to fix it:

  1. Check Spam folder regularly, 1-2 times per week
  2. Whitelist important senders — suppliers, banks, government agencies
  3. Raise spam score from 5.0 to 6-7 if false positives are frequent
  4. Inspect headers of misfiltered emails — look for X-Spam-Status and X-Spam-Score

Reading Spam Headers

In Roundcube or any email client that supports it:

Pro tip: If important newsletters are being filtered, whitelist the sender domain rather than raising the overall score threshold — this keeps your spam protection intact for other senders.

8. Best Practices Summary

Best PracticePriority
Enable SpamAssassin with score 5.0-6.0Critical
Configure SPF, DKIM, DMARC in DNSCritical
Enable GreylistHigh
Whitelist important sendersHigh
Check Spam folder weeklyMedium
Update Blocklist when new spam waves occurMedium

AsiaGB Email Hosting includes SpamAssassin and Greylist on every plan at no extra charge, with DirectAdmin for easy management. Need help with setup? Contact AsiaGB Support.

Frequently Asked Questions

What is SpamAssassin?

SpamAssassin is an open-source email spam filter used by DirectAdmin. It analyzes email content, headers, and behavior to assign a spam score. Emails exceeding the threshold are marked or moved to spam.

What spam score should I use?

The default SpamAssassin score is 5.0. We recommend 5.0-7.0. Setting it lower than 5 increases false positives where legitimate emails are incorrectly filtered.

What is Greylist and how does it differ from Blacklist?

Greylist temporarily rejects emails on first delivery and waits for a retry. Spam bots rarely retry, but legitimate mail servers do automatically. Blacklist permanently blocks specified IPs or domains.

Why do important emails end up in spam?

Common causes include high spam score, missing SPF/DKIM/DMARC records, sending from a blacklisted IP, or content matching spam filter rules. Fix by verifying sender DNS records and whitelisting important senders.

How do I whitelist an important sender?

Go to DirectAdmin → Email Manager → Spam Filters → Whitelist. Enter the email address or domain such as @example.com to allow all emails from that domain.

Does AsiaGB Email Hosting include spam filtering?

Yes. AsiaGB Email Hosting runs on DirectAdmin and every package includes SpamAssassin and Greylist at no additional cost.