From: Michael M Slusarz Date: Tue, 2 Dec 2008 20:19:16 +0000 (-0700) Subject: Clean up header MIME generation. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=edef452376f329fe6b1dd882714f71b6a34305c3;p=horde.git Clean up header MIME generation. Further reading of RFC 2045 indicates that MIME-Version is NOT needed for message/rfc822 parts - the MIME-Version string only needs to appear in the embedded header. --- diff --git a/framework/Mime/lib/Horde/Mime/Part.php b/framework/Mime/lib/Horde/Mime/Part.php index 9a22b94e9..d6061f9c7 100644 --- a/framework/Mime/lib/Horde/Mime/Part.php +++ b/framework/Mime/lib/Horde/Mime/Part.php @@ -740,9 +740,6 @@ class Horde_Mime_Part $headers = new Horde_Mime_Headers(); } - $ptype = $this->getPrimaryType(); - $stype = $this->getSubType(); - /* Get the Content-Type itself. */ $headers->replaceHeader('Content-Type', $this->getType(), array('params' => $this->getAllContentTypeParameters())); @@ -751,18 +748,13 @@ class Horde_Mime_Part $headers->replaceHeader('Content-Description', $descrip); } - /* RFC 2045 [4] - message/rfc822 and message/partial require the - * MIME-Version header only if they themselves claim to be MIME - * compliant. - * @TODO - Check for "MIME-Version" in message/rfc822 part. - * Per RFC 2046 [4], this MUST appear in the base message headers. */ - if ($this->_basepart || - (($ptype == 'message') && - (($stype == 'rfc822') || ($stype == 'partial')))) { + /* Per RFC 2046 [4], this MUST appear in the base message headers. */ + if ($this->_basepart) { $headers->replaceHeader('MIME-Version', '1.0'); } /* message/* parts require no additional header information. */ + $ptype = $this->getPrimaryType(); if ($ptype == 'message') { return $headers; }