bayes ham/spam is not working

mejay

Verified User
Joined
Mar 1, 2020
Messages
28
When I receive spam (or not), it doesn't seem to ever use bayes to determin ham/spam. It is only using the other non-bayes rules.

In the log, I have this:
"The ham class needs more training samples. Currently: 0; minimum 200 required"

I've been using rspamd for awhile. What exactly do I need to do to make bayes work with rspamd in directadmin? Do the emails that it determines are spam and not spam, are they not used as training samples?

Is there some directadmin rspam documentation that I am overlooking to make this work?
 
I already have those files, but the "sa-learn.sh" triggers the file "/usr/bin/sa-learn" which does not exist in rspamd, only with spamassassin. So, that document does not work for rspamd.
 
I came across the following project:

Github: https://github.com/filipnet/rspamd-learn-helper

+++!!! It didn't work! I'll leave the link in the post - maybe it'll be helpful to someone else. !!! +++


It makes sense to make the training a little more elegant.
Currently, I only have one folder, and that is spam. Unfortunately, important emails have also been classified as spam. AND, of course, I have entered this as HAM. Unfortunately, this does not seem to work properly, or the learning process is a little slow...

This Project may help to make learning and permanent sharpening more targeted.
 
Last edited:
An alternative project can be found here:

Excellent! Thank you so much—your software works right away and really makes filtering easier for me!

Unfortunately, the software solution I mentioned earlier didn't do what it was supposed to. I will address this in the appropriate
 
Hello guys, I am also on this topic, following the original doc from Directadmin websiteand trying to do it for rspamd. Still can not manage to make it work. My sa-learn.sh look like this:
Code:
#!/bin/bash
{
    echo "$(date) Attempting to learn $1"
    cmd="learn_spam"
    [ "$1" = "ham" ] && cmd="learn_ham"
    echo "User $(id) attempting ${cmd}"
    exec /usr/bin/rspamc -h /var/run/rspamd/rspamd_controller.sock "$cmd"
} >> /tmp/imap-sieve.log

controller config:
Code:
cat /etc/rspamd/local.d/worker-controller.inc
#bind_socket = "/var/run/rspamd/rspamd_controller.sock mode=0600 owner=_rspamd";
bind_socket = "/var/run/rspamd/rspamd_controller.sock owner=_rspamd group=mail mode=0660";

also tried with group=dovecot, but still it have a permissions problem:
Code:
---
Wed Jul  1 14:22:10 CEST 2026 Attempting to learn spam
User uid=1004(pst11223) gid=12(mail) groups=12(mail),986(dovecot) attempting learn_spam

pst11223 is my DA account under which I did the test.
Any ideas.
 
Not able to edit my previous post. I get it to work by adding _rspamd user to dovecot group and setting that group in worker settings.
 
Back
Top