diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-13 12:38:26 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-05-13 12:38:26 +0100 |
commit | 74d11283d93c1f9a39e95ae1da59db11ccd444fa (patch) | |
tree | c31fd55f47ad62500d42e3cc44189e0718ddd656 | |
parent | 23a41dae4ddb3c5ae48f90e03b67653881f93018 (diff) | |
download | rspamd-74d11283d93c1f9a39e95ae1da59db11ccd444fa.tar.gz rspamd-74d11283d93c1f9a39e95ae1da59db11ccd444fa.zip |
[Fix] Re-use milter_headers settings when doing arc signing
Issue: #2073
-rw-r--r-- | src/plugins/lua/arc.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index 53d1779b5..496e8c21e 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -90,6 +90,12 @@ local settings = { reuse_auth_results = false, -- Reuse the existing authentication results } +-- To match normal AR +local ar_settings = { + add_smtp_user = true, + stop_chars = ';' +} + local function parse_arc_header(hdr, target) -- Split elements by ';' and trim spaces local arr = fun.totable(fun.map( @@ -425,10 +431,10 @@ local function arc_sign_seal(task, params, header) cur_auth_results = ar_header else rspamd_logger.debugm(N, task, 'cannot reuse authentication results, header is missing') - cur_auth_results = auth_results.gen_auth_results(task) or '' + cur_auth_results = auth_results.gen_auth_results(task, ar_settings) or '' end else - cur_auth_results = auth_results.gen_auth_results(task) or '' + cur_auth_results = auth_results.gen_auth_results(task, ar_settings) or '' end local sha_ctx = hash.create_specific('sha256') @@ -621,6 +627,17 @@ if not dkim_sign_tools.validate_signing_settings(settings) then return end +local ar_opts = rspamd_config:get_all_opt('milter_headers') + +if ar_opts and ar_opts.routines then + local routines = ar_opts.routines + + if routines['authentication-results'] then + ar_settings = lua_util.override_defaults(ar_settings, + routines['authentication-results']) + end +end + if settings.use_redis then redis_params = rspamd_parse_redis_server('arc') |