]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add smtp auth results to Authentication-Results
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 1 Jun 2017 14:24:07 +0000 (15:24 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 1 Jun 2017 14:24:26 +0000 (15:24 +0100)
lualib/auth_results.lua

index c5fffb8e27968ec8a3b765eb645c58259afeb719..e706291c4cf1bfeffcf13502409662198a7d45a0 100644 (file)
@@ -164,6 +164,22 @@ local function gen_auth_results(task, settings)
     end
   end
 
+  local u = task:get_user()
+  local smtp_from = task:get_from('smtp')
+
+  if u and smtp_from then
+    local hdr
+
+    if #smtp_from[1]['addr'] > 0 then
+      hdr = string.format('auth=pass smtp.auth=%s smtp.mailfrom=%s',
+        u, smtp_from[1]['addr'])
+    else
+      hdr = string.format('auth=pass smtp.auth=%s', u)
+    end
+
+    table.insert(hdr_parts, hdr)
+  end
+
   if #hdr_parts > 0 then
     return table.concat(hdr_parts, '; ')
   end