From: Vsevolod Stakhov Date: Sat, 14 Feb 2026 21:22:52 +0000 (+0000) Subject: [Feature] Use detected MIME types for attachments in structured formatter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66e0e5b37b78be3364ab5758d312ba843b3196b4;p=thirdparty%2Frspamd.git [Feature] Use detected MIME types for attachments in structured formatter --- diff --git a/src/plugins/lua/metadata_exporter.lua b/src/plugins/lua/metadata_exporter.lua index 65356677d2..32a81a9c8c 100644 --- a/src/plugins/lua/metadata_exporter.lua +++ b/src/plugins/lua/metadata_exporter.lua @@ -306,7 +306,11 @@ local formatters = { content = content or '', }) elseif part:is_attachment() then - local mime_type, mime_subtype = part:get_type() + -- Prefer detected type over announced type if available + local mime_type, mime_subtype = part:get_detected_type() + if not mime_type then + mime_type, mime_subtype = part:get_type() + end local content = part:get_content() table.insert(attachments, { filename = part:get_filename() or '',