diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-01-07 15:57:16 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-01-07 15:57:16 +0000 |
commit | 2c5bbd96628f35ea01a4fc91e74cb3ca95f750ba (patch) | |
tree | 8b3efe0b5f90064869be850bc5983c0fa1b1add4 /src | |
parent | c143670bcacd9039a3d782de3a6b5beda53cc760 (diff) | |
download | rspamd-2c5bbd96628f35ea01a4fc91e74cb3ca95f750ba.tar.gz rspamd-2c5bbd96628f35ea01a4fc91e74cb3ca95f750ba.zip |
[Minor] Add more mime flags
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/hfilter.lua | 20 |
1 files changed, 15 insertions, 5 deletions
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' }) |