diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-17 16:52:59 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-12-17 16:52:59 +0000 |
commit | 3c8ee165440c1afb24ffa100b5787aa04cc284ea (patch) | |
tree | 9f387b00fd9c916d6153c426932a601461b3bcfc /lualib/rspamadm/mime.lua | |
parent | fb63f8504023cc6cb0b8cf17911cbbc215a4940c (diff) | |
download | rspamd-3c8ee165440c1afb24ffa100b5787aa04cc284ea.tar.gz rspamd-3c8ee165440c1afb24ffa100b5787aa04cc284ea.zip |
[Project] Rspamadm: Do not alter signed parts
Diffstat (limited to 'lualib/rspamadm/mime.lua')
-rw-r--r-- | lualib/rspamadm/mime.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lualib/rspamadm/mime.lua b/lualib/rspamadm/mime.lua index daadbab98..07fc982a7 100644 --- a/lualib/rspamadm/mime.lua +++ b/lualib/rspamadm/mime.lua @@ -679,8 +679,6 @@ local function modify_handler(opts) for _,part in ipairs(task:get_parts()) do local boundary = part:get_boundary() if part:is_multipart() then - local _,st = part:get_type() - if cur_boundary then io.write(string.format('--%s%s', boundaries[#boundaries], newline_s)) @@ -714,6 +712,17 @@ local function modify_handler(opts) io.write(newline_s) else local append_footer = false + local skip_footer = part:is_attachment() + + local parent = part:get_parent() + if parent then + local t,st = parent:get_type() + + if t == 'multipart' and st == 'signed' then + -- Do not modify signed parts + skip_footer = true + end + end if text_footer and part:is_text() then local tp = part:get_text() @@ -744,7 +753,7 @@ local function modify_handler(opts) io.flush() - if append_footer then + if append_footer and not skip_footer then do_append_footer(task, part, append_footer) else part:get_raw_headers():save_in_file(1) |