commit a70b48e: [Minor] Fix text operation

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Dec 2 08:42:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-12-02 08:34:58 +0000
URL: https://github.com/rspamd/rspamd/commit/a70b48eec52d09f6d2fa395b21d7b902db255600 (HEAD -> master)

[Minor] Fix text operation

---
 lualib/rspamadm/mime.lua | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lualib/rspamadm/mime.lua b/lualib/rspamadm/mime.lua
index c8b1f8450..2870ca371 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
 


More information about the Commits mailing list