From: Andrew Lewis Date: Mon, 13 Oct 2025 14:58:53 +0000 (+0200) Subject: [Feature] Allow skipping local/auth'd mail in default bayes autolearn condition X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5679%2Fhead;p=thirdparty%2Frspamd.git [Feature] Allow skipping local/auth'd mail in default bayes autolearn condition --- diff --git a/lualib/lua_bayes_learn.lua b/lualib/lua_bayes_learn.lua index 89470edba9..708072827f 100644 --- a/lualib/lua_bayes_learn.lua +++ b/lualib/lua_bayes_learn.lua @@ -83,6 +83,22 @@ exports.autolearn = function(task, conf) return end + -- To retain old behaviour, we check local and authed mail by default + local check_local = conf.check_local + if check_local == nil then + check_local = true + end + local check_authed = conf.check_authed + if check_authed == nil then + check_authed = true + end + + local skip_conf = {check_local, check_authed} + if lua_util.is_skip_local_or_authed(task, skip_conf) then + lua_util.debugm(N, task, 'skip autolearn for local or authed network') + return + end + -- We have autolearn config so let's figure out what is requested local verdict, score = lua_verdict.get_specific_verdict("bayes", task) local learn_spam, learn_ham = false, false