Ahosting Logo
Knowledge Base

How to Configure Spam Filters in cPanel

Spam filters help keep unwanted emails out of your inbox. cPanel includes Apache SpamAssassin, a powerful spam detection system.

Enabling Spam Filters

  1. Log into cPanel
  2. Go to Email section
  3. Click Spam Filters
  4. Toggle Process New Emails and Mark them as Spam to ON

Auto-Delete Spam

Automatically delete emails detected as spam:

  1. In Spam Filters, enable Move New Spam to a Separate Folder (Spam Box)
  2. Or enable Automatically Delete New Spam (Auto-Delete)

Warning: Auto-delete may remove legitimate emails. Use Spam Box first to monitor accuracy.

Spam Threshold (Sensitivity)

SpamAssassin gives each email a spam score. Lower threshold = more aggressive filtering.

  1. Click Spam Threshold Score
  2. Select a threshold:
    • 1-4: Aggressive (may catch legitimate emails)
    • 5: Default (balanced)
    • 6-10: Permissive (less spam caught)
  3. Click Update Scoring Options

Whitelist (Always Allow)

Ensure emails from trusted senders are never marked as spam:

  1. Click Show Additional Configurations
  2. Click Edit Spam Whitelist Settings
  3. Add email addresses or domains:
    [email protected]
    *@partnercompany.com
  4. Click Update Whitelist

Blacklist (Always Block)

Block specific senders:

  1. Click Edit Spam Blacklist Settings
  2. Add email addresses or domains:
    [email protected]
    *@spamdomain.com
  3. Click Update Blacklist

Email Filters for Spam

Create custom filters for more control:

  1. Go to Email > Email Filters
  2. Click Manage Filters for your email account
  3. Click Create a New Filter
  4. Set rules like:
    • If Subject contains "viagra" - Discard
    • If From contains "@spam.com" - Discard

Spam Box Folder

When Spam Box is enabled, spam goes to a "spam" folder in webmail:

  1. Access Webmail
  2. Check the Junk or Spam folder
  3. Review for false positives
  4. Mark legitimate emails as "Not Spam"

Understanding Spam Headers

SpamAssassin adds headers to emails showing why they were flagged:

  • X-Spam-Status: Yes/No and score
  • X-Spam-Score: Numeric spam score
  • X-Spam-Report: Detailed breakdown

View these in your email client by looking at message headers/source.

Tips to Reduce Spam

  • Never post your email publicly on websites
  • Use contact forms instead of mailto links
  • Create separate addresses for signups
  • Do not respond to spam (confirms address is valid)
  • Unsubscribe from legitimate lists you no longer want

Legitimate Emails Going to Spam?

  • Add sender to whitelist
  • Increase spam threshold score
  • Check if sender has proper SPF/DKIM
  • Contact sender to fix their email configuration