I have an incoming MimeMessage
in my JAMES mail server. I want to create an eml file dumping the message completely. I tried using the writeTo
method of MimeMessage - resulting file contains only the text body of the email. The attachments are not written to the eml file. My code is something like
String logFileName = "dumpNow.eml";
incomingEmail.getMessage().writeTo(new FileOutputStream(new File(logFileName)));
I do not get any multipart content in the dump. Is there any Util available to do this? Apache Mimeutils is also giving the same result.