aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-23 19:36:48 +0100
committerGitHub <noreply@github.com>2021-10-23 19:36:48 +0100
commit08b715640c6627133965f96c55112548b19a9aa5 (patch)
treee9fd21fc92a2f282001eef893943c7773173c106 /lualib
parent4bb39dc34035b847b072e0235fabd7004c6b7a7b (diff)
parent14530e6a7c37eecc7c2441000006b423368b171f (diff)
downloadrspamd-08b715640c6627133965f96c55112548b19a9aa5.tar.gz
rspamd-08b715640c6627133965f96c55112548b19a9aa5.zip
Merge pull request #3936 from dminuoso/add-junk-threshold
[Feature] Add junk_threshold for autolearn
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_bayes_learn.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/lualib/lua_bayes_learn.lua b/lualib/lua_bayes_learn.lua
index ae8d901f8..a059c6374 100644
--- a/lualib/lua_bayes_learn.lua
+++ b/lualib/lua_bayes_learn.lua
@@ -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)