aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-11 08:57:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-11 08:57:33 +0100
commit473f029ed5b38d5fb62e733cdbd1d896af39a25d (patch)
treef5926518be4869e02376821f7db4e0b623e2e9bd
parent9c571fcf673e2cd2247b921769059c2399696234 (diff)
downloadrspamd-473f029ed5b38d5fb62e733cdbd1d896af39a25d.tar.gz
rspamd-473f029ed5b38d5fb62e733cdbd1d896af39a25d.zip
[Minor] External_services: Fix fail symbol registration
-rw-r--r--src/plugins/lua/external_services.lua26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/plugins/lua/external_services.lua b/src/plugins/lua/external_services.lua
index d65a46a2c..0a9f39ad9 100644
--- a/src/plugins/lua/external_services.lua
+++ b/src/plugins/lua/external_services.lua
@@ -136,14 +136,8 @@ local function add_scanner_rule(sym, opts)
rule.type = opts.type
- if not opts.symbol_fail then
- opts.symbol_fail = opts.symbol .. '_FAIL'
- end
- if not opts.symbol_encrypted then
- opts.symbol_encrypted = opts.symbol .. '_ENCRYPTED'
- end
- if not opts.symbol_macro then
- opts.symbol_macro = opts.symbol .. '_MACRO'
+ if not rule.symbol_fail then
+ rule.symbol_fail = rule.symbol .. '_FAIL'
end
rule.redis_params = redis_params
@@ -220,13 +214,15 @@ if opts and type(opts) == 'table' then
local id = rspamd_config:register_symbol(t)
- rspamd_config:register_symbol({
- type = 'virtual',
- name = m['symbol_fail'],
- parent = id,
- score = 0.0,
- group = N
- })
+ if m.symbol_fail then
+ rspamd_config:register_symbol({
+ type = 'virtual',
+ name = m['symbol_fail'],
+ parent = id,
+ score = 0.0,
+ group = N
+ })
+ end
if m.symbol_encrypted then
rspamd_config:register_symbol({