[dev] Reading messages with Horde_Mime_Part::parseMessage()
Gunnar Wrobel
wrobel at horde.org
Mon Mar 14 08:36:30 UTC 2011
Hi Micheal,
when working on the final elements of the Kolab_Storage API this
weekend I used Horde_Mime_Part::parseMessage() to read in complete
messages from the IMAP backend. I replaced one part of these messages
with alterPart() and tried writing the messages back via toString().
The resulting message did however duplicate the message to some
extend. When reading multi-part messages with parseMessage() the base
part ($message->getPart('0')) contains the complete message text
including all subparts. This leads to the duplication when using
$message->toString() afterwards.
My expectation was that this would hold true:
$message = Horde_Mime_Part::parseMessage($message_text);
$message->toString() == $message_text;
Maybe not absolutely "==" but at least to large extends. So is my
expectation incorrect and if so how should I use the library to
manipulate existing messages?
Thanks!
Gunnar
--
Core Developer
The Horde Project
e: wrobel at horde.org
t: +49 700 6245 0000
w: http://www.horde.org
pgp: 9703 43BE
tweets: http://twitter.com/pardus_de
blog: http://log.pardus.de
More information about the dev
mailing list