From 6a4eebc498ff9461db3a89394b166d13f78c2f65 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Tue, 16 Aug 2016 10:41:29 +1200 Subject: [PATCH] CRM-9484. Handle ezcMailDeliveryStatus message part. --- CRM/Utils/Mail/Incoming.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php index a3c869402e..12e97e5012 100644 --- a/CRM/Utils/Mail/Incoming.php +++ b/CRM/Utils/Mail/Incoming.php @@ -83,6 +83,10 @@ class CRM_Utils_Mail_Incoming { return self::formatMailMultipart($part, $attachments); } + if ($part instanceof ezcMailDeliveryStatus) { + return self::formatMailDeliveryStatus($part); + } + // CRM-19111 - Handle blank emails with a subject. if (!$part) { return NULL; @@ -118,6 +122,10 @@ class CRM_Utils_Mail_Incoming { return self::formatMailMultipartReport($part, $attachments); } + if ($part instanceof ezcMailDeliveryStatus) { + return self::formatMailDeliveryStatus($part); + } + CRM_Core_Error::fatal(ts("No clue about the %1", array(1 => get_class($part)))); } @@ -227,6 +235,19 @@ class CRM_Utils_Mail_Incoming { return $t; } + /** + * @param $part + * + * @return string + */ + public function formatMailDeliveryStatus($part) { + $t = ''; + $t .= "-DELIVERY STATUS BEGIN-\n"; + $t .= $part->generateBody(); + $t .= "-DELIVERY STATUS END-\n"; + return $t; + } + /** * @param $part * @param $attachments -- 2.25.1