]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Rbl: Fix require symbols option
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 19 Jan 2022 21:01:10 +0000 (21:01 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 19 Jan 2022 21:06:09 +0000 (21:06 +0000)
src/plugins/lua/rbl.lua

index 49b67221f044a9648f1e9fb21dd0e67179fb2ede..8c362add28f7369b92f0464390d699a3680e0461 100644 (file)
@@ -423,6 +423,12 @@ local function gen_rbl_callback(rule)
     return true
   end
 
+  local function check_required_symbols(task, _)
+    if rule.require_symbols then
+      return fun.all(function(sym) task:has_symbol(sym) end, rule.require_symbols)
+    end
+  end
+
   local function check_user(task, _)
     if task:get_user() then
       return false
@@ -741,7 +747,8 @@ local function gen_rbl_callback(rule)
 
   -- Create function pipeline depending on rbl settings
   local pipeline = {
-    is_alive, -- generic for all
+    is_alive, -- check monitored status
+    check_required_symbols -- if we have require_symbols then check those symbols
   }
   local description = {
     'alive',