welcome: please sign in

Please enter your password of your account at the remote wiki below.
/!\ You should trust both wikis because the password could be read by the particular administrators.

Clear message


This page contains example scripts for automating the process of giving SpamAssassin feedback.

1. Warning

Your mileage may vary. Feel free to fix bugs. Test these scripts before making use of them. Make sure you know what you're doing.

2. Scripts

feed-site-spam: Feed uncaught spam messages to SpamAssassin.

NOTE: It is assumed that you empty your Spam folder after running this script. Otherwise you'll feed some of the same messages to SpamAssassin every time you run the script.

# Location of your spam directory

# Destination directory for spam messages
#SHAREBASE=/etc/spamassassin  # an older instance
SHAREBASE=~spamd    # current name circa 1/2010

# Copy files were not marked as spam to the site folder
for i in $(find $SPAMDIR -type f -print0 | xargs -0 grep -l "^X-Spam-Status: N");
    cp $i $SHAREDDIR


# Prefix for folder locations

# IMAP directories that contain definite non-spam (ham)
HAMDIRS="Bugs Family Friends Fun Gnu Info Lists Plug School Work"

# Destination directory for ham messages
#SHAREBASE=/etc/spamassassin   # an older instance
SHAREBASE=~spamd     # current name circa 1/2010

# Copy files that were erroneously marked as spam to the site folder.
# Note: This includes email with a spam level of 3 or higher,
#       30 days old or less.
for i in $HAMDIRS; do
    echo Learning ham in $i:
    for i in $(find $MAILPRE$i/cur -type f -ctime 30 -print0 | xargs -0 grep -l "^X-Spam-Level:.*\*\*\*");
        cp $i $SHAREDDIR

CategoryOutdated CategoryMemberManual