From ba17741470086ad78efcc5b193422e7ab6afe46b Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Thu, 11 Apr 2024 16:12:47 +0200 Subject: [PATCH] ticket improved attachment handling when no content-disposition is giving --- .../Components/MailClient/Data/MailAttachmentData.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/classes/Components/MailClient/Data/MailAttachmentData.php b/classes/Components/MailClient/Data/MailAttachmentData.php index 741c6a1f..2d40fdd7 100644 --- a/classes/Components/MailClient/Data/MailAttachmentData.php +++ b/classes/Components/MailClient/Data/MailAttachmentData.php @@ -67,11 +67,18 @@ class MailAttachmentData implements MailAttachmentInterface } else if ($split[0] === 'inline') { return ('inline'); } - } else { // Check for application/octet-stream + } else { + // No disposition given (that is a bad thing) + // Check for application/octet-stream $content_type = $part->getContentType(); if ($content_type == 'application/octet-stream') { return('application/octet-stream'); - } + } + // Check for Content-id + $contentIdHeader = $part->getHeader('content-id'); + if ($contentIdHeader !== null) { + return ('inline'); + } } }