welcome: please sign in

Diff for "FeedingSpamAssassin"

Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2005-11-29 02:17:04
Size: 1595
Editor: MichaelOlson
Comment: Migrate from old wiki.
Revision 4 as of 2013-01-14 09:13:19
Size: 1826
Editor: ClintonEbadi
Comment: cat / a bit outdated
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 25: Line 24:
SHAREDDIR=/etc/spamassassin/Maildir/.SiteSpam/cur #SHAREBASE=/etc/spamassassin # an older instance
SHAREBASE=~spamd # current name circa 1/2010
SHAREDDIR=$SHAREBASE/Maildir/.SiteSpam/cur
Line 47: Line 48:
SHAREDDIR=/etc/spamassassin/Maildir/.SiteHam/cur #SHAREBASE=/etc/spamassassin # an older instance
SHAREBASE=~spamd # current name circa 1/2010
SHAREDDIR=$SHAREBASE/Maildir/.SiteHam/cur
Line 60: Line 63:
----
CategoryOutdated CategoryMemberManual

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
SPAMDIR=~/Maildir/.Spam.Definitely/cur

# Destination directory for spam messages
#SHAREBASE=/etc/spamassassin  # an older instance
SHAREBASE=~spamd    # current name circa 1/2010
SHAREDDIR=$SHAREBASE/Maildir/.SiteSpam/cur

# 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");
do
    cp $i $SHAREDDIR
done

feed-site-ham

# Prefix for folder locations
MAILPRE=~/Maildir/.

# 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
SHAREDDIR=$SHAREBASE/Maildir/.SiteHam/cur

# 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:.*\*\*\*");
    do
        cp $i $SHAREDDIR
    done
done


CategoryOutdated CategoryMemberManual

FeedingSpamAssassin (last edited 2013-01-14 09:13:19 by ClintonEbadi)