You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Khanh Truong <k1...@gmail.com> on 2009/12/17 18:00:36 UTC

testing spamassassin,sa-learn not work

Hi,

I created a sample message, then tell spamassassin to learn it as spam
with the command
#sa-learn --spam spamtest.txt

then I tried the command
#spamc < spamtest.txt

but spamassassin still scored it as non-spam. Am I doing something
wrong? Please help!

Here is my spamtest.txt (based on GTUBE):

Subject: Test spam mail (GTOBE)
Message-ID: <GT...@example.net>
Date: Wed, 23 Jul 2003 23:30:00 +0200
From: Sender <se...@example.net>
To: Recipient <re...@example.net>
Precedence: junk
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

rwo*moiseimfos.oiamf*ifomie*ioefs-fnoianee-fpqo-noi-afes-afesf*e.34rm
http://www.cometomystore.com

Re: testing spamassassin,sa-learn not work

Posted by John Hardin <jh...@impsec.org>.
On Thu, 17 Dec 2009, Khanh Truong wrote:

> I created a sample message, then tell spamassassin to learn it as spam 
> with the command
> #sa-learn --spam spamtest.txt
>
> then I tried the command
> #spamc < spamtest.txt
>
> but spamassassin still scored it as non-spam. Am I doing something
> wrong? Please help!

Training a message as spam does not guarantee the next time the exact same 
message is seen that it will be scored as spam. It's not a "poison pill" 
tool.

Training a message as spam tells SA that messages that look similar to the 
trained messages will be scored "more spammy" than they otherwise would 
be. This may push the overall score past a threshold.

Three things you need to look at:

(1) Have you trained enough spam _and_ ham messages to give the bayes 
database enough to work with to make decisions? Run "sa-learn --dump 
magic" and verify that you have at least 200 spam _and_ 200 ham tokens.

(2) What was the bayes score on the message the first time you passed it 
through SA for scoring, _before_ using it for training?

(3) What was the bayes score on the message when you passed it through SA 
for scoring _after_ training?

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   "Bother," said Pooh as he struggled with /etc/sendmail.cf, "it never
   does quite what I want. I wish Christopher Robin was here."
 				           -- Peter da Silva in a.s.r
-----------------------------------------------------------------------
  8 days until Christmas