Skip to content

Commit

Permalink
[Minor] Spamtrap: Allow bayes learning from spamtrap module
Browse files Browse the repository at this point in the history
Issue: #3516
  • Loading branch information
vstakhov committed Oct 15, 2020
1 parent b640dd7 commit e0cc65e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/plugins/lua/spamtrap.lua
Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit e0cc65e

Please sign in to comment.