From: Vsevolod Stakhov Date: Sat, 29 Sep 2018 17:54:02 +0000 (+0100) Subject: [Minor] Fix blacklist option in whitelist rules X-Git-Tag: 1.8.1~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b691da311f5c2fe920ddc268d041fa9999601ba6;p=thirdparty%2Frspamd.git [Minor] Fix blacklist option in whitelist rules --- diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua index ab85b184d9..c2341110c4 100644 --- a/src/plugins/lua/whitelist.lua +++ b/src/plugins/lua/whitelist.lua @@ -42,11 +42,14 @@ local function whitelist_cb(symbol, rule, task) local function find_domain(dom) local mult local how = 'wl' + if rule.blacklist then how = 'bl' end local function parse_val(val) + local how = 'wl' + if rule.blacklist then how = 'bl' end if val then if val == '' then - return 'wl',1.0 + return how,1.0 elseif val:match('^bl:') then return 'bl',(tonumber(val:sub(4)) or 1.0) elseif val:match('^wl:') then @@ -54,11 +57,11 @@ local function whitelist_cb(symbol, rule, task) elseif val:match('^both:') then return 'both',(tonumber(val:sub(6)) or 1.0) else - return 'wl',(tonumber(val) or 1.0) + return how,(tonumber(val) or 1.0) end end - return 'wl',1.0 + return how,1.0 end if rule['map'] then @@ -93,7 +96,7 @@ local function whitelist_cb(symbol, rule, task) local found = false local mult - local how = '' -- whitelist only + local how = 'wl' -- whitelist only local spf_violated = false local dkim_violated = false local dmarc_violated = false