From 2c5bbd96628f35ea01a4fc91e74cb3ca95f750ba Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 7 Jan 2019 15:57:16 +0000 Subject: [Minor] Add more mime flags --- src/plugins/lua/hfilter.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/lua/hfilter.lua b/src/plugins/lua/hfilter.lua index 334378ba4..4427234a3 100644 --- a/src/plugins/lua/hfilter.lua +++ b/src/plugins/lua/hfilter.lua @@ -323,7 +323,7 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host) end -- -local function hfilter(task) +local function hfilter_callback(task) -- Links checks if config['url_enabled'] then local parts = task:get_text_parts() @@ -626,16 +626,26 @@ end --dumper(symbols_enabled) if #symbols_enabled > 0 then - rspamd_config:register_symbols(hfilter, 1.0, "HFILTER", symbols_enabled); + local id = rspamd_config:register_symbol{ + name = 'HFILTER', + callback = hfilter_callback, + type = 'callback,mime', + score = 0.0, + } rspamd_config:set_metric_symbol({ name = 'HFILTER', score = 0.0, group = 'hfilter' }) - - for _,s in ipairs(symbols_enabled) do + for _,sym in ipairs(symbols_enabled) do + rspamd_config:register_symbol{ + type = 'virtual,mime', + score = 1.0, + parent = id, + name = sym, + } rspamd_config:set_metric_symbol({ - name = s, + name = sym, score = 0.0, group = 'hfilter' }) -- cgit v1.2.3