Hello SuSE people. Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it. What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam" Then I get this strange message. "No such file or directory at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/CmdLearn.pm line 120." Can somebody, please, tell me what I am doing wrong here? Bob S.
On Tuesday 24 February 2004 21:07, Bob S. wrote:
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam"
Is this special mailbox a mbox format or is it maildir format? I think KDE defaults to maildir, in which case you have to have a sa-learn script that supports that format, such as this one #!/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"); -- _____________________________________ John Andersen
On Wednesday 25 February 2004 01:15 am, John Andersen wrote:
On Tuesday 24 February 2004 21:07, Bob S. wrote:
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam"
Is this special mailbox a mbox format or is it maildir format? I think KDE defaults to maildir, in which case you have to have a sa-learn script that supports that format, such as this one ...............<snipped but saved>................
Thanks John, Jon, & Jon for replying. It is appreciated. John, don't really know what Kmail format is. If I check on the properties of that mailbox the format is greyed out, but looking carefully it looks like mbox. Anyway, I know nothing about scripts, where to put them, or how to execute them. Wish I did :-( Maybe someday I will. I am trying. Jon & Jon Both of you sent me basically the same thing with a slightly different approach, and I said "A Ha !" that is the problem. I understood what you were telling me. Unfortunately, it did not work by using either of the suggestions. Get the same old " "No such file or directory at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/CmdLearn.pm line 120." So then I created a regular (non-mail) directory and moved all of the MissedSpam messages into it and did an sa-learn on it. Told me it learned from 8 of the 50+ messages I put in there. Don't know why it learned from only 8 out of 50 ?? but I guess that is another story. Anyway, can't keep doing that because I would spend forever moving messages around so sa-learn would work. If any of you have more suggestions or guidance it would really be appreciated. Thanks again, Bob.S PS John, If you could point me at some way of learning how to use scripts it would also be really appreciated.
On Fri, 2004-02-27 at 00:40, Bob S. wrote:
On Wednesday 25 February 2004 01:15 am, John Andersen wrote:
On Tuesday 24 February 2004 21:07, Bob S. wrote:
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam"
Is this special mailbox a mbox format or is it maildir format? I think KDE defaults to maildir, in which case you have to have a sa-learn script that supports that format, such as this one ...............<snipped but saved>................
Thanks John, Jon, & Jon for replying. It is appreciated.
John, don't really know what Kmail format is. If I check on the properties of that mailbox the format is greyed out, but looking carefully it looks like mbox. Anyway, I know nothing about scripts, where to put them, or how to execute them. Wish I did :-( Maybe someday I will. I am trying.
Jon & Jon Both of you sent me basically the same thing with a slightly different approach, and I said "A Ha !" that is the problem. I understood what you were telling me. Unfortunately, it did not work by using either of the suggestions. Get the same old " "No such file or directory at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/CmdLearn.pm line 120."
So then I created a regular (non-mail) directory and moved all of the MissedSpam messages into it and did an sa-learn on it. Told me it learned from 8 of the 50+ messages I put in there. Don't know why it learned from only 8 out of 50 ?? but I guess that is another story.
Anyway, can't keep doing that because I would spend forever moving messages around so sa-learn would work. If any of you have more suggestions or guidance it would really be appreciated.
Thanks again, Bob.S
PS John, If you could point me at some way of learning how to use scripts it would also be really appreciated.
A quick suggestion based on how I use sa-learn with Evolution mbox. I found that I needed to absolutely specify the missed spam folder mbox. sa-learn --spam --mbox /home/mylocation/MissedSpam/mbox Without the mbox at the end of the directory location, sa-learn would not work. HTH -- Ralph Sanford - If your government does not trust you, rsanford@telusplanet.net - should you trust your government? DH/DSS Key - 0x7A1BEA01
Thanks. I am getting so much spam that I just decided to start studying. BTW does it matter if you have multiple pop3 accounts in evolution? CWSIV On Sat, 2004-02-28 at 19:39, Ralph Sanford wrote:
A quick suggestion based on how I use sa-learn with Evolution mbox. I found that I needed to absolutely specify the missed spam folder mbox.
sa-learn --spam --mbox /home/mylocation/MissedSpam/mbox
Without the mbox at the end of the directory location, sa-learn would not work.
HTH
-- Ralph Sanford - If your government does not trust you, rsanford@telusplanet.net - should you trust your government?
DH/DSS Key - 0x7A1BEA01
I do not believe it matters. I have 3 pop accounts; evolution gets all the mail from the accounts every few minutes. Rather than dump all mail into the "Inbox" (which evolution would do), I have evolution filter through spamassassin and in to many folders. Any spam that is missed, regardless of account or folder, I move into the "missed_spam" folder. Probably about once a week I run sa-learn against the "missed_spam" folder. Been doing this for about 3 months now and less than 1% of spam gets through. Of course before I started using spamassassin I had been saving spam and so I probably had 3500 spam messages and 2500 ham messages to initially use with sa-learn. In the first month of using spamassassin I also used to need a "ham-missed" folder to keep for training spamassassin and may have had as many as 10 emails that were initially flagged as spam. It appears that with a sufficiently large enough initial training pool of ham and spam plus some ongoing use of sa-learn that spamassassin will severely reduce the problem of spam. On Sun, 2004-02-29 at 18:27, Carl William Spitzer IV wrote:
Thanks. I am getting so much spam that I just decided to start studying. BTW does it matter if you have multiple pop3 accounts in evolution?
CWSIV
On Sat, 2004-02-28 at 19:39, Ralph Sanford wrote:
A quick suggestion based on how I use sa-learn with Evolution mbox. I found that I needed to absolutely specify the missed spam folder mbox.
sa-learn --spam --mbox /home/mylocation/MissedSpam/mbox
Without the mbox at the end of the directory location, sa-learn would not work.
HTH
-- Ralph Sanford - If your government does not trust you, rsanford@telusplanet.net - should you trust your government?
DH/DSS Key - 0x7A1BEA01
-- Ralph Sanford - If your government does not trust you, rsanford@telusplanet.net - should you trust your government?
DH/DSS Key - 0x7A1BEA01
On Saturday 28 February 2004 10:39 pm, Ralph Sanford wrote:
On Fri, 2004-02-27 at 00:40, Bob S. wrote:
On Wednesday 25 February 2004 01:15 am, John Andersen wrote:
On Tuesday 24 February 2004 21:07, Bob S. wrote:
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "# ......<snip>.............
A quick suggestion based on how I use sa-learn with Evolution mbox. I found that I needed to absolutely specify the missed spam folder mbox.
sa-learn --spam --mbox /home/mylocation/MissedSpam/mbox
Without the mbox at the end of the directory location, sa-learn would not work.
Thanks for replying Ralph, and you also David Alas, neither of your suggestions worked for me. Beginning to tick me off !!! I would like to really try John Amderson's little script, but I don't know where to put it or what to do with it. Thanks again, Bob S.
On Sunday 29 February 2004 20:55, Bob S. wrote:
On Saturday 28 February 2004 10:39 pm, Ralph Sanford wrote:
On Fri, 2004-02-27 at 00:40, Bob S. wrote:
On Wednesday 25 February 2004 01:15 am, John Andersen wrote:
On Tuesday 24 February 2004 21:07, Bob S. wrote:
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "#
......<snip>.............
A quick suggestion based on how I use sa-learn with Evolution mbox. I found that I needed to absolutely specify the missed spam folder mbox.
sa-learn --spam --mbox /home/mylocation/MissedSpam/mbox
Without the mbox at the end of the directory location, sa-learn would not work.
Thanks for replying Ralph, and you also David
Alas, neither of your suggestions worked for me. Beginning to tick me off !!!
I would like to really try John Amderson's little script, but I don't know where to put it or what to do with it.
It goes in a file that gets run once in a while. Put it somewhere where root can run it, and name it whatever you wish. Then set its permissions so that it is executable chmod 700 mylittlescript I run mine out of cron job at 3am every night. (as root). The script (repeated below) has been modified to work with maildir NOT mbox... pen:~/bin # cat my-sa-learn.pl #!/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"); -- _____________________________________ John Andersen
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 26 February 2004 11:40 pm, Bob S. wrote:
On Wednesday 25 February 2004 01:15 am, John Andersen wrote:
On Tuesday 24 February 2004 21:07, Bob S. wrote:
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam"
Is this special mailbox a mbox format or is it maildir format? I think KDE defaults to maildir, in which case you have to have a sa-learn script that supports that format, such as this one
- ----------snip-------------
So then I created a regular (non-mail) directory and moved all of the MissedSpam messages into it and did an sa-learn on it. Told me it learned from 8 of the 50+ messages I put in there. Don't know why it learned from only 8 out of 50 ??
I think that spamassasin is only learning from messages that it has not checked (learned from) previously. Using the above command very few of my mails are not learned from unless I haven't emptied the directory between runs My missed spam folder appears to be in maildir format (the option is greyed out). My setup is as follows. Created a folder named "assassin" created a sub folder "missedSpam" My learn spam command is sa-learn --spam --dir /home/dh0/Mail/.Assassin.directory/missedSpam/cur I don't have to cd into the directory since I'm using the full path notice the /cur directory, this may have some effect on your problems - -- dh Don't shop at ZipZoomFly.com! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQFAQXFhBwgxlylUsJARApkeAKCHkGDbkhnowqQaBer42r4BGMGZzwCgmOB3 8radDUZBszaUVrdh0IMkSnc= =p1pF -----END PGP SIGNATURE-----
On Wed, Feb 25, 2004 at 01:07:42AM -0500, Bob S. wrote:
Hello SuSE people.
Originally set up spamassassin and had it learn from my mailboxes in Kmail. worked fine. I set up a special spam mailbox with a sub-mailbox named MissedSpam in which I placed spam that was slipping through. Now I want sa-learn to check on that mailbox and learn from it.
What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam" ^ get rid of that.
The leading "/" makes SA look in your root directory.
Then I get this strange message.
Not strange, on the contrary:
"No such file or directory at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/CmdLearn.pm line 120."
Line 120 of CmdLearn.pm is where the script fails, because there is no such file.
Can somebody, please, tell me what I am doing wrong here?
HTH /Jon -- Whatever rocks your boat!
On Wednesday 25 February 2004 06:07, Bob S. wrote:
Hello SuSE people. Hi Bob :)
What I do is, cd into: '/home/bob/Mail' and then do a: "# sa-learn --spam --mbox -f /spam/MissedSpam" The problem is that you have "-f /spam.." this is looking in the root directory for a spam folder - you know, where you have /var /opt /tmp /usr /home etc, it is searching for /spam. Try ./spam/MissedSpam.
"No such file or directory at /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin/CmdLearn.pm line 120." Well, /spam/MissedSpam doesn't exist, ./spam/MissesSpam does [note the leading"./" which indicates "Current Directory" rather than "/" which indicated the root of the filesystem :-D
Can somebody, please, tell me what I am doing wrong here? Easy mistake *nods* done it *sooooo* many times :)
participants (7)
-
Bob S.
-
Carl William Spitzer IV
-
David Herman
-
John Andersen
-
Jon Clausen
-
Ralph Sanford
-
The Purple Tiger