You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Gene Heskett <ge...@verizon.net> on 2007/02/02 18:37:55 UTC

running sa-learn destroys message

Greetings;

SA 3.1.7, driven by procmail, feeding it all on to kmail for sorting.

I have ceased running sa-learn --ham on false positives for the last 
couple of months because it nulls the message since I installed FC6.  Is 
there a way to preserve the message in the case of teaching it ham, that 
it made a mistake?

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.

Re: running sa-learn destroys message

Posted by Gene Heskett <ge...@verizon.net>.
On Friday 02 February 2007 23:13, Gene Heskett wrote:
>On Friday 02 February 2007 13:26, Theo Van Dinter wrote:
>>On Fri, Feb 02, 2007 at 12:37:55PM -0500, Gene Heskett wrote:
>>> I have ceased running sa-learn --ham on false positives for the last
>>> couple of months because it nulls the message since I installed FC6.
>>> Is there a way to preserve the message in the case of teaching it
>>> ham, that it made a mistake?
>>
>>It sounds like you're calling sa-learn as a filter, which it isn't. 
>> The script doesn't modify/delete the files you pass to it, but "cat
>> message
>>
>> | sa-learn" won't produce the message as output.
>
>I don't think that's whats happening.  The command is being issued in
>shell script format, and looks like this in the kmail filters screen:
>sa-learn -L --ham --dir $HOME/Mail/ham/cur,  But you may be right, the
>command to do it wasn't 'execute', but 'pipe through'.  I'll change them
>both.  I have NDI when that changed though, I recall I was using the
> pipe through with FC2, and that didn't null the messages ever.
>
>I'll post again if this doesn't fix it, but I suspect you are 150% right
>at this point.  Many Thanks for the wake-up call.

PPS:

That did fix it, but the command itself needed to be changed I guess, 
kmail wouldn't save it, and cleared the rule when I tried to save it, so 
I consulted the manpage and recomposed the cli command, and that then 
seemed to have worked correctly.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.

Re: running sa-learn destroys message

Posted by Gene Heskett <ge...@verizon.net>.
On Friday 02 February 2007 13:26, Theo Van Dinter wrote:
>On Fri, Feb 02, 2007 at 12:37:55PM -0500, Gene Heskett wrote:
>> I have ceased running sa-learn --ham on false positives for the last
>> couple of months because it nulls the message since I installed FC6. 
>> Is there a way to preserve the message in the case of teaching it ham,
>> that it made a mistake?
>
>It sounds like you're calling sa-learn as a filter, which it isn't.  The
>script doesn't modify/delete the files you pass to it, but "cat message
> | sa-learn" won't produce the message as output.

I don't think that's whats happening.  The command is being issued in 
shell script format, and looks like this in the kmail filters screen:
sa-learn -L --ham --dir $HOME/Mail/ham/cur,  But you may be right, the 
command to do it wasn't 'execute', but 'pipe through'.  I'll change them 
both.  I have NDI when that changed though, I recall I was using the pipe 
through with FC2, and that didn't null the messages ever.

I'll post again if this doesn't fix it, but I suspect you are 150% right 
at this point.  Many Thanks for the wake-up call.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.

Re: running sa-learn destroys message

Posted by Theo Van Dinter <fe...@apache.org>.
On Fri, Feb 02, 2007 at 12:37:55PM -0500, Gene Heskett wrote:
> I have ceased running sa-learn --ham on false positives for the last 
> couple of months because it nulls the message since I installed FC6.  Is 
> there a way to preserve the message in the case of teaching it ham, that 
> it made a mistake?

It sounds like you're calling sa-learn as a filter, which it isn't.  The
script doesn't modify/delete the files you pass to it, but "cat message |
sa-learn" won't produce the message as output.

-- 
Randomly Selected Tagline:
"I could excite a little wave pulse ..."                - Prof. Aravind
 "Hey!  Look at me!  I'm a little wave pulse... Wheeee!" - Theo's Response

Re: running sa-learn destroys message

