Quarantining Spam Messages

Use the following "quarantine spam" filter to decrease the number of spam messages directed to a recipient's mailbox. The "quarantine spam" filter is a modification to the default policy script filter found in "Policy Script 6: Calculate Spam Probability, Modify and Deliver". Unlike the default policy script filter, the "quarantine spam" filter quarantines messages when the spam probability is over 80%. (The default policy filter only "files" spam messages when the spam probability is over 50%. See the pmx_file command in the pmx-policy manpage.

# attr NAME=quarantine spam
# Quarantines spam if probability over 80%.
# Else, delivers message if probability over 50%.
# Prefixes "Subject" header with "[SPAM:]".
# Adds an "X-PMX-Spam" header.
if pmx_spam_prob :over 80 {
    pmx_quarantine "Spam";
    stop;
}
elsif pmx_spam_prob :over 50 {
    pmx_replace_header "Subject" "[SPAM:%%GAUGE%%] %%SUBJECT%%";
    pmx_add_header "X-PMX-Spam" "Probability=%%PROB%%";
}

Description:

Where does this filter go?

The "quarantine spam" filter replaces the filter found in "Policy Script 6: Calculate Spam Probability, Modify and Deliver". Replacing this default policy filter with the "quarantine spam" filter ensures that:

Related concepts
Policy Script 6: Calculate Spam Probability, Modify and Deliver
Related information
pmx-policy