From a814477d26ef2391a7f3332a50a5a89499091b62 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 2 Aug 2016 14:49:03 +0100 Subject: [PATCH] [Feature] Allow to create settings for authenticated users Use `authenticated = true;` for this feature --- src/plugins/lua/settings.lua | 11 +++++++++-- 1 file 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) -- 2.39.5