From: Andrew Lewis Date: Tue, 3 Oct 2017 12:39:30 +0000 (+0200) Subject: [Fix] Authentication Results: Fix SPF smtp.mail_from X-Git-Tag: 1.7.0~588 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ed5e94cda8c18f5dcd4ecfe35cda227b3558dd4;p=thirdparty%2Frspamd.git [Fix] Authentication Results: Fix SPF smtp.mail_from - MFH: rspamd-1.6 --- diff --git a/lualib/auth_results.lua b/lualib/auth_results.lua index 1a907747ba..92f7029506 100644 --- a/lualib/auth_results.lua +++ b/lualib/auth_results.lua @@ -153,8 +153,8 @@ local function gen_auth_results(task, settings) elseif auth_type == 'spf' and key ~= 'none' then hdr = hdr .. auth_type .. '=' .. key local smtp_from = task:get_from('smtp') - if smtp_from['addr'] ~= '' and smtp_from['addr'] ~= nil then - hdr = hdr .. ' smtp.mailfrom=' .. smtp_from['addr'] + if smtp_from and smtp_from[1] and smtp_from[1]['addr'] ~= '' and smtp_from[1]['addr'] ~= nil then + hdr = hdr .. ' smtp.mailfrom=' .. smtp_from[1]['addr'] else local helo = task:get_helo() if helo then