aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-09-11 15:13:24 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-09-11 15:13:24 +0200
commitc5db86d4a0462047cd124501a44de98c84dfd5c7 (patch)
tree2a876bebd282b0fbeb50128937aec994fecd9766 /lualib
parent9e425476aee1a2a89dd42c638263498b7471863b (diff)
downloadrspamd-c5db86d4a0462047cd124501a44de98c84dfd5c7.tar.gz
rspamd-c5db86d4a0462047cd124501a44de98c84dfd5c7.zip
[Feature] Authentication-Results: support hiding usernames
Diffstat (limited to 'lualib')
-rw-r--r--lualib/auth_results.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/lualib/auth_results.lua b/lualib/auth_results.lua
index 5f4b2f896..4a36e618b 100644
--- a/lualib/auth_results.lua
+++ b/lualib/auth_results.lua
@@ -50,6 +50,7 @@ local default_settings = {
none = 'ARC_NA',
reject = 'ARC_REJECT',
},
+ add_smtp_user = true,
}
local exports = {}
@@ -172,10 +173,19 @@ local function gen_auth_results(task, settings)
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'])
+ if settings['add_smtp_user'] then
+ hdr = string.format('auth=pass smtp.auth=%s smtp.mailfrom=%s',
+ u, smtp_from[1]['addr'])
+ else
+ hdr = string.format('auth=pass smtp.mailfrom=%s',
+ smtp_from[1]['addr'])
+ end
else
- hdr = string.format('auth=pass smtp.auth=%s', u)
+ if settings['add_smtp_user'] then
+ hdr = string.format('auth=pass smtp.auth=%s', u)
+ else
+ hdr = 'auth=pass'
+ end
end
table.insert(hdr_parts, hdr)