Posted by Gene Heskett <ge...@verizon.net>.
On Saturday 03 February 2007 15:17, Matt Kettler wrote:
>Gene Heskett wrote:
[...]
>> The target is a directory containing messages I've drag & dropped
>> there with kmail because of an SA miss-fire.
>
>Then do NOT use -f.
>
>Like I said, -f expects a FILE containing a LIST OF FILES. It does not
>expect a directory. It does not expect an email.
>
>If you feed sa-learn a directory name, without the -f, it will
>automatically read all the files in the directory as individual emails.
>
>ie, this command works:
>
>sa-learn /home/training/spam/
>
>Assuming /home/training/spam/ is a directory containing emails.
>
>sa-learn -f /home/training/spam/
>
>Will probably try to treat it as a directory full of files each
>containing lists of files. That's not what you have. You have a
>directory of emails.

Ok, I've taken out the -f, and appended a /* to the path, and I've got a 
couple of messages in there now.  Humm, no, just one, and it appears that 
either syntax works, it looked at that file the first time and skipped it 
the second time.

Thanks for the clarification.


-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.

Re: running sa-learn destroys message

Posted by Matt Kettler <mk...@verizon.net>.
Gene Heskett wrote:
> On Saturday 03 February 2007 09:49, Matt Kettler wrote:
>   
>> Gene Heskett wrote:
>>     
>>> On Friday 02 February 2007 22:28, Matt Kettler wrote:
>>>       
>>>> Gene Heskett wrote:
>>>>         
>>>>> Greetings;
>>>>>
>>>>> SA 3.1.7, driven by procmail, feeding it all on to kmail for
>>>>> sorting.
>>>>>
>>>>> I have ceased running sa-learn --ham on false positives for the last
>>>>> couple of months because it nulls the message since I installed FC6.
>>>>> Is there a way to preserve the message in the case of teaching it
>>>>> ham, that it made a mistake?
>>>>>           
>>>> Erm, can you be really specific on how you're calling sa-learn --ham?
>>>>
>>>> It's not supposed to modify the message file in any way.. if it is,
>>>> somethings wrong..
>>>>
>>>> Now, if you've got something trying to pipe a message through
>>>> sa-learn --ham, that will fail and generate an empty "message".
>>>> sa-learn isn't a pipe it does not echo the message back out to
>>>> stdout.
>>>>
>>>> However, running things like this should be safe for "somefile":
>>>>
>>>> sa-learn --ham /path/somefile
>>>>
>>>>
>>>> However this is not, and will destroy somefile:
>>>>
>>>> echo somefile | sa-learn --ham > somefile
>>>>         
>>> Actually, the correct syntax appears to be:
>>> sa-learn --ham (or --spam) -L -f /pathto/Mail/spam)|ham/cur.
>>>       
>> 1) -L is, at the moment, pointless. It does nothing. You can leave it
>> in, but in future versions this could reduce learning accuracy. Should
>> they ever add DNS or other network-dependent tokens to bayes, the -L
>> switch would suppress learning them. (This would be the only way -L
>> could matter). In general, I would say it's inadvisable to pass -L to
>> sa-learn, unless you always scan mail in -L mode. (no point in learning
>> network-test tokens when you're never going to scan for them..)
>>     
>
> Ok, thats not a problem to drop.
>
>   
>> 2) you DO NOT want to do -f, unless you've got a file containing a LIST
>> of files to be learned. If you want to learn a MESSAGE, drop the -f.
>>     
>
> The target is a directory containing messages I've drag & dropped there 
> with kmail because of an SA miss-fire.
>   
Then do NOT use -f.

Like I said, -f expects a FILE containing a LIST OF FILES. It does not
expect a directory. It does not expect an email.

If you feed sa-learn a directory name, without the -f, it will
automatically read all the files in the directory as individual emails.

ie, this command works:

sa-learn /home/training/spam/

Assuming /home/training/spam/ is a directory containing emails.

sa-learn -f /home/training/spam/

Will probably try to treat it as a directory full of files each
containing lists of files. That's not what you have. You have a
directory of emails.


Re: running sa-learn destroys message

