bayes discard messages

General eFa discussion
Post Reply
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

bayes discard messages

Post by nicola.piazzi »

It happened that bayes record less messages than they arrived and are in range
for example i received 10 spamwith score in range and it recorded only 2
if i do a spamassassin -D < message it record the entry !

Is possible that is a priority issue so bayes look at message before it have the right score by other ruiles ?
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: bayes discard messages

Post by shawniverson »

Are you using Bayes or TxRep? You should use TxRep instead. May be an issue because eFa4 has a TxRep table instead.
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

Re: bayes discard messages

Post by nicola.piazzi »

i amusing both
but is seems that it takes only some spams, not all
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

Re: bayes discard messages

Post by nicola.piazzi »

this is a fresh install without any modifications, but it also coours in production system
I put bayes_auto_learn_threshold_spam 2
But also if received a loto of spam number of spam learned stays at 0
(sometimes increases but not as spam received)
Cattura1.PNG
Cattura1.PNG (31.01 KiB) Viewed 3646 times
Cattura1.PNG
Cattura1.PNG (31.01 KiB) Viewed 3646 times
Attachments
Cattura2.PNG
Cattura2.PNG (13.93 KiB) Viewed 3646 times
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

Re: bayes discard messages

Post by nicola.piazzi »

I cleaned bayes database and wait, after some times i noticed 3 spam elements in it, same as spam messages with score > 12
So it seems that is impossible to change default 12 score to learn spam
if i make a spmassassin -d of a message < 12 il learn correctly
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

Re: bayes discard messages

Post by nicola.piazzi »

I put these in mailscanner.cf and local.cf
bayes_auto_learn_threshold_nonspam -2
bayes_auto_learn_threshold_spam 2

but it doesnt take spam for this that is more than 2 !
Cattura.PNG
Cattura.PNG (1.98 KiB) Viewed 3643 times
Ham work well because it doesnt take this -0.78 because new value is -2 instead of original 0.1
Cattura.PNG
Cattura.PNG (1.88 KiB) Viewed 3643 times
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: bayes discard messages

Post by shawniverson »

2 is too low...and even at a minimum of 6 you need 3 points from both the header and body to pass

bayes_auto_learn_threshold_spam n.nn (default: 12.0)

The score threshold above which a mail has to score, to be fed into SpamAssassin's learning systems automatically as a spam message.

Note: SpamAssassin requires at least 3 points from the header, and 3 points from the body to auto-learn as spam. Therefore, the minimum working value for this option is 6.
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

Re: bayes discard messages

Post by nicola.piazzi »

did you mean that if i put 5 it is invalid and it stays at 12 ?
nicola.piazzi
Posts: 388
Joined: 23 Apr 2015 09:45

Re: bayes discard messages

Post by nicola.piazzi »

Cattura.PNG
Cattura.PNG (8.91 KiB) Viewed 3607 times
also with bayes_auto_learn_threshold_spam 6.00 it takes only over 12
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: bayes discard messages

Post by pdwalker »

Nicola,

If you want to see at a glance if a message has been autolearned or not, you can make this quick change to /var/www/html/mailscanner/status.php

change

Code: Select all

 salearn,
 '' AS status
FROM
 maillog
WHERE
to

Code: Select all

 salearn,
 '' AS status
,case
when spamreport like '%autolearn=spam%' then 'spam'
when spamreport like '%autolearn=not spam%' then 'not spam'
else '-'
end as 'Auto Learn'
FROM
 maillog
WHERE
and then you'll see which messages have been autolearned.

See here for more details: viewtopic.php?t=2642
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: bayes discard messages

Post by pdwalker »

Also, to see what's happening with autolearn, I run spamassassin in debug mode to find out why a message is autolearned or not

I use this script, called spamtest

Code: Select all

#!/bin/bash

MSG=$1

DIR=/var/spool/MailScanner/quarantine/

FILE=`find $DIR -name $1 -print`
echo $FILE

ls -l $FILE

if [ -f $FILE/message ] ; then
        echo "found $FILE/message"
        #spamassassin -D -t < $FILE/message 2>&1 |vim -
        spamassassin -D -t < $FILE/message 2>&1 |less
elif [ -f $FILE ] ; then
        echo "found $FILE"
        #spamassassin -D -t < $FILE 2>&1 |vim -
        spamassassin -D -t < $FILE 2>&1 |less
else
        echo "cannot find $FILE or ./message"
fi
do a ./spamtest <messageid> and then search for "autolearn".

Here is the log result from 1 message that was autolearned
Feb 9 17:03:20.523 [6691] dbg: plugin: Mail::SpamAssassin::Plugin::AutoLearnThreshold=HASH(0x2f73aa0) implements 'autolearn_discriminator', priority 0
Feb 9 17:03:20.524 [6691] dbg: learn: auto-learn? ham=0.1, spam=6, body-points=6.15, head-points=5.923, learned-points=6
Feb 9 17:03:20.524 [6691] dbg: learn: auto-learn: autolearn_force not flagged for a rule. Body Only Points: 6.15 (3 req'd) / Head Only Points: 5.923 (3 req'd)
Feb 9 17:03:20.524 [6691] dbg: learn: auto-learn? yes, spam (24.97 > 6) autolearn_force=no
Feb 9 17:03:20.524 [6691] dbg: plugin: Mail::SpamAssassin::Plugin::TxRep=HASH(0x33febd0) implements 'autolearn', priority 0
Feb 9 17:03:20.524 [6691] dbg: learn: initializing learner
Feb 9 17:03:20.525 [6691] dbg: learn: learning spam
and here is the results from one that wasn't, even though it was seen as spam by spamassassin.
Feb 9 17:04:43.697 [6969] dbg: plugin: Mail::SpamAssassin::Plugin::AutoLearnThreshold=HASH(0x3d51cc8) implements 'autolearn_discriminator', priority 0
Feb 9 17:04:43.697 [6969] dbg: learn: auto-learn? ham=0.1, spam=6, body-points=1.701, head-points=10.286, learned-points=6
Feb 9 17:04:43.698 [6969] dbg: learn: auto-learn: autolearn_force not flagged for a rule. Body Only Points: 1.701 (3 req'd) / Head Only Points: 10.286 (3 req'd)
Feb 9 17:04:43.698 [6969] dbg: learn: auto-learn? no: scored as spam but too few body points (1.701 < 3)
Post Reply