Using JavaMail to save emails in Outlook Message Format (*.msg)

Is there a way using the JavaMail API's to save emails as an *.msg? I'm able to connect to the Exchange server (IMAP) and see the messages and print out the subject, sender, attachment, etc. But is there a quick, easy API that will save everything in a *.msg format?
[275 byte] By [vannguyen0a] at [2007-9-30 23:34:16]
# 1
There isn't anything in the JavaMail API that converts a message to that format or to any other proprietary format. Somebody may have written such a thing, you could search the Internet to find out. Or you could get hold of Microsoft's specification for that format and write your own.
DrClapa at 2007-7-7 14:48:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

You probably won't find Microsoft's file format for MSG files. They keep this sort of thing under lock and key.

I have been searching for the past 12 months (on and off) for a java->msg->java solution but am yet to find one that isn't commercial.

JIntegra is a java -> exchange (commerial) library. They may have something, but it's not pure java (uses MS code under the covers via a COM bridge)

http://j-integra.intrinsyc.com/exchange/info/

MSG is an OLE2 Compound Document. The Jakarta POI project is intended to provide api's to this type of document, however they do not currently have any examples or working code (AFAIK) to do this for outlook files.

The only way I know to do this consistently is to use the MS MAPI APIs (C++) and wrap this in JNI. The resident guru of all things MAPI and Outlook is Dmitry Streblechenko. Have a look at his Outlook Redemption system at:

http://www.dimastr.com/redemption/

And.. if you do end up implementing a working solution.. you can send me a copy :)

jasonpolitesa at 2007-7-7 14:48:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Well... given all that, I would probably decide that I didn't really have that requirement after all.
DrClapa at 2007-7-7 14:48:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
I've tried looking at JIntegra. The only thing is that I need this java app to be running on an OS/400.JIntegra requires you to modify a computer (and by the looks of Outlook Redemption... it does also). I don't have access to a computer running Windows 2000/XP/Server that I can modify.
vannguyen0a at 2007-7-7 14:48:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
Perhaps you should have a look at the following perl script. Maybe it may help you. http://www.xs4all.nl/~mvz/software/msgconv/msgconvert.pl
toggma at 2007-7-7 14:48:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...