Subject: [Imap-uw] Parsing multipart mime messages with c-client?

From: Brad Goldsmith <[email-masked]>
Date: Fri, 03 Mar 2006 00:44:00 +1100

Hi All,

I have a project requirement that needs to be able to parse a multipart 
mime message to be able to pick out the attachments, process them and 
them put them back again.

Would c-client fit the bill for this kind of job?

Sorry to ask a bit of a lazy question but I am hoping the list here can 
point me in the direction of some examples or offer some general advice 
regarding suitability. I've trawled through the archives and also had a 
bit of a play with mtest and it looks promising so far.

Thanks,
Brad
_______________________________________________
Imap-uw mailing list
[email-masked]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

---

From: Mark Crispin <[email-masked]>
Date: Thu, 2 Mar 2006 09:06:52 -0800 (PST)

On Fri, 3 Mar 2006, Brad Goldsmith wrote:
> I have a project requirement that needs to be able to parse a multipart mime 
> message to be able to pick out the attachments, process them and them put 
> them back again.

I don't know what you mean by "process them and the[n?] put them back 
together again".

c-client is certainly capable of parsing an arbitrarily complex multipart 
MIME message and return a tree-structured representation of the MIME 
structure.  Having that tree structure, you can calculate IMAP-style body 
part specifier; and a different c-client function can retrieve the desired 
part from the overall message.  mtest demonstrates how you calculate the 
body part specifier from the tree structure.

c-client is not the most complex API out there; in fact it is a gem of 
simplicity compared to OpenSSL, GSSAPI, or any Microsoft API. 
Nevertheless, it isn't trivial either.

My entire purpose for writing c-client was that I process email, including 
MIME, in multiple programs; and I really didn't want to write the same 
code to do the same tasks over and over again.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
_______________________________________________
Imap-uw mailing list
[email-masked]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw