From: Michael M Slusarz Date: Mon, 30 Nov 2009 02:11:32 +0000 (-0700) Subject: Workaround broken RFC 3462 messages. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=40c0952a60220b96f39dc06a2df5cbfe2d2a0803;p=horde.git Workaround broken RFC 3462 messages. --- 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; } }