From: Vsevolod Stakhov Date: Thu, 15 Oct 2020 11:30:20 +0000 (+0100) Subject: [Minor] Spamtrap: Allow bayes learning from spamtrap module X-Git-Tag: 2.7~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0cc65e6df3e0b270d8771d0c56a4a26ec928320;p=thirdparty%2Frspamd.git [Minor] Spamtrap: Allow bayes learning from spamtrap module Issue: #3516 --- diff --git a/src/plugins/lua/spamtrap.lua b/src/plugins/lua/spamtrap.lua index 0b7a5bd9f0..0803d7d640 100644 --- a/src/plugins/lua/spamtrap.lua +++ b/src/plugins/lua/spamtrap.lua @@ -55,8 +55,11 @@ local function spamtrap_cb(task) settings['fuzzy_flag'], settings['fuzzy_weight']) end + local act_flags = '' if settings['learn_spam'] then task:set_flag("learn_spam") + -- Allow processing as we still need to learn and do other stuff + act_flags = 'process_all' end task:insert_result(settings['symbol'], 1, rcpt) @@ -72,7 +75,10 @@ local function spamtrap_cb(task) elseif settings.action == 'reject' then smtp_message = 'message rejected' end - task:set_pre_result(settings['action'], smtp_message, 'spamtrap') + task:set_pre_result{action = settings['action'], + message = smtp_message, + module = 'spamtrap', + flags = act_flags} end end end