diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-02 14:49:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-02 14:49:03 +0100 |
commit | a814477d26ef2391a7f3332a50a5a89499091b62 (patch) | |
tree | dbbd003240225a725a55193dfde4307e9259f7db | |
parent | ddca96c2b83cc54feaf234916228f1c719dea531 (diff) | |
download | rspamd-a814477d26ef2391a7f3332a50a5a89499091b62.tar.gz rspamd-a814477d26ef2391a7f3332a50a5a89499091b62.zip |
[Feature] Allow to create settings for authenticated users
Use `authenticated = true;` for this feature
-rw-r--r-- | src/plugins/lua/settings.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index cb7e4743f..18059a9a6 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -139,9 +139,16 @@ local function check_settings(task) return false end - local function check_specific_setting(name, rule, ip, client_ip, from, rcpt, user) + local function check_specific_setting(name, rule, ip, client_ip, from, rcpt, + user, auth_user) local res = false + if rule['authenticated'] then + if auth_user then + res = true + end + end + if rule['ip'] then if not ip then return nil @@ -262,7 +269,7 @@ local function check_settings(task) for pri = max_pri,1,-1 do if settings[pri] then for name, r in pairs(settings[pri]) do - local rule = check_specific_setting(name, r, ip, client_ip, from, rcpt, user) + local rule = check_specific_setting(name, r, ip, client_ip, from, rcpt, user, uname) if rule then rspamd_logger.infox(task, "<%1> apply settings according to rule %2", task:get_message_id(), name) |