diff options
-rw-r--r-- | src/plugins/lua/external_services.lua | 26 |
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({ |