Processing MS Outlook .msg files

1
Hi All, We have a requirement to process and parse .msg files in a consistent html format to display in a Mendix application. I have looked at the Apache Tika library and it provides exactly what I need.  However my application is already relying on bouncy castle libraries and because BC is also packaged in the tika-app jar it causes a security exception that the tika-app jar is not signed. Self-signing the jar also does not work. I am looking for any ideas or suggestions to resolve the tika library security issue or any alternatives. I also have access to the raw RTF email body.   com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.box.sdk.BoxAPIException: Error parsing PKCS private key for Box Developer Edition.     at com.mendix.basis.component.InternalCore.execute(InternalCore.java:535)   Caused by: org.bouncycastle.operator.OperatorCreationException: 1.2.840.113549.1.5.13 not available: JCE cannot authenticate the provider BC     at org.bouncycastle.openssl.jcajce.JceOpenSSLPKCS8DecryptorProviderBuilder$1.get(Unknown Source)     at org.bouncycastle.pkcs.PKCS8EncryptedPrivateKeyInfo.decryptPrivateKeyInfo(Unknown Source)     at com.box.sdk.BoxDeveloperEditionAPIConnection.decryptPrivateKey(BoxDeveloperEditionAPIConnection.java:459)     at com.box.sdk.BoxDeveloperEditionAPIConnection.constructJWTAssertion(BoxDeveloperEditionAPIConnection.java:405)   Caused by: java.util.jar.JarException: file:/C:/Users/*********/Documents/Mendix/**********/deployment/model/lib/userlib/tika-app-1.17.jar is not signed by a trusted signer.     at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:505)     at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:325)     at javax.crypto.JarVerifier.verify(JarVerifier.java:253)     at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:159)     at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:1   Thanks
asked
1 answers
2

Schalk,

An alternative might be found here:

https://www.flowfabric.com/blog/mendix-insights/

[update 12-02-2018]

Another alternative might be found on: http://auxilii.com/msgparser/Page.php?id=100

This has an option to convert the body to html like the example below:

import java.io.IOException;

import com.auxilii.msgparser.Message;
import com.auxilii.msgparser.MsgParser;


public class ParseMsg {

	public static void main(String[] args) throws UnsupportedOperationException, IOException {
		MsgParser msgp = new MsgParser();
		Message msg = msgp.parseMsg("mail.msg");
		System.out.println(msg.getConvertedBodyHTML());
	}

}

Did some tests with a couple of mails. The outcome is quite good for simple mails. More complex mails with images and tables etc. do not return correctly as html. But it depends on your needs, so this might be a valid option. It uses POI under the hood.

answered