Thanks Stan. This works. I want to know the callbacks that should be overridden in order to 1) Populate the messages from another application just once and 2) save the message into another application whenever a message(other than the ones that were pre-populated) is dropped into a folder.
Regards ------------------------------------ Jentu Jain | Datacert, Inc. Why are major companies rapidly migrating to Passport? Find Out Here -----Original Message----- From: Ioan Eugen Stan [mailto:[email protected]] Sent: Thursday, February 23, 2012 2:29 PM To: [email protected] Subject: Re: Persist IMAP messages Pe 23.02.2012 09:00, Jentu Jain a scris: > Hi, > I want to persist the emails that are moved to IMAP mailbox to another > application's database as a file. What should be the format of the file that > would hold the message so that it can be saved/retrieved to/from the > application? > > Regards > ------------------------------------ > Jentu Jain | Datacert, Inc. > > Why are major companies rapidly migrating to Passport? Find Out > Here<http://www.datacert.com/> > [Description: > cid:[email protected]]<http://www.datacert.com/feed.xml>[ > Description: > cid:[email protected]]<http://twitter.com/datacert> > > Hi Jentu, I think the best way to save the message is in it' original form, as a standard Internet message format (http://tools.ietf.org/html/rfc2822). You can get the original stream of bytes (Message object has a getContent method and getBody() that provide InputStream's) and you can persist them. You can then use mime4j to parse the message and get the parts that you wish. Either dynamic, on request, or save offsets for each part of the message (the message does not change). Depends on your needs but the first should be all you need. Cheers, -- Ioan Eugen Stan http://ieugen.blogspot.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
