From 69df8a17b6fb7e9e1a0f821ca37bf8d237069a73 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Tue, 3 Oct 2017 14:39:30 +0200 Subject: [PATCH] [Fix] Authentication Results: Fix SPF smtp.mail_from - MFH: rspamd-1.6 --- lualib/auth_results.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lualib/auth_results.lua b/lualib/auth_results.lua index 5f4b2f896..edf13fff8 100644 --- a/lualib/auth_results.lua +++ b/lualib/auth_results.lua @@ -152,8 +152,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 -- 2.39.5