Happy New Year!
[squirrelmail.git] / functions / mailbox_display.php
index a3673bf8430146f087f2f20dd8d3bfc5084f0d32..c36ddcd4e69662772dd1f838918e8603ee648002 100644 (file)
@@ -6,7 +6,7 @@
  * This contains functions that display mailbox information, such as the
  * table row that has sender, date, subject, etc...
  *
- * @copyright 1999-2010 The SquirrelMail Project Team
+ * @copyright 1999-2011 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -1532,6 +1532,17 @@ function attachSelectedMessages($imapConnection,$aMsgHeaders) {
             fclose($fp);
 
             $composeMessage->initAttachment('message/rfc822', $subject . '.eml', $filename);
+
+            // create subject for new message
+            //
+            $subject = decodeHeader($subject,false,false,true);
+            $subject = str_replace('"', "'", $subject);
+            $subject = trim($subject);
+            if (substr(strtolower($subject), 0, 4) != 'fwd:') {
+                $subject = 'Fwd: ' . $subject;
+            }
+            $composeMessage->rfc822_header->subject = $subject;
+
         }
     }