aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorTarmo Oja <tarmo.oja@cyber.ee>2024-09-04 11:34:52 +0300
committerTarmo Oja <tarmo.oja@cyber.ee>2024-09-04 11:34:52 +0300
commit4b1eab46c1f6466262637d44872a8e9053bb686d (patch)
treeaac599921b5782f23b9b06d6a5feaa424504c278 /lualib
parentb37440609e71c21b7b3f225dcaf021b53c7d078c (diff)
parented6aa0eeb6b9b5b526efa683a29a1ccec59ae609 (diff)
downloadrspamd-4b1eab46c1f6466262637d44872a8e9053bb686d.tar.gz
rspamd-4b1eab46c1f6466262637d44872a8e9053bb686d.zip
Merge branch 'master' into fix-icap-url-encode
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_bayes_learn.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/lualib/lua_bayes_learn.lua b/lualib/lua_bayes_learn.lua
index ea97db6f8..82f044d7d 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 '<undef>',
from and from[1].addr or 'undef',
verdict,