Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Problem with accessing an .eml-File via JavaMail

Hi!

I' m facing a problem with accessing the message-body of a .eml-file which I' m reading as a FileInputStream:

<code>
Message message = new MimeMessage(null, new FileInputStream("email.eml"));
</code>

I can perfectly loop over the Header-Enumeration read with

<code>
message.getAllHeaders()
</code>

but if I' m trying to access the Messages body via

<code>
Object o = message.getContent()
</code>

the returned Object is neither of type Multipart nor Part, but an instance of com.sun.mail.util.QPDecoderStream.

The mail was digitally signed (Content-Type "smime.p7m"), so that' s probably the reason this behaviour.

Could anybody tell me how I get access to the Mail-Body and -Attachments (Multipart Mime) and - if possible - how I can transform the Message into an SMime-type which I then could extract the Signature from.

Regards,
Thomas
[1015 byte] By [wuercher] at [2007-11-11 7:51:16]