Hi Israel, you are right Mime4J and JavaMail overlap in many use cases. However let me explain you why JavaMail is often not the best way to deal with messages:
1) JavaMail needs to read the whole email into the memory very often. This is really a big problem when you have many emails which needs to get processed in parallel. We added some kind of workaround in James so we don't need to read the whole email into memory when ever possible 2) JavaMail does not handle malformated emails very good. Both of this problems are not the case when you use Mime4J. The MimeMessage usage in James is only there because of the "good old days". In the "perfect" world we wouldn't use the JavaMail stuff at all in James. But thats not what currently is the case. So at the moment you should just use the MimeMessage stuff as we need to handle the MimeMessage stuff in James anyway. But I hope we are able to remove the JavaMail usage at all in the near future, by just provide the Email as InputStream and allow to save the changes to an OutputStream.... Hope this helps you, Norman 2010/4/22 Israel Tsadok <[email protected]>: > I'm writing some mailets that perform transformations on messages. Adding > headers, footers, removing attachments, stuff like that. I've used the > AddFooter mailet as a guide, so I've been traversing the MimeMessage, > looping over multiparts etc. > > The mime4j project seems to have similar goals to javax.mail.MimeMessage. > Does that mean I'd be better off using it in place of MimeMessage? If so, > why is the AddFooter mailet not using it? If not, what exactly is the > purpose of Mime4j? > > Thanks, > Israel > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
