rspamd ham/spam learning enabled in ispconfig?

Discussion in 'Installation/Configuration' started by harkman, Nov 9, 2022.

  1. harkman

    harkman Member

    Is there any configuration in Ispconfig in place that does SPAM/HAM learning based on the user moving mails from Inbox to /Junk or vice versa?
    Can I configure a Dovecot Plugin like described here:
    or will this have negative impact on the whole setup?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No. Rspamd and Amavis just learn emails automatically based on spam scores.

    That should be fine. But be always aware that users tend to sort out emails wrong which might cause your spam filter to get worse. many users put emails in the spam folder that they do not want, but which are not spam.
  3. pyte

    pyte Well-Known Member HowtoForge Supporter

    As till already said you really shouldn't let users decide what spam is. rspamd has a module called bayes classifier that auto learns what spam, ham and junk is. It is way more useful to tweak your overall rspamd config to better detect spam and train it with the bayes classifier module.
    The module configuration is under /etc/rspamd/local.d/classifier-bayes.conf and is in ISPConfig default configured like this:
    backend = "redis";
    servers = "";
    autolearn {
      spam_threshold = 6.0; # When to learn spam (score >= threshold and action is reject)
      junk_threshold = 4.0; # When to learn spam (score >= threshold and action is rewrite subject or add header, and has two or more positive results)
      ham_threshold = -0.5; # When to learn ham (score <= threshold and action is no action, and score is negative or has three or more negative results)
      check_balance = true; # Check spam and ham balance
      min_balance = 0.9; # Keep diff for spam/ham learns for at least this value
    per_user = false;
    per_language = true;
    You can train rspamd with spam mails manually with this:
    rspamc learn_spam /var/vmail/domain.tld/user/Maildir/.INBOX.Junk/cur
    till likes this.
  4. pvanthony

    pvanthony Active Member HowtoForge Supporter

Share This Page