Joe Cheng contacted me off-list about a stream-based MIME parser that he has written in C# for his company. His company gave permission to port it to Java and donate it to the ASF. It is structurally similar to the kind of approach we've talked about in the past, both here and on Jakarta Commons, and appears nice.
To quote Joe: "It transparently decodes Base64 and quoted-printable on demand (i.e., doesn't base64-decode that 5MB binary attachment until you actually ask for its bytes). It successfully deals with the "torture-test.mbox" message posted by Mark Crispin: http://groups.google.com/groups?selm=Pine.LNX.4.50.0205061424260.5068-100000 %40shiva0.cac.washington.edu. Also I believe it should deal quite gracefully with prematurely truncated nested body parts, illegal headers, illegal base64/quoted-printable encoding, and assorted other nastiness." Joe indicates that he is very interested in continuing to maintain and evolve it with us. His company should be FAXing a Software Grant; he will submit a CLA, and will check to see if a Corporate CLA is required. My thoughts are: - For those currently thinking that we don't need an alternative to JavaMail, think of this playing the same role that SAX does to DOM. - org.apache.mailet.Mail could allow one to query the message as either a stream or a JavaMail message. - most matchers could use this package, rather than JavaMail. - many mailets could also use it, once support is added for doing simple things. - It is event driven, in a natural Java fashion, with a handful of specialized Listeners called during processing of the stream. - It would not take much to modify it to support push processing (java.nio model). The whole package is about 50K of code. We should probably import this through the Incubator as a pass-through for James. I'm not sure if it would be best to add it as org.apache.james.util.mime, and perhaps eventually migrate to Jakarta Commons, or to include it within the Mailet API. --- Noel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]