diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-03-28 13:17:56 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-03-28 13:17:56 +0200 |
commit | a59b46070c98124f185307b983c775b67c8f54fd (patch) | |
tree | e6f5cb1851019599385025108aea17f4a5bd6d92 /src/plugins | |
parent | c1904b4f751ae59d9a48fab651f4a0e6a232375e (diff) | |
download | rspamd-a59b46070c98124f185307b983c775b67c8f54fd.tar.gz rspamd-a59b46070c98124f185307b983c775b67c8f54fd.zip |
[Fix] Force actions: Use postfilter if we have honor_action / require_action
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/force_actions.lua | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/plugins/lua/force_actions.lua b/src/plugins/lua/force_actions.lua index 4a0e61ab9..0b5528d97 100644 --- a/src/plugins/lua/force_actions.lua +++ b/src/plugins/lua/force_actions.lua @@ -146,16 +146,24 @@ local function configure_module() local honor = list_to_hash(sett.honor_action) local cb, atoms = gen_cb(expr, action, rspamd_config:get_mempool(), message, subject, raction, honor) if cb and atoms then - local sname = 'FORCE_ACTION_' .. name - local id = rspamd_config:register_symbol({ - type = 'normal', - name = sname, - callback = cb, - }) - for _, a in ipairs(atoms) do - rspamd_config:register_dependency(id, a) + local t = {} + if (raction or honor) then + t.type = 'postfilter' + t.priority = 10 + else + t.type = 'normal' + end + t.name = 'FORCE_ACTION_' .. name + t.callback = cb + local id = rspamd_config:register_symbol(t) + if t.type == 'normal' then + for _, a in ipairs(atoms) do + rspamd_config:register_dependency(id, a) + end + rspamd_logger.infox(rspamd_config, 'Registered symbol %1 <%2> with dependencies [%3]', name, expr, table.concat(atoms, ',')) + else + rspamd_logger.infox(rspamd_config, 'Registered symbol %1 <%2> as postfilter', name, expr) end - rspamd_logger.infox(rspamd_config, 'Registered symbol %1 <%2> with dependencies [%3]', name, expr, table.concat(atoms, ',')) end end end |