Dave Serls | 27 Jan 2007 21:13
Picon
Picon
Favicon

newbie parsing problem

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)?

--

-- 
************************************************************************
*   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
DINH Viêt Hoà | 28 Jan 2007 01:44
Picon
Favicon

Re: newbie parsing problem

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()

--

-- 
DINH Viêt Hoà

-------------------------------------------------------------------------
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
Dave Serls | 28 Jan 2007 15:56
Picon
Picon
Favicon

Re: newbie parsing problem

On Sun, 28 Jan 2007 01:44:23 +0100
DINH Viêt Hoà <dinh.viet.hoa@...> 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 
(Continue reading)

DINH Viêt Hoà | 28 Jan 2007 16:34
Picon
Favicon

Re: newbie parsing problem

On 28 Jan 2007, at 15:56, Dave Serls wrote:

> 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
>
>
(Continue reading)


Gmane