From: Vsevolod Stakhov Date: Tue, 2 Aug 2016 13:49:03 +0000 (+0100) Subject: [Feature] Allow to create settings for authenticated users X-Git-Tag: 1.3.2~78 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a814477d26ef2391a7f3332a50a5a89499091b62;p=rspamd.git [Feature] Allow to create settings for authenticated users Use `authenticated = true;` for this feature --- 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)