How to Configure SpamAssassin in DirectAdmin

Unwanted spam email is a daily nuisance for businesses and individuals alike. DirectAdmin integrates SpamAssassin — one of the most widely used open-source spam filtering engines in the world — directly into its Email Manager. With a few simple configuration steps, you can dramatically reduce the volume of junk mail reaching your inbox. This guide walks you through the entire setup process.

What Is SpamAssassin and How Does It Work?

SpamAssassin is an intelligent spam detection system that analyzes every incoming email and assigns it a numerical score based on hundreds of tests. These tests check for suspicious patterns in the email headers, message body, sender reputation, blacklists, HTML formatting, and more. The higher the score, the more likely the message is spam.

Once a message's score exceeds your defined threshold, SpamAssassin takes the action you have configured — such as deleting the message, tagging it in the subject line, or moving it to a spam folder. Legitimate email typically scores below 2.0, while obvious spam often scores above 10.0.

How to Enable SpamAssassin in DirectAdmin

  1. Log in to DirectAdmin and go to Email Manager.
  2. Click on SpamAssassin Setup.
  3. Check the box or toggle to Enable SpamAssassin.
  4. Configure the settings as described below.
  5. Click Save to activate.
SpamAssassin Setup page for configuring the spam filtering system
SpamAssassin Setup page for configuring the spam filtering system
Click Enable (circled) to activate SpamAssassin
Click Enable (circled) to activate SpamAssassin

Setting the Spam Score Threshold

The Required Score (or spam threshold) determines the minimum score at which SpamAssassin will take action. The default value is typically 5.0, which is a well-balanced setting for most users:

Start with 5.0 and adjust based on your experience. If you are receiving too many false positives (legitimate emails flagged as spam), increase the score slightly.

Actions for Spam Email

When SpamAssassin identifies a message as spam, you can choose from several actions:

The safest approach for business use is to tag the subject or move to folder rather than delete, so you can check for false positives without losing important messages.

Blacklisting and Whitelisting Email Addresses

SpamAssassin allows you to manually control how specific senders are treated:

Access these lists in the SpamAssassin Setup page under Blacklist and Whitelist sections. Enter one address per line.

SpamAssassin vs SPAM Filters — What Is the Difference?

DirectAdmin provides two distinct spam-fighting tools:

Using both tools together gives you the best protection.

Training the Bayesian Filter with Real Email Data

SpamAssassin's built-in Bayesian filter becomes significantly more accurate when trained on real email from your own domain. Generic training data provided with the software may not reflect the specific vocabulary, tone, and patterns used in your business communications. Training with your actual inbox data teaches the system what "normal" looks like for your organization, which greatly improves accuracy over time.

Using the sa-learn Command

The sa-learn command is the primary tool for training the Bayesian database. Users with shell access can run it directly:

SpamAssassin requires a minimum of 200 emails in both the spam and ham categories before the Bayesian filter activates. For best results, aim for 1,000 or more examples in each category. The more training data you provide, the more accurately the system can distinguish spam from legitimate mail.

Effectiveness Timeline for Bayesian Training

Bayesian training is a gradual process — results improve steadily over time:

Ongoing Maintenance of SpamAssassin Filter Rules

Spam tactics evolve constantly. What worked six months ago may be less effective today because spammers regularly change their methods to evade filters. Regular maintenance ensures your SpamAssassin configuration stays effective over time.

A SpamAssassin setup that is actively maintained and regularly retrained will consistently outperform one that is left at default settings. The investment of a few minutes of maintenance each month can prevent hours of frustration from dealing with spam in your inbox or missed legitimate email.

Recommended Score: 5.0 — This is the safest default setting for most business email accounts. It blocks the majority of spam while keeping false positive rates low. Avoid setting the score below 3.0 as you risk blocking legitimate transactional emails such as order confirmations, bank notifications, or shipping alerts from e-commerce platforms.

Protect Your Inbox with Quality Hosting

AsiaGB hosting plans include SpamAssassin, SPAM Filters, and professional email features to keep your inbox clean and secure.

View Hosting Plans