]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Spamtrap: Allow bayes learning from spamtrap module
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2020 11:30:20 +0000 (12:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2020 11:50:20 +0000 (12:50 +0100)
Issue: #3516

src/plugins/lua/spamtrap.lua

index 0b7a5bd9f0382c89f50d5849574c5a256fafd055..0803d7d640d08d7b9ead13f87cccdd0d6f2bfd33 100644 (file)
@@ -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