diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-07-07 10:25:38 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-07-07 10:25:38 +0200 |
commit | 5c631c922ae329bdca994d0a2967eee80d830cd3 (patch) | |
tree | d4be208eb228185381f9b3b2ef7d5231c5f3cf32 | |
parent | b1d6eb4b4090acee9be46983d3b478942cf56450 (diff) | |
download | rspamd-5c631c922ae329bdca994d0a2967eee80d830cd3.tar.gz rspamd-5c631c922ae329bdca994d0a2967eee80d830cd3.zip |
[Minor] RBL: don't register duplicate monitoring
-rw-r--r-- | src/plugins/lua/rbl.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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', |