CK_beats Aww now you tell me I was like OMG what have you done to the lua script looked like Frankenstein’s Monster lol.. OK see where the issues is now. Adding the footer strips out inline images.
– add footer
local out = {}
local rewrite = lua_mime.add_text_footer(task, footer.html, footer.plain) or {}
local seen_cte
local newline_s = newline(task)
local function rewrite_ct_cb(name, hdr)
if rewrite.need_rewrite_ct then
if name:lower() == ‘content-type’ then
– NEW: include boundary if present
change the part in bold to include multipart.
if name:lower() == 'content-type' and not hdr.value:lower():match('^multipart/') then
Also here..
task:set_milter_reply({
add_headers = {[‘Content-Type’] = string.format(‘%s/%s; charset=utf-8%s’,
rewrite.new_ct.type, rewrite.new_ct.subtype, boundary_part)}
})
return
elseif name:lower() == ‘content-transfer-encoding’ then
out[#out + 1] = string.format(‘%s: %s’,
‘Content-Transfer-Encoding’, ‘quoted-printable’)
– update Content-Transfer-Encoding header
elseif name:lower() == 'content-transfer-encoding' and not hdr.value:lower():match('^multipart/') then
This makes your script leave multipart/* mails (with inline images, attachments, etc.) alone, so the images won’t disappear when you inject the footer.
As a side note I would advise using something like VS Code to access your mailserver. Makes coding a lot easier than using Nano. Alternative to that use the cat filename.extention command to see the file to enable copying complete text.
New Pull Request https://github.com/mailcow/mailcow-dockerized/compare/master…shaneodoo:mailcow-dockerized:master