2013/9/25 Justin Robinson <[email protected]>:
> [...]
> java.lang.ClassCastException: org.apache.james.mime4j.message.MultipartImpl
> cannot be cast to org.apache.james.mime4j.dom.SingleBody
> at org.apache.james.jdkim.impl.Message.getBodyInputStream(Message.java:80)
> at org.apache.james.jdkim.DKIMSigner.sign(DKIMSigner.java:85)

This may happen if mime4j is not correctly instantiated/invoked.
mime4j has to be instructed to do raw parsing (instead of the default
multipart parsing).

BTW I use DKIMSign mailet to sign millions messages. DKIMSign doesn't
use mime4j.
Maybe there is a bug in the mime4j parsing part.

Are you using mime4j-0.7 ?

http://svn.apache.org/viewvc/james/jdkim/tags/apache-jdkim-project-0.2/main/src/main/java/org/apache/james/jdkim/impl/Message.java?view=markup
MessageServiceFactory mbf = MessageServiceFactory.newInstance();
70 mbf.setAttribute("MimeEntityConfig", mec);
71 mbf.setAttribute("FlatMode", true);
72 mbf.setAttribute("ContentDecoding", false);

The FlatMode and ContentDecoding options are needed in order for mime4j to work.
If they are not used or mime4j doesn't get it then you get a
MultipartImpl object and jdkim doesn't work.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to