diff --git a/classes/Components/MailClient/Data/MailAttachmentData.php b/classes/Components/MailClient/Data/MailAttachmentData.php index c9893eaf..05c1a949 100644 --- a/classes/Components/MailClient/Data/MailAttachmentData.php +++ b/classes/Components/MailClient/Data/MailAttachmentData.php @@ -161,7 +161,7 @@ class MailAttachmentData implements MailAttachmentInterface $content = $part->getContent(); if ($content === null) { // This should not be throw new InvalidArgumentException( - sprintf('content is null "%s"', print_r($part,true)) + sprintf('content is null "%s"', substr(print_r($part,true),1000)) ); } diff --git a/classes/Modules/Ticket/Task/TicketImportHelper.php b/classes/Modules/Ticket/Task/TicketImportHelper.php index 390db20c..9f29c30f 100644 --- a/classes/Modules/Ticket/Task/TicketImportHelper.php +++ b/classes/Modules/Ticket/Task/TicketImportHelper.php @@ -593,7 +593,14 @@ class TicketImportHelper $this->logger->debug('Importing message',['message' => $message]); - $attachments = $message->getAttachments(); + try { + $attachments = $message->getAttachments(); + } + catch (Throwable $e) { + $this->logger->error('Error while getting attachments',['exception' => $e]); + return(false); + } + $anhang = count($attachments) > 0 ? 1 : 0; $mailacc = $this->mailAccount->getEmailAddress(); $mailaccid = $this->mailAccount->getId();