: TrainingSpamAssassin

Welcome :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Nathan Olson solved this on the forums at this link: SpamAssassin Training Options

Reprinted here with some edits by MichaelWexler:

Make sure your server has perl module DB_File installed. If not, log a support ticket.

Make 2 new folders in your IMAP/webmail system: spam and ham. Spam is where you put spam you find, and ham is where you put examples of good mail (and misfires from the spam folder). You can also use your inbox for this if you want.

After activating Spam Assassin, I logged into my FTP account and changed to home/.spamassassin and opened the file marked "user_prefs". At the bottom of the document, I appended these rules:

auto_learn 1
ok_languages en
ok_locales en
report_safe 1
required_score 8
use_bayes 1
use_dcc 1
use_pyzor 1
use_razor2 1

Then, I changed to the directory home/public_html/cgi-bin and created a document with 755 as permissions: spam.sh. (Fill in your domain name where it says "somedomain".)

spam.sh:

#!/bin/sh
echo "Learning SPAM"
DNAME="$HOME/mail/somesite.com/"
for USER in $(ls $DNAME)
do
cd $DNAME
cd $USER
echo ""
echo "Processing $DNAME$USER"
sa-learn --spam --siteconfigpath=/usr/share/spamassassin --showdots .spam/cur/
sa-learn --ham --siteconfigpath=/usr/share/spamassassin --showdots .ham/cur/
rm -rf /.spam/cur/*
rm -rf /.ham/cur/*
cd ..
cd ..
done
echo "Done"





Then, I opened up cPanel and went to Cron jobs. After selecting "Advanced (Unix Style)" I input the following (using my account name where it says "accountname"):

0 5 * * * /home/accountname/public_html/cgi-bin/spam.sh

I also input my email address so that the results of my two Cron scripts would be returned to me each day.

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0448 seconds