[SLUG] Spamassassin help.

From: Bob Stia (rnr@sanctum.com)
Date: Wed Apr 14 2004 - 01:22:46 EDT


Hello Sluggers,

Somewhat confused with sa-learn. I have a script to run sa-learn and it
seems to work but not to work. Originally built a pretty good data
base using sa-learn manually. Caught most of the spam and put it into
a folder in KDE called "Spam" (using KDE filters) Also made a folder
called "MissedSpam" and when something slipped through I would put it
in there to run sa-learn on. Over the past few months when I ran the
script sa-learn it did not learn anything. "Learned from 0 messages"

Tonight I ran the sa-learn script on about 150 messages in the Missed
Spam folder, and again, it did not learn anything. When I looked in the
"MissedSpam" folder in Kmail all of the messages were gone but the
count was still the same except that the headings were all "No
Subject" (The script is designed to delete them.) Pretty hard to
believe that sa-learn hasn't learned anything in the last few months
and spam is still slipping through. Here is the message from sa-learn:
-----------------------------------------------------------------------
linux:~ # ./spamscript.sh
please specify target type with --dir, --file, or
--mbox: /home/bob/Mail/NotSpam/cur/*
Learned from 0 messages.
rm: cannot remove `/home/bob/Mail/NotSpam/cur/*': No such file or
directory
please specify target type with --dir, --file, or
--mbox: /home/bob/Mail/MissedSpam/cur/*
Learned from 0 messages.
rm: cannot remove `/home/bob/Mail/MissedSpam/cur/*': No such file or
directory
linux:~ #
-------------------------------------------------------------------------
Here is my script"
-----------------------------------------------------------------------
#!/usr/bin/perl

###################################################################
# A script to automatically update SpamAssassin's Bayesian filter
# Michael Reynolds - michael@spinweb.net
# SpinWeb Net Designs - http://www.spinweb.net
###################################################################

# set some variables
$SA_LEARN = "/usr/bin/sa-learn";
$HOME = "/home";
$FOLDER_DIR = "Mail";
$MISSEDSPAM_FOLDER = "MissedSpam";
$NOTSPAM_FOLDER = "NotSpam";

# get a listing of users
@user = `ls -1 $HOME`;

# loop and process
for($i=0;$i<@user;$i++)
{
        # trim carriage return
        chop($user[$i]);

        # define where ham is located
        my $user_notspam_folder =
"$HOME/$user[$i]/$FOLDER_DIR/$NOTSPAM_FOLDER/cur";

        # if the folder exists, learn from it
        if(-e $user_notspam_folder)
        {
                system("$SA_LEARN --ham $user_notspam_folder/*");
                system("rm $user_notspam_folder/*");
        }

        # define where spam is located
        my $user_missedspam_folder =
"$HOME/$user[$i]/$FOLDER_DIR/$MISSEDSPAM_FOLDER/cur";

        # if the folder exists, learn from it
        if(-e $user_missedspam_folder)
        {
                system("$SA_LEARN --spam $user_missedspam_folder/*");
                system("rm $user_missedspam_folder/*");
        }
}

# rebuild the database
system("$SA_LEARN --rebuild");
----------------------------------------------------------------
Is it just me? Or is there something wrong here?

Thanks, guys Bob S.
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:36:10 EDT