Page 1 of 1
bayes discard messages
Posted: 05 Feb 2021 17:39
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 ?
Re: bayes discard messages
Posted: 06 Feb 2021 11:48
by shawniverson
Are you using Bayes or TxRep? You should use TxRep instead. May be an issue because eFa4 has a TxRep table instead.
Re: bayes discard messages
Posted: 08 Feb 2021 07:37
by nicola.piazzi
i amusing both
but is seems that it takes only some spams, not all
Re: bayes discard messages
Posted: 08 Feb 2021 08:47
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 (31.01 KiB) Viewed 7554 times

- Cattura1.PNG (31.01 KiB) Viewed 7554 times
Re: bayes discard messages
Posted: 08 Feb 2021 09:26
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
Re: bayes discard messages
Posted: 08 Feb 2021 10:09
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 (1.98 KiB) Viewed 7551 times
Ham work well because it doesnt take this -0.78 because new value is -2 instead of original 0.1

- Cattura.PNG (1.88 KiB) Viewed 7551 times
Re: bayes discard messages
Posted: 09 Feb 2021 04:42
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.
Re: bayes discard messages
Posted: 09 Feb 2021 07:29
by nicola.piazzi
did you mean that if i put 5 it is invalid and it stays at 12 ?
Re: bayes discard messages
Posted: 09 Feb 2021 07:36
by nicola.piazzi

- Cattura.PNG (8.91 KiB) Viewed 7515 times
also with bayes_auto_learn_threshold_spam 6.00 it takes only over 12
Re: bayes discard messages
Posted: 09 Feb 2021 08:59
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
Re: bayes discard messages
Posted: 09 Feb 2021 09:05
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)