
Table of Contents
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:
- Fewer junk emails reaching your inbox
- Protection from phishing and malware via email
- Time saved on manual filtering
- Improved team productivity
| Feature | Description |
|---|---|
| SpamAssassin | Scores emails by analyzing headers, content, and RBL checks |
| Blocklist | Permanently blocks specified IPs, domains, or addresses |
| Whitelist | Allows trusted senders, bypassing all filters |
| Greylist | Temporarily rejects first delivery — bots don't retry, real servers do |
2. Setting Up SpamAssassin
Log into DirectAdmin and follow these steps:
- Access DirectAdmin at
yourdomain.com:2222 - Go to Email Manager
- Click Spam Filters
- Enable SpamAssassin by clicking Enable SpamAssassin
Key SpamAssassin Settings
| Option | Recommended Value | Description |
|---|---|---|
| Required Score | 5.0 | Minimum score to classify as spam |
| Rewrite Subject | On | Prepends [SPAM] to the subject line |
| Add Header | On | Adds X-Spam-Status header |
| Move to Spam Folder | On | Moves 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
- Score 3-5: Aggressive — filters heavily but risks false positives
- Score 5-7: Balanced — recommended for most use cases
- Score 7-10: Conservative — fewer filters, suitable if false positives are frequent
Available Actions
- Tag: Adds [SPAM] to subject, still delivers to inbox
- Move to Folder: Moves to Spam/Junk folder (recommended)
- Delete: Deletes immediately — not recommended as it may delete important emails
4. Blocklist and Whitelist
Beyond SpamAssassin, you can manage Blocklist and Whitelist entries directly.
Adding to Whitelist (Allow Sender)
- In Spam Filters, click Whitelist
- Enter the email or domain, e.g.,
[email protected]or@partner.com - Click Add
Adding to Blocklist (Block Sender)
- In Spam Filters, click Blocklist
- Enter the email or domain to block
- Click Add
| Pattern Type | Example | Effect |
|---|---|---|
| Single address | [email protected] | Blocks/allows that specific address |
| Whole domain | @spammer.com | Blocks/allows all email from that domain |
| Wildcard | *@*.xyz | Blocks 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
| Pros | Cons |
|---|---|
| Reduces spam by 70-90% | First-time emails may be delayed 5-30 minutes |
| Near-zero false positives | Need to whitelist for instant delivery |
| Low resource usage | Rare mail servers don't retry |
Enabling Greylist on DirectAdmin
- Go to Email Manager → Spam Filters
- Click Greylist
- Click Enable
- Set Initial Delay: 5 minutes (recommended)
- Set Retry Window: 4 hours
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.
- Go to DirectAdmin → Email Manager → DKIM Keys
- Click Generate for your domain
- 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]
| Record | Purpose | Effect on Spam Score |
|---|---|---|
| SPF | Verifies sending server | -1 to -2 points |
| DKIM | Verifies content integrity | -1 to -3 points |
| DMARC | Sets policy on failure | Increases trustworthiness |
7. Fixing False Positives
A false positive is when a legitimate email is incorrectly marked as spam. Here's how to fix it:
- Check Spam folder regularly, 1-2 times per week
- Whitelist important senders — suppliers, banks, government agencies
- Raise spam score from 5.0 to 6-7 if false positives are frequent
- 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:
- Open the email to inspect
- View Source or Show Original
- Search for
X-Spam-ScoreandX-Spam-Report - Identify which rules scored highest and whitelist accordingly
8. Best Practices Summary
| Best Practice | Priority |
|---|---|
| Enable SpamAssassin with score 5.0-6.0 | Critical |
| Configure SPF, DKIM, DMARC in DNS | Critical |
| Enable Greylist | High |
| Whitelist important senders | High |
| Check Spam folder weekly | Medium |
| Update Blocklist when new spam waves occur | Medium |
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.