]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Rbl: Allow to add dependencies for RBL rules
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Nov 2020 11:22:06 +0000 (11:22 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Nov 2020 11:30:00 +0000 (11:30 +0000)
lualib/plugins/rbl.lua
src/plugins/lua/rbl.lua

index 4eeff7b09d533c50dd50f184e39a6c8e08411fc6..62f9ce9d8e1d47cdef8a8ec952742b97f94f1d7d 100644 (file)
@@ -113,6 +113,9 @@ local rule_schema_tbl = {
   received = ts.boolean:is_optional(),
   replyto = ts.boolean:is_optional(),
   requests_limit = (ts.integer + ts.string / tonumber):is_optional(),
+  require_symbols = (
+      ts.array_of(ts.string) + (ts.string / function(s) return {s} end)
+  ):is_optional(),
   resolve_ip = ts.boolean:is_optional(),
   return_bits = return_bits_schema:is_optional(),
   return_codes = return_codes_schema:is_optional(),
index 534a4855bda0dd18ea50bdfba9684023b614197b..dabf259e2d6825f0bd148f5b2873431a43fe322d 100644 (file)
@@ -1025,6 +1025,12 @@ local function add_rbl(key, rbl, global_opts)
       rspamd_config:register_dependency(rbl.symbol, 'DKIM_CHECK')
     end
 
+    if rbl.require_symbols then
+      for _,dep in ipairs(rbl.require_symbols) do
+        rspamd_config:register_dependency(rbl.symbol, dep)
+      end
+    end
+
     -- Failure symbol
     rspamd_config:register_symbol{
       type = 'virtual',