How to Configure Spam Assassin to Tag Emails as SPAM

By configuring Spam Assassin, you can automatically detect unwanted emails and tag them with a clear subject line. Spam emails can clutter your inbox and reduce productivity.

This guide explains how to set up Spam Assassin spam filters to mark suspicious emails with ***SPAM***.

Steps to Configure SpamAssassin

  1. Access SpamAssassin Directory
    Go to the .spamassassin directory of your user:
    cd /home/username/.spamassassin
  2. Edit User Preferences
    Open the user_prefs file with a text editor:
    pico /home/wwwmfm/.spamassassin/user_prefs
  3. Set Required Rules
    Add or update the following lines:
    required_hits 1
    rewrite_subject 1
    rewrite_header Subject *****SPAM*****

Please Note:

  • required_hits 1 >> Sets the spam score threshold to mark an email as spam.
  • rewrite_subject 1 >> Enables rewriting of the email subject line.
  • rewrite_header Subject *****SPAM***** >> Adds “SPAM” to the subject of detected spam emails.

Popular Posts You May Read

Explore more hosting insights, tips and industry updates.

What Is Localhost? How 127.0.0.1 Works

What Is Localhost? How 127.0.0.1 Works (Complete Guide)

Localhost is the name your own computer uses to refer to itself. Whenever you type…

How to Edit or Manage DNS Records in Plesk

How to Edit and Manage DNS Records in Plesk

In this article, we will explain how you can edit or manage DNS records in…

cPanel account user interface

How to Change the Language in cPanel

cPanel is a widely used web hosting control panel that helps you manage your website,…