From 5c631c922ae329bdca994d0a2967eee80d830cd3 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 7 Jul 2017 10:25:38 +0200 Subject: [PATCH] [Minor] RBL: don't register duplicate monitoring --- src/plugins/lua/rbl.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index f5d8d1bf8..a6b54539e 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -456,6 +456,7 @@ local id = rspamd_config:register_symbol({ flags = 'empty,nice' }) +local is_monitored = {} for key,rbl in pairs(opts['rbls']) do (function() if rbl['disabled'] then return end @@ -545,7 +546,8 @@ for key,rbl in pairs(opts['rbls']) do end end if rbl['rbl'] then - if not rbl['disable_monitoring'] and not rbl['is_whitelist'] then + if not rbl['disable_monitoring'] and not rbl['is_whitelist'] and not is_monitored[rbl['rbl']] then + is_monitored[rbl['rbl']] = true rbl.monitored = rspamd_config:register_monitored(rbl['rbl'], 'dns', { rcode = 'nxdomain', -- 2.39.5