Plamen Hristov wrote:
I'm currently trying to extract various message attachment types [doc, odt, pdf, etc] and convert them to plain text.I'm using the $IMAP->get_raw_body method to get the raw data and then send it to the appropriate converting program.Everything works fine except the fact that my converter does not recognize the file type.Seems like that $IMAP->get_raw_body is generating invalid content.
Also 'file' returns RFC 822 mail text, instead of the standard ASCII mail text
Well, rcube_imap::get_raw_body() returns the complete message source including all headers and is formatted according to RFC 822.
What you are looking for is a message structure after parsing the source:
$msg = new rcube_message($uid); foreach ($msg->mime_parts as $mime_id => $part) echo $msg->get_part_content($mime_id);
Note: you'll need the latest svn checkout to have all these classes available.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/users/