]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] External_services: Fix fail symbol registration
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Oct 2019 07:57:33 +0000 (08:57 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 11 Oct 2019 07:57:33 +0000 (08:57 +0100)
src/plugins/lua/external_services.lua

index d65a46a2c64bdd648905bf1a97bcaa0a23506e9b..0a9f39ad9efaa4b64bc7605ce9ea76e76180394c 100644 (file)
@@ -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({