From: Vsevolod Stakhov Date: Sat, 14 Sep 2024 13:41:36 +0000 (+0100) Subject: [Minor] Do not autolearn messages without queue id X-Git-Tag: 3.10.0~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=986814257147e9e79df032f5f157d90c0ee430e4;p=rspamd.git [Minor] Do not autolearn messages without queue id Suggested by: @moisseev --- diff --git a/lualib/lua_bayes_learn.lua b/lualib/lua_bayes_learn.lua index 82f044d7d..89470edba 100644 --- a/lualib/lua_bayes_learn.lua +++ b/lualib/lua_bayes_learn.lua @@ -76,6 +76,13 @@ exports.autolearn = function(task, conf) mime_rcpts) end + if not task:get_queue_id() then + -- We should skip messages that come from `rspamc` or webui as they are usually + -- not intended for autolearn at all + lua_util.debugm(N, task, 'no need to autolearn - queue id is missing') + 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