]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Rbl: Moar fixes to the registration logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2019 11:22:18 +0000 (12:22 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Sep 2019 11:22:18 +0000 (12:22 +0100)
conf/modules.d/rbl.conf
src/plugins/lua/rbl.lua

index 96d4425253fc4b1bbaf7f93b68b6a4769cc01127..caaee4b970ca2335fd6d008401167cf9c473c4fb 100644 (file)
@@ -28,7 +28,7 @@ rbl {
   rbls {
 
     spamhaus {
-      symbol = "RBL_SPAMHAUS";
+      symbol = "SPAMHAUS"; # Augmented by prefixes
       rbl = "zen.spamhaus.org";
       ipv6 = true;
       received = true;
index 5c007b6c3dec1e625b0ecf33f01aba197ff2c93d..cf474f69c5e6ab5bd4382a084cd7b788498b8b8b 100644 (file)
@@ -867,24 +867,24 @@ local function add_rbl(key, rbl, global_opts)
     local id
 
     if rbl.symbols_prefixes then
-      if not rbl.symbol:match('_CHECK$') then
-        rbl.symbol = rbl.symbol .. '_CHECK'
-      end
-
       id = rspamd_config:register_symbol{
         type = 'callback',
         callback = callback,
-        name = rbl.symbol,
+        name = rbl.symbol .. '_CHECK',
         flags = table.concat(flags_tbl, ',')
       }
 
       for _,prefix in pairs(rbl.symbols_prefixes) do
+        -- For unknown results...
         rspamd_config:register_symbol{
           type = 'virtual',
           parent = id,
           name = prefix .. '_' .. rbl.symbol,
         }
       end
+      if not rbl.is_whitelist and rbl.ignore_whitelist == false then
+        table.insert(black_symbols, rbl.symbol .. '_CHECK')
+      end
     else
       id = rspamd_config:register_symbol{
         type = 'callback',
@@ -892,6 +892,9 @@ local function add_rbl(key, rbl, global_opts)
         name = rbl.symbol,
         flags = table.concat(flags_tbl, ',')
       }
+      if not rbl.is_whitelist and rbl.ignore_whitelist == false then
+        table.insert(black_symbols, rbl.symbol)
+      end
     end
 
 
@@ -967,9 +970,6 @@ local function add_rbl(key, rbl, global_opts)
       end
     end
 
-    if not rbl.is_whitelist and rbl.ignore_whitelist == false then
-      table.insert(black_symbols, rbl.symbol)
-    end
     -- Process monitored
     if not rbl.disable_monitoring then
       if not monitored_addresses[rbl.rbl] then