diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-29 18:54:02 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-29 18:54:02 +0100 |
commit | b691da311f5c2fe920ddc268d041fa9999601ba6 (patch) | |
tree | 414f7ededa3ab3dac56429049a3ef9a2c4fd8421 /src/plugins | |
parent | 80e19bd185b0615b2cec23aea3024537d1cf0ecc (diff) | |
download | rspamd-b691da311f5c2fe920ddc268d041fa9999601ba6.tar.gz rspamd-b691da311f5c2fe920ddc268d041fa9999601ba6.zip |
[Minor] Fix blacklist option in whitelist rules
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/whitelist.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua index ab85b184d..c2341110c 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 |