Posted by Gene Heskett <ge...@verizon.net>.
On Saturday 03 February 2007 09:49, Matt Kettler wrote:
>Gene Heskett wrote:
>> On Friday 02 February 2007 22:28, Matt Kettler wrote:
>>> Gene Heskett wrote:
>>>> Greetings;
>>>>
>>>> SA 3.1.7, driven by procmail, feeding it all on to kmail for
>>>> sorting.
>>>>
>>>> I have ceased running sa-learn --ham on false positives for the last
>>>> couple of months because it nulls the message since I installed FC6.
>>>> Is there a way to preserve the message in the case of teaching it
>>>> ham, that it made a mistake?
>>>
>>> Erm, can you be really specific on how you're calling sa-learn --ham?
>>>
>>> It's not supposed to modify the message file in any way.. if it is,
>>> somethings wrong..
>>>
>>> Now, if you've got something trying to pipe a message through
>>> sa-learn --ham, that will fail and generate an empty "message".
>>> sa-learn isn't a pipe it does not echo the message back out to
>>> stdout.
>>>
>>> However, running things like this should be safe for "somefile":
>>>
>>> sa-learn --ham /path/somefile
>>>
>>>
>>> However this is not, and will destroy somefile:
>>>
>>> echo somefile | sa-learn --ham > somefile
>>
>> Actually, the correct syntax appears to be:
>> sa-learn --ham (or --spam) -L -f /pathto/Mail/spam)|ham/cur.
>
>1) -L is, at the moment, pointless. It does nothing. You can leave it
>in, but in future versions this could reduce learning accuracy. Should
>they ever add DNS or other network-dependent tokens to bayes, the -L
>switch would suppress learning them. (This would be the only way -L
>could matter). In general, I would say it's inadvisable to pass -L to
>sa-learn, unless you always scan mail in -L mode. (no point in learning
>network-test tokens when you're never going to scan for them..)

Ok, thats not a problem to drop.

>2) you DO NOT want to do -f, unless you've got a file containing a LIST
>of files to be learned. If you want to learn a MESSAGE, drop the -f.

The target is a directory containing messages I've drag & dropped there 
with kmail because of an SA miss-fire.

Those ham & spam directories are empty ATM, their contents having been fed 
at sa-learn with the syntax you saw, and moved or deleted accordingly.  
The directory if populated, would look like this:
[root@coyote cur]# pwd
/root/Mail/localmail/cur
[root@coyote cur]# ls
1156252320.3816.3sJYv:2,S   1166259743.6380.Xfrzr:2,S  
1167814934.5956.NpYWX:2,S   1169197383.6500.A8ORf:2,S
1156252320.3816.i9Jik:2,S   1166346132.7075.tIRbE:2,S  
1167901361.5970.Qb4bW:2,S   1169284081.6500.iFQhT:2,S
1165222982.28069.1Fh74:2,S  1166432530.8102.dKH5Q:2,S  
1167987756.19938.64eYI:2,S  1169370179.6500.iOqtK:2,S
 yadda yadda

