]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Pass all multimap config fields to the `set_metric_symbol` method
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Aug 2018 18:49:08 +0000 (19:49 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 Aug 2018 18:49:08 +0000 (19:49 +0100)
src/plugins/lua/multimap.lua

index 303f97d0ee4b592505ac75a2ac763e7533e7ca2f..742f966668dda2bb616b0d9ebbe893edfde4cf24 100644 (file)
@@ -1124,20 +1124,11 @@ if opts and type(opts) == 'table' then
     end
     if rule['score'] then
       -- Register metric symbol
-      local description = 'multimap symbol'
-      local group = N
-      if rule['description'] then
-        description = rule['description']
-      end
-      if rule['group'] then
-        group = rule['group']
-      end
-      rspamd_config:set_metric_symbol({
-          name = rule['symbol'],
-          score = rule['score'],
-          description = description,
-          group = group
-      })
+      rule.name = rule.symbol
+      rule.description = rule.description or 'multimap symbol'
+      rule.group = rule.group or N
+
+      rspamd_config:set_metric_symbol(rule)
     end
   end,
   fun.filter(function(r) return not r['prefilter'] end, rules))