aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-01 15:24:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-01 15:24:26 +0100
commit9d72040612f37dbabad845459eb61fd75eaae233 (patch)
treeb9e7ca98533a6cb5e81979bfa4d23fd58100e605
parent8489874e86f3fa0b408a5a7b91c5dcb4c216d1a4 (diff)
downloadrspamd-9d72040612f37dbabad845459eb61fd75eaae233.tar.gz
rspamd-9d72040612f37dbabad845459eb61fd75eaae233.zip
[Minor] Add smtp auth results to Authentication-Results
-rw-r--r--lualib/auth_results.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/lualib/auth_results.lua b/lualib/auth_results.lua
index c5fffb8e2..e706291c4 100644
--- a/lualib/auth_results.lua
+++ b/lualib/auth_results.lua
@@ -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