The way I read the -f option, I am to supply the path to the directory as 
the source of the files sa-learn is to process.  I'll drop the -f, but I 
suspect I'll have to put it back since /root/Mail/folder_name/cur is a 
directory.  Or should I use /root/Mail/folder_name/cur/* instead?

>> At least the old behaviour is restored in that you highlight them all,
>> then pull down messages to the filter rule and apply it, the
>> highlighting is canceled as it scans each message, leaving only the
>> last one so marked. I assume at this point about 40 assorted messages
>> that had been building up have now been installed in the database.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.

Re: running sa-learn destroys message

Posted by Matt Kettler <mk...@verizon.net>.
Gene Heskett wrote:
> On Friday 02 February 2007 22:28, Matt Kettler wrote:
>   
>> Gene Heskett wrote:
>>     
>>> Greetings;
>>>
>>> SA 3.1.7, driven by procmail, feeding it all on to kmail for sorting.
>>>
>>> I have ceased running sa-learn --ham on false positives for the last
>>> couple of months because it nulls the message since I installed FC6. 
>>> Is there a way to preserve the message in the case of teaching it ham,
>>> that it made a mistake?
>>>       
>> Erm, can you be really specific on how you're calling sa-learn --ham?
>>
>> It's not supposed to modify the message file in any way.. if it is,
>> somethings wrong..
>>
>> Now, if you've got something trying to pipe a message through sa-learn
>> --ham, that will fail and generate an empty "message". sa-learn isn't a
>> pipe it does not echo the message back out to stdout.
>>
>> However, running things like this should be safe for "somefile":
>>
>> sa-learn --ham /path/somefile
>>
>>
>> However this is not, and will destroy somefile:
>>
>> echo somefile | sa-learn --ham > somefile
>>     
>
> Actually, the correct syntax appears to be:
> sa-learn --ham (or --spam) -L -f /pathto/Mail/spam)|ham/cur.
>   
1) -L is, at the moment, pointless. It does nothing. You can leave it
in, but in future versions this could reduce learning accuracy. Should
they ever add DNS or other network-dependent tokens to bayes, the -L
switch would suppress learning them. (This would be the only way -L
could matter). In general, I would say it's inadvisable to pass -L to
sa-learn, unless you always scan mail in -L mode. (no point in learning
network-test tokens when you're never going to scan for them..)

2) you DO NOT want to do -f, unless you've got a file containing a LIST
of files to be learned. If you want to learn a MESSAGE, drop the -f.
> At least the old behaviour is restored in that you highlight them all, 
> then pull down messages to the filter rule and apply it, the highlighting 
> is canceled as it scans each message, leaving only the last one so 
> marked. I assume at this point about 40 assorted messages that had been 
> building up have now been installed in the database.
>
>   


Re: running sa-learn destroys message

Posted by Gene Heskett <ge...@verizon.net>.
On Friday 02 February 2007 22:28, Matt Kettler wrote:
>Gene Heskett wrote:
>> Greetings;
>>
>> SA 3.1.7, driven by procmail, feeding it all on to kmail for sorting.
>>
>> I have ceased running sa-learn --ham on false positives for the last
>> couple of months because it nulls the message since I installed FC6. 
>> Is there a way to preserve the message in the case of teaching it ham,
>> that it made a mistake?
>
>Erm, can you be really specific on how you're calling sa-learn --ham?
>
>It's not supposed to modify the message file in any way.. if it is,
>somethings wrong..
>
>Now, if you've got something trying to pipe a message through sa-learn
>--ham, that will fail and generate an empty "message". sa-learn isn't a
>pipe it does not echo the message back out to stdout.
>
>However, running things like this should be safe for "somefile":
>
>sa-learn --ham /path/somefile
>
>
>However this is not, and will destroy somefile:
>
>echo somefile | sa-learn --ham > somefile

Actually, the correct syntax appears to be:
sa-learn --ham (or --spam) -L -f /pathto/Mail/spam)|ham/cur.

At least the old behaviour is restored in that you highlight them all, 
then pull down messages to the filter rule and apply it, the highlighting 
is canceled as it scans each message, leaving only the last one so 
marked. I assume at this point about 40 assorted messages that had been 
building up have now been installed in the database.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2007 by Maurice Eugene Heskett, all rights reserved.

Re: running sa-learn destroys message

Posted by Matt Kettler <mk...@verizon.net>.
Gene Heskett wrote:
> Greetings;
>
> SA 3.1.7, driven by procmail, feeding it all on to kmail for sorting.
>
> I have ceased running sa-learn --ham on false positives for the last 
> couple of months because it nulls the message since I installed FC6.  Is 
> there a way to preserve the message in the case of teaching it ham, that 
> it made a mistake?
>
>   
Erm, can you be really specific on how you're calling sa-learn --ham?

It's not supposed to modify the message file in any way.. if it is,
somethings wrong..

Now, if you've got something trying to pipe a message through sa-learn
--ham, that will fail and generate an empty "message". sa-learn isn't a
pipe it does not echo the message back out to stdout.

However, running things like this should be safe for "somefile":

sa-learn --ham /path/somefile


However this is not, and will destroy somefile:

echo somefile | sa-learn --ham > somefile