]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Authentication Results: Fix SPF smtp.mail_from
authorAndrew Lewis <nerf@judo.za.org>
Tue, 3 Oct 2017 12:39:30 +0000 (14:39 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 3 Oct 2017 12:40:03 +0000 (14:40 +0200)
 - MFH: rspamd-1.6

lualib/auth_results.lua

index 1a907747ba6f59e810efc032a8a493cde5b922e8..92f702950614166fa4677b9f5a7bda0158343aa3 100644 (file)
@@ -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