From 25bf00ecbc2cab20ce66845513980b83b03f7c49 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 11 Dec 2012 02:31:07 -0500
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail

---
 program/lib/Roundcube/rcube_message.php |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php
index 4ef534a..c626af0 100644
--- a/program/lib/Roundcube/rcube_message.php
+++ b/program/lib/Roundcube/rcube_message.php
@@ -320,8 +320,15 @@
     private function parse_structure($structure, $recursive = false)
     {
         // real content-type of message/rfc822 part
-        if ($structure->mimetype == 'message/rfc822' && $structure->real_mimetype)
+        if ($structure->mimetype == 'message/rfc822' && $structure->real_mimetype) {
             $mimetype = $structure->real_mimetype;
+
+            // parse headers from message/rfc822 part
+            if (!isset($structure->headers['subject'])) {
+                list($headers, $dump) = explode("\r\n\r\n", $this->get_part_content($structure->mime_id, null, true, 4096));
+                $structure->headers = rcube_mime::parse_headers($headers);
+            }
+        }
         else
             $mimetype = $structure->mimetype;
 

--
Gitblit v1.9.1