local rspamd_expression = require "rspamd_expression"
local rspamd_logger = require "rspamd_logger"
-local function gen_cb(expr, act, pool, message, subject, raction, honor, limit)
+local function gen_cb(expr, act, pool, message, subject, raction, honor, limit, least)
local function parse_atom(str)
local atom = table.concat(fun.totable(fun.take_while(function(c)
if subject then
task:set_metric_subject(subject)
end
+
+ local flags = ""
+ if least then flags = "least" end
+
if type(message) == 'string' then
- task:set_pre_result(act, message, N)
+ task:set_pre_result(act, message, N, nil, nil, flags)
else
- task:set_pre_result(act, nil, N)
+ task:set_pre_result(act, nil, N, nil, nil, flags)
end
return true, act
end
local subject = sett.subject
local message = sett.message
local lim = sett.limit or 0
+ local least = sett.least or false
local raction = lua_util.list_to_hash(sett.require_action)
local honor = lua_util.list_to_hash(sett.honor_action)
local cb, atoms = gen_cb(expr, action, rspamd_config:get_mempool(),
- message, subject, raction, honor, lim)
+ message, subject, raction, honor, lim, least)
if cb and atoms then
local t = {}
if (raction or honor) then