From: Andrew Lewis Date: Sun, 8 Feb 2015 13:55:28 +0000 (+0200) Subject: Make settings work as documented X-Git-Tag: 0.9.0~744^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3977d62bbf8a9f5e391b3f461f656da6d02c1290;p=rspamd.git Make settings work as documented --- diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index 01c266a3f..a219370e2 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -73,40 +73,64 @@ local function check_settings(task) local function check_specific_setting(name, rule, ip, from, rcpt, user) local res = false - if rule['ip'] and ip then + if rule['ip'] then + if not ip then + return nil + end for _, i in ipairs(rule['ip']) do res = check_ip_setting(i, ip) if res then break end end + if not res then + return nil + end end - if not res and rule['from'] and from then + if rule['from'] then + if not from then + return nil + end for _, i in ipairs(rule['from']) do res = check_addr_setting(i, from) if res then break end end + if not res then + return nil + end end - if not res and rule['rcpt'] and rcpt then + if rule['rcpt'] then + if not rcpt then + return nil + end for _, i in ipairs(rule['rcpt']) do res = check_addr_setting(i, rcpt) if res then break end end + if not res then + return nil + end end - if not res and rule['user'] and user then + if rule['user'] then + if not user then + return nil + end for _, i in ipairs(rule['user']) do res = check_addr_setting(i, user) if res then break end end + if not res then + return nil + end end if res then