I'm using JavaMail API to read emails from Gmail IMAP. The emails are of type multipart. I open up a Store, then I open up a Folder ("INBOX"), then I get the messages from that folder.
Outside of Karaf, when doing message.getContent() I get a javax.mail.internet.MimeMultipart object back. Doesn't matter if I use version 1.4.5 (the one that Karaf provides) or 1.5.4 (the latest).
Inside Karaf, I get an IMAPInputStream back, which isn't ideal. I'd very much like to get the MimeMultipart object back. I've tried not adding any JavaMail libraries to Karaf, and relying on the one that Karaf itself provides (which is 1.4.5, according to the version matrix:
I've also tried adding both javax.mail/javax.mail-api/1.5.4 and com.sun.mail/javax.mail/1.5.4 to Karaf, but the same problem occurs. I guess it still chooses the JAR's that Karaf provides.
Even in the latest version of Karaf, 1.4.5 is used, so I'd guess the same problem exists there, but I cannot say for sure, I haven't tested.
Am I missing something, or is there some workaround for this?