]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Add junk_threshold for autolearn 3936/head
authorVictor Nawothnig <dminuoso+git@icloud.com>
Fri, 15 Oct 2021 00:06:16 +0000 (02:06 +0200)
committerVictor Nawothnig <dminuoso+git@icloud.com>
Fri, 15 Oct 2021 00:10:06 +0000 (02:10 +0200)
conf/statistic.conf
lualib/lua_bayes_learn.lua

index 60b6dcb3e1019f96bf94d85a788857aaa6897454..5fea48320921e77601e73c8cf97b7bcd9a5ee268 100644 (file)
@@ -44,8 +44,9 @@ classifier "bayes" {
 
   # Autolearn sample
   # autolearn {
-  #  spam_threshold = 6.0; # When to learn spam (score >= threshold)
-  #  ham_threshold = -0.5; # When to learn ham (score <= threshold)
+  #  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
   #}
index ae8d901f8b6139e1385280fc71ec97a4b32dbb6f..a059c63741c51400389471ebf0ff8019e68193af 100644 (file)
@@ -92,6 +92,11 @@ exports.autolearn = function(task, conf)
         log_can_autolearn(verdict, score, conf.spam_threshold)
         learn_spam = true
       end
+    elseif verdict == 'junk' then
+      if conf.junk_threshold and score >= conf.junk_threshold then
+        log_can_autolearn(verdict, score, conf.junk_threshold)
+        learn_spam = true
+      end
     elseif verdict == 'ham' then
       if conf.ham_threshold and score <= conf.ham_threshold then
         log_can_autolearn(verdict, score, conf.ham_threshold)