diff options
author | AL <AlexeySa@users.noreply.github.com> | 2016-11-13 14:33:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-13 14:33:17 +0300 |
commit | cdfb0245ba675f18e1a510e46fa42177ccbe91a1 (patch) | |
tree | 8eb0d06db523daa13a7f5dc69a1f013c6cc89920 /src/plugins/lua/greylist.lua | |
parent | 5d622a816721908f2e8c9466d6275ae61c244fc2 (diff) | |
download | rspamd-cdfb0245ba675f18e1a510e46fa42177ccbe91a1.tar.gz rspamd-cdfb0245ba675f18e1a510e46fa42177ccbe91a1.zip |
Clearer greylist module code
Diffstat (limited to 'src/plugins/lua/greylist.lua')
-rw-r--r-- | src/plugins/lua/greylist.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index d32f411d8..f3667177c 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -275,10 +275,10 @@ local function greylist_set(task) end local action = task:get_metric_action('default') - if do_greylisting_required then - if do_greylisting_required ~= "1" or action == 'reject' then return end + if action == 'reject' then return end + if do_greylisting_required and do_greylisting_required ~= "1" then return end else - if action == 'no action' or action == 'reject' then return end + if action == 'no action' then return end end local body_key = data_key(task) local meta_key = envelope_key(task) @@ -322,7 +322,7 @@ local function greylist_set(task) rspamd_logger.infox(task, 'got error while connecting to redis: %1', upstream:get_addr()) upstream:fail() end - elseif do_greylisting or do_greylisting_required then + elseif do_greylisting or (do_greylisting_required and do_greylisting_required == "1") then local t = tostring(math.floor(rspamd_util.get_time())) local end_time = rspamd_util.time_to_string(t + settings['timeout']) rspamd_logger.infox(task, 'greylisted until "%s", new record', end_time) |