Re: newbie parsing problem
Dave Serls <[email protected]> Sun, 28 Jan 2007 07:56:07 -0700
| Newsgroups | gmane.mail.libetpan.user |
|---|---|
| Organization | Sorry Biscuit Software |
| Message-ID | <[email protected]> |
On Sun, 28 Jan 2007 01:44:23 +0100 DINH Viêt Hoà <[email protected]> wrote: > On 27 Jan 2007, at 21:13, Dave Serls wrote: > > > I'm trying to parse messages containe in a SquirrelMail 'Sent' > > folder, an mbox > > file with a uw IMAP header. > > I'd like to replace non-text MIME parts with plain text place holders, > > thus reducing the size of these folders for backup purposes, et. al. > > > > mailmime_parse doesn't seem to break out the imbedded encoded parts in > > the simplest case. There's clearly a multi-partmixed Content-type, > > but the > > imbedded image part is not parsed. Am I missing something > > elemental (other > > than a functional cranium)? > > If I understand well your message, I think that you want to decode > MIME encoded part (base64 or quoted-printable). > See mailmime_content.h: mailmime_base64_body_parse() and > mailmime_quoted_printable_body_parse() > Thank you for your reply. Basically, I want to discover if the content-type of a part is NOT 'text/xxxx', make it 'text/plain' and replace the body with a single line of text stating that it has been replaced. Then this altered message will be output. I'm using the sample code to run mailmime_parse() on the mmap'ed message. The single attachment test messages I've used from squirrelmail parse with no content-type revealed for a large jpeg attachment. Here is the output (I can also send the input if I cloak it somewhat). message part : 0xb7a86000, length : 598564 MIME headers: content type: type: mime type: composite type: composite type is message subtype: rfc822 headers: sub message 0x804e010: single part part : 0xb7a86000, length : 598564 content type: type: mime type: discrete type: text subtype: plain 8bit already encoded data : 0xb7a86000 598564 end of sub message 0x804e010 -- ************************************************************************ * Dave Serls Littleton, CO, USA * * dashs.denver.co.us dashs.com * ************************************************************************ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV