From 40c0952a60220b96f39dc06a2df5cbfe2d2a0803 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sun, 29 Nov 2009 19:11:32 -0700 Subject: [PATCH] Workaround broken RFC 3462 messages. --- framework/Mime/lib/Horde/Mime/Viewer/Report.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/framework/Mime/lib/Horde/Mime/Viewer/Report.php b/framework/Mime/lib/Horde/Mime/Viewer/Report.php index 3ec86ce0c..9703bb48b 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/Report.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/Report.php @@ -21,13 +21,21 @@ class Horde_Mime_Viewer_Report extends Horde_Mime_Viewer_Driver protected function _getViewer() { if (!($type = $this->_mimepart->getContentTypeParameter('report-type'))) { - return false; + /* This is a broken RFC 3462 message, since 'report-type' is + * mandatory. Try to determine the report-type by looking at the + * sub-type of the second body part. */ + $parts = $this->_mimepart->getParts(); + if (!isset($parts[1])) { + return false; + } + $type = $parts[1]->getSubType(); } $viewer = Horde_Mime_Viewer::factory($this->_mimepart, 'message/' . Horde_String::lower($type)); if ($viewer) { $viewer->setParams($this->_params); } + return $viewer; } } -- 2.11.0