On 25/02/2021 18:42, Jenny Hopkins wrote:
On Thu, 25 Feb 2021 at 17:58, steve-ALUG@hst.me.uk wrote:
On 25/02/2021 08:47, Jenny Hopkins wrote:
Hello,
I might need to join the spamassassin mailing list for this Q, but just in case anyone here can help first:
I've got a mail set-up where exim4 hands mail to spamassassin before delivering to mailboxes local on the server. Users put any missed spam into missed-spam folders, and misfiled ham into missed-ham folders, and a cron job runs regularly to allow sa-learn to run learning from these folders.
The problem is - it says it is learning, but it isn't. It is letting through handfuls of the same spam over and over. It's as if SA is running without paying any attention to the bayes-db, which would be weird as that is what I thought was a core integral part of spamassassin. Am I missing something in the basic setup?
An example header of a missed spam shows something like:
X-Spam_report: Spam detection software, running on the system "example.co.uk", has NOT identified this incoming email as spam.
-then a few lines further down:
3.5 BAYES_99 BODY: Bayes spam probability is 99 to
100% [score: 1.0000] 0.2 BAYES_999 BODY: Bayes spam probability is 99.9 to 100% [score: 1.0000]
Any ideas? It's driving me nuts.
Hi!
Sometimes incoming mail has fake Spamassassin headers to try and fool you that it's not spam. I don't suppose that's the case in this case.
in /etc/spamassassin
has v320.pre got loadplugin Mail::SpamAssassin::Plugin::Bayes
has v310.pre got
# AutoLearnThreshold - threshold-based discriminator for Bayes auto-learning # loadplugin Mail::SpamAssassin::Plugin::AutoLearnThreshold
has local.cf got
use_bayes 1 bayes_auto_learn 1
if so then I guess it should work.
I got very excited when I saw a reply, but unfortunately the answer to all of the above is yes.
I seem to remember there's som sort of "gotcha" about global or per-user filtering. As the main user of email on this machine, I'm really the only one reporting spam & ham. Spamassassin runs as a daemon as root.
I report spam using something similar to
cd /home/USERACCOUNT/mail sudo sa-learn --mbox --spam SPAM_TRAINING_FOLDER
(replace mbox with other parameter if not using mbox format)
Because I've sudo-ed it, it goes to the root's training database.
Hmm - I have a feeling my sa-learn is running as the user of the mailbox. I'll check that out in the morning.
I hope that's of help. If not, good luck!
I'll let you know the outcome of changing sa-learn to running as sudo.
Many thanks, Steve!
Quick google If you want to run it as a per-user system, this post suggests how https://www.nesono.com/node/391
Whereas this starts from by bayes is not working https://stackoverflow.com/questions/42707466/spamassassin-bayes-not-working
It suggests checking the logs for errors, and points to, in the case discussed, spamassassin components are running with insufficient permissions. This is plausible. Log file checking is always a good place to start!
Good luck.
Steve