]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Multimap: Fix flags usage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 22 Oct 2020 12:12:33 +0000 (13:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 22 Oct 2020 12:12:33 +0000 (13:12 +0100)
Issue: #3526

src/plugins/lua/multimap.lua

index c253c660eb577021faff80fac4ad29fba824551e..109f974cd5f6ce324eb2c59a55e676b9fea357c0 100644 (file)
@@ -1276,11 +1276,21 @@ if opts and type(opts) == 'table' then
       rule.description = rule.description or 'multimap symbol'
       rule.group = rule.group or N
 
+      local tmp_flags
+      tmp_flags = rule.flags
+
+      if rule.type == 'received' and rule.flags then
+        -- XXX: hack to allow received flags/nflags
+        -- See issue #3526 on GH
+        rule.flags = nil
+      end
+
       -- XXX: for combined maps we use trace, so flags must include one_shot to avoid scores multiplication
       if rule.combined and not rule.flags then
         rule.flags = 'one_shot'
       end
       rspamd_config:set_metric_symbol(rule)
+      rule.flags = tmp_flags
     end
   end, fun.filter(function(r) return not r['prefilter'] end, rules))