[Rspamd] Ratelimit: fix attempt to index a nil value when no authenticated user is found in a message

master
André 2018-05-01 22:44:03 +02:00
parent 6ee68ecfdb
commit 4c31adaa82
1 changed files with 3 additions and 1 deletions

View File

@ -59,10 +59,12 @@ rspamd_config:register_symbol({
local redis_params = rspamd_parse_redis_server('dyn_rl') local redis_params = rspamd_parse_redis_server('dyn_rl')
local rspamd_logger = require "rspamd_logger" local rspamd_logger = require "rspamd_logger"
local envfrom = task:get_from(1) local envfrom = task:get_from(1)
local uname = task:get_user():lower() local uname = task:get_user()
if not envfrom or not uname then if not envfrom or not uname then
return false return false
end end
local uname = uname:lower()
local env_from_domain = envfrom[1].domain:lower() -- get smtp from domain in lower case local env_from_domain = envfrom[1].domain:lower() -- get smtp from domain in lower case
local function redis_cb_user(err, data) local function redis_cb_user(err, data)