[prev in list] [next in list] [prev in thread] [next in thread]
List: squirrelmail-cvs
Subject: [SM-CVS] SF.net SVN: squirrelmail: [12690]
From: pdontthink () users ! sourceforge ! net
Date: 2007-09-15 1:35:03
Message-ID: E1IWMYo-0006uj-VK () sc8-pr-svn2 ! sourceforge ! net
[Download RAW message or body]
Revision: 12690
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12690&view=rev
Author: pdontthink
Date: 2007-09-14 18:35:02 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
Make sqimap_get_message return fully parsed message representations
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php 2007-09-15 \
01:21:35 UTC (rev 12689)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/imap_messages.php 2007-09-15 \
01:35:02 UTC (rev 12690) @@ -672,6 +672,8 @@
$type = explode("/", $type);
if ( empty($type[0]) ) {
$type[0] = 'text';
+// I had this added, but not committed to CVS.... did it help fix something?
+// $type[1] = 'plain';
}
if ( empty($type[1]) ) {
$type[1] = 'plain';
@@ -832,10 +834,46 @@
$rfc822_header = new Rfc822Header();
$rfc822_header->parseHeader($read);
$msg->rfc822_header = $rfc822_header;
+
+ parse_message_entities($msg, $id, $imap_stream);
return $msg;
}
+
/**
+ * Recursively parse embedded messages (if any) in the given
+ * message, building correct rfc822 headers for each one
+ *
+ * @param object $msg The message object to scan for attached messages
+ * NOTE: this is passed by reference! Changes made
+ * within will affect the caller's copy of $msg!
+ * @param int $id The top-level message UID on the IMAP server, even
+ * if the $msg being passed in is only an attached entity
+ * thereof.
+ * @param resource $imap_stream A live connection to the IMAP server.
+ *
+ * @return void
+ *
+ * @since 1.4.11
+ *
+ */
+function parse_message_entities(&$msg, $id, $imap_stream) {
+ global $uid_support;
+ if (!empty($msg->entities)) foreach ($msg->entities as $i => $entity) {
+ if (is_object($entity) && get_class($entity) == 'Message') {
+ if (!empty($entity->rfc822_header)) {
+ $read = sqimap_run_command($imap_stream, "FETCH $id BODY[". \
$entity->entity_id .".HEADER]", true, $response, $message, $uid_support); + \
$rfc822_header = new Rfc822Header(); + \
$rfc822_header->parseHeader($read); + \
$msg->entities[$i]->rfc822_header = $rfc822_header; + }
+ parse_message_entities($msg->entities[$i], $id, $imap_stream);
+ }
+ }
+}
+
+
+/**
* Copies specified messages to specified folder
*
* This function is removed from SquirrelMail 1.5.1 and later versions.
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--
squirrelmail-cvs mailing list
List Address: squirrelmail-cvs@lists.sourceforge.net
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
http://squirrelmail.org/cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic