StarDomain

How to Configure Spam Filters

How to Configure Spam Filters

Spam filters protect your inbox from unsolicited, malicious, and unwanted email. {{COMPANY_NAME}} hosting includes Apache SpamAssassin, a powerful open-source spam filter that scores incoming messages and takes action on those that exceed your threshold. This guide walks you through configuring spam filtering on your email hosting account.

How SpamAssassin Works

SpamAssassin examines each incoming email and assigns a spam score based on hundreds of rules. The higher the score, the more likely the message is spam.

ScoreLikelihood
0–2Almost certainly legitimate
3–4Possibly spam
5+Likely spam (default threshold)
10+Almost certainly spam

When a message's score exceeds your configured threshold, SpamAssassin takes the action you specify — either marking it, moving it to a spam folder, or deleting it.

Enabling SpamAssassin in cPanel

Step 1: Access Spam Filters

  1. Log in to cPanel
  2. Navigate to EmailSpam Filters

Step 2: Enable SpamAssassin

  1. Toggle Process New Emails and Mark them as Spam to ON
  2. This enables SpamAssassin for all email accounts under your hosting

Step 3: Configure the Spam Threshold

Click Spam Threshold Score to adjust sensitivity:

  • 1–3: Aggressive — catches more spam but may flag legitimate email (false positives)
  • 4–5: Balanced — good for most users (recommended: 5)
  • 6–8: Conservative — only catches obvious spam
  • 9–10: Very permissive — lets most spam through

Tip: Start with the default score of 5. If you receive too much spam, lower it to 4. If legitimate emails are being flagged, raise it to 6.

Step 4: Enable Auto-Delete (Optional)

Click Auto-Delete Spam to automatically discard messages above a certain score:

  1. Toggle auto-delete to ON
  2. Set the auto-delete threshold (recommended: 8 or higher)
  3. Messages scoring above this threshold are permanently deleted

Warning: Auto-deleted messages cannot be recovered. Set the auto-delete threshold significantly higher than your spam threshold to avoid losing legitimate email.

Configuring Spam Filters in DirectAdmin

Step 1: Access SpamAssassin

  1. Log in to DirectAdmin
  2. Navigate to E-Mail ManagerSpamAssassin Setup

Step 2: Enable and Configure

  1. Toggle SpamAssassin to Enabled
  2. Set the Required Score (default: 5.0)
  3. Choose the action for spam messages:

- Rewrite subject — adds ***SPAM*** to the subject line

- Move to spam folder — delivers to a dedicated Junk folder

- Delete — permanently discards the message

  1. Click Save

Whitelisting and Blacklisting

Whitelisting (Allow List)

Whitelisting ensures that emails from specific senders or domains are never marked as spam.

In cPanel:

  1. Go to EmailSpam FiltersShow Additional Configurations
  2. Click Edit Spam Whitelist Settings
  3. Add email addresses or domains (e.g., [email protected] or *@trustedcompany.com)
  4. Click Update Whitelist

In DirectAdmin:

  1. Go to SpamAssassin SetupWhitelist
  2. Add entries one per line
  3. Save

Blacklisting (Block List)

Blacklisting forces SpamAssassin to always mark messages from specific senders as spam.

In cPanel:

  1. Go to Spam FiltersShow Additional Configurations
  2. Click Edit Spam Blacklist Settings
  3. Add email addresses or domains
  4. Click Update Blacklist

Email-Level Filters (cPanel)

For more granular control, cPanel offers per-account email filters:

  1. Go to EmailEmail Filters
  2. Click Manage Filters next to the account
  3. Click Create a New Filter
  4. Define rules based on:

- From — sender address

- Subject — subject line contains specific words

- To — recipient address

- Body — message body contains specific text

- Headers — custom header matching

  1. Choose an action:

- Discard Message

- Redirect to another address

- Deliver to folder

- Fail with message

  1. Click Create

Example: Block All Email from a Domain

FieldValue
RuleFrom — contains — @spamdomain.com
ActionDiscard Message

Example: Auto-Sort Newsletters

FieldValue
RuleSubject — contains — newsletter
ActionDeliver to folder — Newsletters

BoxTrapper (Challenge-Response)

cPanel includes BoxTrapper, a challenge-response spam filter that requires unknown senders to verify themselves before their email is delivered.

Note: BoxTrapper is aggressive and can block legitimate senders who do not respond to the challenge. Use it only if standard spam filtering is insufficient.

  1. Go to EmailBoxTrapper
  2. Click Manage next to the email account
  3. Toggle BoxTrapper ON
  4. Configure whitelist and blacklist as needed

Best Practices for Spam Management

  1. Never publish your email address publicly — Use contact forms on websites instead
  2. Use unique addresses for signups — Create aliases for newsletter subscriptions
  3. Regularly review your spam folder — Check for false positives
  4. Report spam — Mark spam in your email client to improve future filtering
  5. Keep DNS authentication current — SPF, DKIM, and DMARC help reduce inbound spam
  6. Avoid catch-all addresses — They attract massive volumes of spam

Troubleshooting

ProblemSolution
Legitimate email marked as spamAdd sender to whitelist; raise spam threshold
Still receiving too much spamLower spam threshold; enable auto-delete for high scores
Spam filter not workingVerify SpamAssassin is enabled in cPanel/DirectAdmin
All email going to spamCheck if your own domain's SPF/DKIM records are misconfigured
Filter rules not applyingVerify filter order — filters are processed top to bottom

Need help with spam filtering? Contact our support team at {{SUPPORT_URL}} or email {{SUPPORT_EMAIL}}.