]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] External_services: Fix symbol fail assignment
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Aug 2019 17:34:47 +0000 (18:34 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Aug 2019 17:34:47 +0000 (18:34 +0100)
src/plugins/lua/external_services.lua

index 9aba7f8a62b839d2952a3a5ee87cf307f36fa510..7b20e629c3038cc36ef93e897324bfb7b8db9200 100644 (file)
@@ -126,14 +126,7 @@ local function add_scanner_rule(sym, opts)
     return nil
   end
 
-  if not opts.symbol_fail then
-    opts.symbol_fail = opts.symbol .. '_FAIL'
-  end
-
   local rule = cfg.configure(opts)
-  rule.type = opts.type
-  rule.symbol_fail = opts.symbol_fail
-  rule.redis_params = redis_params
 
   if not rule then
     rspamd_logger.errx(rspamd_config, 'cannot configure %s for %s',
@@ -141,6 +134,14 @@ local function add_scanner_rule(sym, opts)
     return nil
   end
 
+  rule.type = opts.type
+
+  if not rule.symbol_fail then
+    rule.symbol_fail = opts.symbol .. '_FAIL'
+  end
+
+  rule.redis_params = redis_params
+
   -- if any mime_part filter defined, do not scan all attachments
   if opts.mime_parts_filter_regex ~= nil
     or opts.mime_parts_filter_ext ~= nil then