Hi Stefano,
I was very happy to discover that you where signing millions of email's
initially, now I'm just confused. This is an uncaught exception, so I was
thinking maybe it was unnoticed or something.

I'm using apache-mime4j-0.7.2, apache-jdkim-0.2  lists this as a dependancy
in the maven pom.xml.

DKIMSign.pl is written in perl, if this is what you are referring to. I am
not a perl developer and can barely read perl. But I'm open to any solution
at this stage, I did see there is a test class
called org.apache.james.jdkim.PerlDKIMTest, how does perl relate to the
apache-jdkim project?

I've had a look at the causes for the ClassCastException, and it is not
easy to fix, due to inheritance issues. These two classes have
completely different abstract parent classes, they can only be referenced
by org.apache.james.mime4j.dom.Message because their concrete children
implement the interface.

Are you suggesting I revert to apache-mime4j-0.7 rather then
apache-mime4j-0.7.2?


On Wed, Sep 25, 2013 at 9:06 AM, Stefano Bagnara <apa...@bago.org> wrote:

> 2013/9/25 Justin Robinson <dkim-proj...@fluidnotions.com>:
> > [...]
> > 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: server-dev-unsubscr...@james.apache.org
> For additional commands, e-mail: server-dev-h...@james.apache.org
>
>

Reply via email to