From: Vsevolod Stakhov Date: Wed, 2 Dec 2020 08:34:58 +0000 (+0000) Subject: [Minor] Fix text operation X-Git-Tag: 2.7~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a70b48eec52d09f6d2fa395b21d7b902db255600;p=thirdparty%2Frspamd.git [Minor] Fix text operation --- diff --git a/lualib/rspamadm/mime.lua b/lualib/rspamadm/mime.lua index c8b1f8450f..2870ca3711 100644 --- a/lualib/rspamadm/mime.lua +++ b/lualib/rspamadm/mime.lua @@ -727,20 +727,27 @@ local function modify_handler(opts) out[#out + 1] = o end else - out[#out + 1] = task:get_rawbody() + out[#out + 1] = {task:get_rawbody(), false} end for _,o in ipairs(out) do if type(o) == 'string' then io.write(o) io.write(newline_s) - else + elseif type(o) == 'table' then io.flush() - o[1]:save_in_file(1) + if type(o[1]) == 'string' then + io.write(o[1]) + else + o[1]:save_in_file(1) + end if o[2] then io.write(newline_s) end + else + o:save_in_file(1) + io.write(newline_s) end end