diff options
author | Andrew Lewis <nerf@judo.za.org> | 2015-02-08 15:55:28 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2015-02-08 19:21:18 +0200 |
commit | 3977d62bbf8a9f5e391b3f461f656da6d02c1290 (patch) | |
tree | e44830560d5753bf3dd3b389fc464c3433085bbd /src/plugins/lua/settings.lua | |
parent | 4d0e7b66e50b17a7b091394f3496089757a75fc0 (diff) | |
download | rspamd-3977d62bbf8a9f5e391b3f461f656da6d02c1290.tar.gz rspamd-3977d62bbf8a9f5e391b3f461f656da6d02c1290.zip |
Make settings work as documented
Diffstat (limited to 'src/plugins/lua/settings.lua')
-rw-r--r-- | src/plugins/lua/settings.lua | 32 |
1 files changed, 28 insertions, 4 deletions
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 |