Spamassassin Keyword Blacklist Configuration

Posted on 2009-02-15
Last Modified: 2013-12-16
How to I configure spamassassin in to catch certain keywords?

Example:  I want to block the keyword 'viagra'.
Question by:thomaswright
    LVL 23

    Accepted Solution

    Put into your

    body BODY_VIAGRA /viagra/i
    describe BODY_VIAGRA Something about viagra
    score BODY_VIAGRA 2

    Some explanations:
    body BODY_VIAGRA /viagra/i
    body - search for specified word/phrase in email's body (you can put here 'header' to search headers instead of body).
    BODY_VIAGRA - rule name (can be anything you want)
    /viagra/i - regex pattern to match your word/phrase. ending 'i' flag means case insensitive

    describe BODY_VIAGRA Something about viagra
    This line is description for rule BODY_VIAGRA, and description is: "Something about viagra".

    score BODY_VIAGRA 2
    Give 2 additional points every email which matches BODY_VIAGRA rule.
    LVL 3

    Author Closing Comment

    Thank you! That was an excellent and fast answer.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now