From: Vsevolod Stakhov Date: Fri, 30 Aug 2024 10:07:51 +0000 (+0100) Subject: [Minor] Change log level for autolearning X-Git-Tag: 3.10.0~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0eeb1f75e441ea8bd34d1ac6fda23727b1a908a5;p=thirdparty%2Frspamd.git [Minor] Change log level for autolearning Fix unidiomatic string builder when I'm here. --- diff --git a/lualib/lua_bayes_learn.lua b/lualib/lua_bayes_learn.lua index ea97db6f81..82f044d7db 100644 --- a/lualib/lua_bayes_learn.lua +++ b/lualib/lua_bayes_learn.lua @@ -18,6 +18,7 @@ limitations under the License. local lua_util = require "lua_util" local lua_verdict = require "lua_verdict" +local logger = require "rspamd_logger" local N = "lua_bayes" local exports = {} @@ -56,16 +57,16 @@ exports.autolearn = function(task, conf) local mime_rcpts = 'undef' local mr = task:get_recipients('mime') if mr then + local r_addrs = {} for _, r in ipairs(mr) do - if mime_rcpts == 'undef' then - mime_rcpts = r.addr - else - mime_rcpts = mime_rcpts .. ',' .. r.addr - end + r_addrs[#r_addrs + 1] = r.addr + end + if #r_addrs > 0 then + mime_rcpts = table.concat(r_addrs, ',') end end - lua_util.debugm(N, task, 'id: %s, from: <%s>: can autolearn %s: score %s %s %s, mime_rcpts: <%s>', + logger.info(task, 'id: %s, from: <%s>: can autolearn %s: score %s %s %s, mime_rcpts: <%s>', task:get_header('Message-Id') or '', from and from[1].addr or 'undef', verdict,