]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Add ability to enable/disable symbols via dynamic_conf
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 24 Oct 2016 07:11:58 +0000 (08:11 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 24 Oct 2016 07:11:58 +0000 (08:11 +0100)
src/plugins/lua/dynamic_conf.lua

index e8c6c63f9b1526b7927333d7b9775f713abb9eff..201e323637a8449ef3310b580c46c13d0b0e14ba 100644 (file)
@@ -138,6 +138,18 @@ local function apply_dynamic_conf(cfg, data)
   if data['actions'] then
     apply_dynamic_actions(cfg, data['actions'])
   end
+
+  if data['symbols_enabled'] then
+    each(function(i, v)
+      cfg:enable_symbol(v)
+    end, data['symbols_enabled'])
+  end
+
+  if data['symbols_disabled'] then
+    each(function(i, v)
+      cfg:disable_symbol(v)
+    end, data['symbols_disabled'])
+  end
 end
 
 local function check_dynamic_conf(cfg, ev_base)