]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix groups mess
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 29 Sep 2018 13:51:42 +0000 (14:51 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 29 Sep 2018 13:51:42 +0000 (14:51 +0100)
src/plugins/lua/antivirus.lua
src/plugins/lua/arc.lua
src/plugins/lua/dmarc.lua
src/plugins/lua/forged_recipients.lua
src/plugins/lua/hfilter.lua
src/plugins/lua/mid.lua
src/plugins/lua/mime_types.lua

index 5080a1c2a9fccff8d3069301661c87508a178766..91a6c0a9b1b614c1e994d505ef63404f1b9d105a 100644 (file)
@@ -926,12 +926,15 @@ if opts and type(opts) == 'table' then
           type = 'normal',
           name = m['symbol'],
           callback = cb,
+          score = 0.0,
+          group = 'antivirus'
         })
         rspamd_config:register_symbol({
           type = 'virtual',
           name = m['symbol_fail'],
           parent = id,
           score = 0.0,
+          group = 'antivirus'
         })
         has_valid = true
         if type(m['patterns']) == 'table' then
@@ -977,7 +980,7 @@ if opts and type(opts) == 'table' then
             name = m['symbol'],
             score = m['score'],
             description = description,
-            group = group
+            group = group or 'antivirus'
           })
         end
       end
index bf6010c3fd624b191de945e9bc6b7be3314d4f30..eeae65289565966580432eef545a5914d403e06b 100644 (file)
@@ -343,6 +343,8 @@ end
 local id = rspamd_config:register_symbol({
   name = 'ARC_CALLBACK',
   type = 'callback',
+  group = 'policies',
+  groups = {'arc'},
   callback = arc_callback
 })
 
@@ -353,6 +355,7 @@ rspamd_config:register_symbol({
   type = 'virtual',
   score = -1.0,
   group = 'policies',
+  groups = {'arc'},
 })
 rspamd_config:register_symbol({
   name = arc_symbols['reject'],
@@ -360,6 +363,7 @@ rspamd_config:register_symbol({
   type = 'virtual',
   score = 2.0,
   group = 'policies',
+  groups = {'arc'},
 })
 rspamd_config:register_symbol({
   name = arc_symbols['invalid'],
@@ -367,6 +371,7 @@ rspamd_config:register_symbol({
   type = 'virtual',
   score = 1.0,
   group = 'policies',
+  groups = {'arc'},
 })
 rspamd_config:register_symbol({
   name = arc_symbols['dnsfail'],
@@ -374,6 +379,7 @@ rspamd_config:register_symbol({
   type = 'virtual',
   score = 0.0,
   group = 'policies',
+  groups = {'arc'},
 })
 rspamd_config:register_symbol({
   name = arc_symbols['na'],
@@ -381,6 +387,7 @@ rspamd_config:register_symbol({
   type = 'virtual',
   score = 0.0,
   group = 'policies',
+  groups = {'arc'},
 })
 
 rspamd_config:register_dependency('ARC_CALLBACK', symbols['spf_allow_symbol'])
index c08b1dfa9a8d398d50a0629fdfc2222a7c8e3b29..38f54f1f8616c322b6cfaac260d1494194f0f0a6 100644 (file)
@@ -1266,37 +1266,51 @@ end
 local id = rspamd_config:register_symbol({
   name = 'DMARC_CALLBACK',
   type = 'callback',
+  group = 'policies',
+  groups = {'dmarc'},
   callback = dmarc_callback
 })
 rspamd_config:register_symbol({
   name = dmarc_symbols['allow'],
   flags = 'nice',
   parent = id,
+  group = 'policies',
+  groups = {'dmarc'},
   type = 'virtual'
 })
 rspamd_config:register_symbol({
   name = dmarc_symbols['reject'],
   parent = id,
+  group = 'policies',
+  groups = {'dmarc'},
   type = 'virtual'
 })
 rspamd_config:register_symbol({
   name = dmarc_symbols['quarantine'],
   parent = id,
+  group = 'policies',
+  groups = {'dmarc'},
   type = 'virtual'
 })
 rspamd_config:register_symbol({
   name = dmarc_symbols['softfail'],
   parent = id,
+  group = 'policies',
+  groups = {'dmarc'},
   type = 'virtual'
 })
 rspamd_config:register_symbol({
   name = dmarc_symbols['dnsfail'],
   parent = id,
+  group = 'policies',
+  groups = {'dmarc'},
   type = 'virtual'
 })
 rspamd_config:register_symbol({
   name = dmarc_symbols['na'],
   parent = id,
+  group = 'policies',
+  groups = {'dmarc'},
   type = 'virtual'
 })
 
index 25d6c8f8cb80194867e5398c1c743e9e9873cd1a..887b1bf822032597b73792abb0353d737cf37aab 100644 (file)
@@ -97,6 +97,8 @@ if opts then
       name = 'FORGED_CALLBACK',
       callback = check_forged_headers,
       type = 'callback',
+      group = 'headers',
+      score = 0.0,
     })
     if opts['symbol_rcpt'] then
       symbol_rcpt = opts['symbol_rcpt']
index 70992b8f3542734f0ee54969e4f75d27613c59c4..b63483f41fb58c7ee20abff89ce8af9f3fd9b185 100644 (file)
@@ -618,6 +618,19 @@ end
 --dumper(symbols_enabled)
 if #symbols_enabled > 0 then
   rspamd_config:register_symbols(hfilter, 1.0, "HFILTER", symbols_enabled);
+  rspamd_config:set_metric_symbol({
+    name = 'HFILTER',
+    score = 0.0,
+    group = 'hfilter'
+  })
+
+  for _,s in ipairs(symbols_enabled) do
+    rspamd_config:set_metric_symbol({
+      name = s,
+      score = 0.0,
+      group = 'hfilter'
+    })
+  end
 else
   lua_util.disable_module(N, "config")
 end
index 4baa8867cc9f3ba59e2efc6c5ccd763b218613e4..5410e7f9f189910beddbd0bfadbc8a100c78e031 100644 (file)
@@ -79,16 +79,19 @@ if opts then
     local id = rspamd_config:register_symbol({
       name = 'KNOWN_MID_CALLBACK',
       type = 'callback',
+      group = 'mid',
       callback = known_mid_cb
     })
     rspamd_config:register_symbol({
       name = settings['symbol_known_mid'],
       parent = id,
+      group = 'mid',
       type = 'virtual'
     })
     rspamd_config:register_symbol({
       name = settings['symbol_known_no_mid'],
       parent = id,
+      group = 'mid',
       type = 'virtual'
     })
     rspamd_config:add_composite(settings['csymbol_invalid_msgid_allowed'],
index f97f22d2a649020ed8b6bdee4048899276591d0a..7e383724b27d8f6effb760ac2fade63f13d703d2 100644 (file)
@@ -1018,49 +1018,58 @@ if opts then
     local id = rspamd_config:register_symbol({
       name = 'MIME_TYPES_CALLBACK',
       callback = check_mime_type,
-      type = 'callback,nostat'
+      type = 'callback,nostat',
+      group = 'mime_types',
     })
 
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_unknown'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_bad'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_good'],
       flags = 'nice',
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_attachment'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_encrypted_archive'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_archive_in_archive'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_double_extension'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
     rspamd_config:register_symbol({
       type = 'virtual',
       name = settings['symbol_bad_extension'],
-      parent = id
+      parent = id,
+      group = 'mime_types',
     })
   else
     lua_util.disable_module(N, "config")