From 4c31adaa82cf4dc94f26886eff14746c5233bd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Tue, 1 May 2018 22:44:03 +0200 Subject: [PATCH] [Rspamd] Ratelimit: fix attempt to index a nil value when no authenticated user is found in a message --- data/conf/rspamd/lua/rspamd.local.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua index 05c5f0b9..64a2fbc4 100644 --- a/data/conf/rspamd/lua/rspamd.local.lua +++ b/data/conf/rspamd/lua/rspamd.local.lua @@ -59,10 +59,12 @@ rspamd_config:register_symbol({ local redis_params = rspamd_parse_redis_server('dyn_rl') local rspamd_logger = require "rspamd_logger" local envfrom = task:get_from(1) - local uname = task:get_user():lower() + local uname = task:get_user() if not envfrom or not uname then return false end + local uname = uname:lower() + local env_from_domain = envfrom[1].domain:lower() -- get smtp from domain in lower case local function redis_cb_user(err, data)