Fix ticket mails with application/pdf but no content disposition

This commit is contained in:
OpenXE 2025-02-25 17:49:52 +01:00
parent 94043a6609
commit 834588c347
2 changed files with 6 additions and 7 deletions

View File

@ -74,6 +74,11 @@ class MailAttachmentData implements MailAttachmentInterface
if ($content_type == 'application/octet-stream') {
return('application/octet-stream');
}
// Check for application/pdf
$content_type = $part->getContentType();
if ($content_type == 'application/pdf') {
return('application/pdf');
}
// Check for Content-id
$contentIdHeader = $part->getHeader('content-id');
if ($contentIdHeader !== null) {

View File

@ -558,13 +558,7 @@ class TicketImportHelper
}
if ($plainTextBody == '' && $htmlBody == '') {
$simple_content = $message->getContent();
if (empty($simple_content)) {
$this->logger->debug('Empty mail',[]);
} else {
$plainTextBody = $simple_content;
$htmlBody = nl2br(htmlentities($simple_content));
}
$this->logger->debug('Empty mail',[]);
}
$this->logger->debug('Text',['plain' => $plainTextBody, 'html' => $htmlBody, 'simple_content' => $simple_content]);