]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Provide some upgrade path
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Oct 2020 13:43:03 +0000 (14:43 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Oct 2020 13:43:03 +0000 (14:43 +0100)
lualib/plugins/rbl.lua

index 12c795e00962fc103860163aa61e3576a5f8bc99..7105d73a4b4c076ac12852fe30b4d38165ff41fa 100644 (file)
@@ -158,6 +158,22 @@ local function convert_checks(rule)
     rule.connfilter = all_connfilter
   end
 
+  -- Now check if we have any check enabled at all
+  local check_found = false
+  for k,_ in pairs(check_types) do
+    if type(rule[k]) ~= 'nil' then
+      check_found = true
+      break
+    end
+  end
+
+  if not check_found then
+    -- Enable implicit `from` check to allow upgrade
+    rspamd_logger.warnx(rspamd_config, 'rbl rule %s has no check enabled, enable default `from` check',
+        rule.symbol)
+    rule.from = true
+  end
+
   return rule
 end