summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-17 09:58:41 +0100
committerGitHub <noreply@github.com>2018-04-17 09:58:41 +0100
commit25c596a3dafbb682bc07466732da9ce524f4dce9 (patch)
tree68c5a18230fb7649461461a8dcdcd4e101fbf90a
parent190530179aa87127ffd6980b86bc58a52a1286ad (diff)
parent4d6c328fecf0d533419de88a9b3a7ec70828ec9b (diff)
downloadrspamd-25c596a3dafbb682bc07466732da9ce524f4dce9.tar.gz
rspamd-25c596a3dafbb682bc07466732da9ce524f4dce9.zip
Merge pull request #2180 from bjoe2k4/patch-6
Fix Typo and add use_domain_sign_inbound
-rw-r--r--lualib/lua_auth_results.lua25
-rw-r--r--lualib/lua_dkim_tools.lua10
2 files changed, 15 insertions, 20 deletions
diff --git a/lualib/lua_auth_results.lua b/lualib/lua_auth_results.lua
index e8808d842..1636472c6 100644
--- a/lualib/lua_auth_results.lua
+++ b/lualib/lua_auth_results.lua
@@ -171,25 +171,16 @@ local function gen_auth_results(task, settings)
local smtp_from = task:get_from('smtp')
if u and smtp_from then
- local hdr
-
- if #smtp_from[1]['addr'] > 0 then
- 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
- if settings['add_smtp_user'] then
- hdr = string.format('auth=pass smtp.auth=%s', u)
- else
- hdr = 'auth=pass'
- end
+ local hdr = {[1] = 'auth=pass'}
+
+ if settings['add_smtp_user'] then
+ table.insert(hdr,'smtp.auth=' .. u)
+ end
+ if smtp_from[1]['addr'] then
+ table.insert(hdr,'smtp.mailfrom=' .. smtp_from[1]['addr'])
end
- table.insert(hdr_parts, hdr)
+ table.insert(hdr_parts, table.concat(hdr,' ')
end
if #hdr_parts > 0 then
diff --git a/lualib/lua_dkim_tools.lua b/lualib/lua_dkim_tools.lua
index 8f8878d3a..151f34e73 100644
--- a/lualib/lua_dkim_tools.lua
+++ b/lualib/lua_dkim_tools.lua
@@ -94,10 +94,14 @@ local function prepare_dkim_signing(N, task, settings)
dkim_domain = get_dkim_domain('use_domain_sign_networks')
rspamd_logger.debugm(N, task, 'sign_networks: use domain(%s) for signature: %s',
settings.use_domain_sign_networks, dkim_domain)
- elseif settings.use_domain_local and is_local then
- dkim_domain = get_dkim_domain('use_domain_local')
+ elseif settings.use_domain_sign_local and is_local then
+ dkim_domain = get_dkim_domain('use_domain_sign_local')
rspamd_logger.debugm(N, task, 'local: use domain(%s) for signature: %s',
- settings.use_domain_local, dkim_domain)
+ settings.use_domain_sign_local, dkim_domain)
+ elseif settings.use_domain_sign_inbound and not is_local and not auser then
+ dkim_domain = get_dkim_domain('use_domain_sign_inbound')
+ rspamd_logger.debugm(N, task, 'inbound: use domain(%s) for signature: %s',
+ settings.use_domain_sign_inbound, dkim_domain)
else
dkim_domain = get_dkim_domain('use_domain')
rspamd_logger.debugm(N, task, 'use domain(%s) for signature: %s',