rspamd bayes classifiers per user and global

Discussion in 'Server Operation' started by MTC11, Mar 24, 2022.

  1. MTC11

    MTC11 New Member

    I' running email server with rspamd as spam filter. I have 2 bayes classifiers, one with original config named global and second with per_user = true named per_user. The per_user classifier has same config as global with only difference - symbols are renamed to BAYES_HAM_USER and BAYES_SPAM_USER. So now when user received email, in header there are added 2 symbols from both classifiers (for example BAYES_HAM from global classifier and BAYES_HAM_USER from per_user classifier).

    I need to use symbols from only one classifier per email, global or per_user classifier and this choice is up to each user (per_user classifier for few users and global classifier for others). How can I do that? How to prevent of using one classifier or its symbols?

    I have one idea, but it seems overkill for me. My idea is to create webpage where user log in and choose one of two choices (per user or global). Then its choice will save in database on the server. After that script will start and this script will modify etc/rspamd/settings.conf where it will create new setting for each user. This setting will disable symbols for the other classifier (so if user has chosen per_user classifier then BAYES_HAM and BAYES_SPAM symbols will be disabled). At the end, script will restart rspamd. This should be work, but its very complicated. I will be happy for any ideas.
     
    Last edited: Mar 24, 2022
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Your idea is the first (really only) thing that comes to mind, to disable the symbols you don't want used. I suspect that doesn't exactly do what you asked for (ie. my guess is that both classifiers would still run, not have one truly disabled), but should give the same results.
     
  3. MTC11

    MTC11 New Member

    You are right, in this case both classifiers would still run. More important for me is to prevent used symbols from both classifiers for single email. If both classifiers run in the background or just one of them is not so important. Sorry I didnt express myself correctly, I corrected my question.
     

Share This Page