cancel
Showing results for 
Search instead for 
Did you mean: 

Error with inbound mailserver: ClassCastException

binary-two
Champ in-the-making
Champ in-the-making
Hello Alfresco forum members!

When I try to submit e-mails with attachments using the internal smtp-server, I get following error message (i.e. Java ClassCastException) on the server side:


17:27:32,222 ERROR [org.alfresco.email.server.impl.subetha.SubethaEmailServer] javax.mail.internet.MimeMultipart cannot be cast to javax.mail.Multipart
java.lang.ClassCastException: javax.mail.internet.MimeMultipart cannot be cast to javax.mail.Multipart
        at org.alfresco.email.server.impl.subetha.SubethaEmailMessage.parseMessagePart(SubethaEmailMessage.java:226)
        at org.alfresco.email.server.impl.subetha.SubethaEmailMessage.processMimeMessage(SubethaEmailMessage.java:180)
        at org.alfresco.email.server.impl.subetha.SubethaEmailMessage.<init>(SubethaEmailMessage.java:113)
        at org.alfresco.email.server.impl.subetha.SubethaEmailServer$Handler.processDelivery(SubethaEmailServer.java:176)
        at org.alfresco.email.server.impl.subetha.SubethaEmailServer$Handler.data(SubethaEmailServer.java:132)
        at org.subethamail.smtp.command.DataCommand.execute(DataCommand.java:57)
        at org.subethamail.smtp.server.RequireTLSCommandWrapper.execute(RequireTLSCommandWrapper.java:27)
        at org.subethamail.smtp.server.CommandHandler.handleCommand(CommandHandler.java:78)
        at org.subethamail.smtp.server.Session.run(Session.java:144)

I am using Alfresco 3.2 C. I tried to update the subethamail lib with no change.

On the client side:


SMTP< 554 An internal error prevented mail delivery.
SMTP error: 554 An internal error prevented mail delivery.
SMTP listener refused delivery

E-mails are lost.

I was not able to find the above error message reported before. E-mails with no attachments get processed perfectly fine.

Any help or suggestions to be able to get e-mails with attachments working would be highly appreciated.

Thanks heaps in advance!

Kind regards,

Björn
4 REPLIES 4

binary-two
Champ in-the-making
Champ in-the-making
Hello Alfresco forum members,

has no one experienced the same issues? Any help would be highly appreciated. Has anyone the inbound e-mail server working for e-mails with attachments?

Kind regards,

Björn

xkahn
Champ in-the-making
Champ in-the-making
I'm seeing the exact same error message.  Reading the documentation ( http://java.sun.com/javaee/5/docs/api/javax/mail/internet/MimeMultipart.html )for javax.mail.internet.MimeMultipart, it looks like its parent is:

java.lang.Object
  extended by javax.mail.Multipart
      extended by javax.mail.internet.MimeMultipart

AFAIK, you should be able to cast javax.mail.internet.MimeMultipart to javax.mail.Multipart since there is a parent/child relationship.  The code causing the error seems to back this up:

            else if (messagePart.isMimeType(MIME_MULTIPART))
            {
                // if multipart, this method will be called recursively
                // for each of its parts
                Multipart mp = (Multipart) messagePart.getContent();

Unless I'm reading something wrong.  Maybe this is a bug in the version of Java?

I have:

# java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

xkahn
Champ in-the-making
Champ in-the-making
Filed as a bug until I can figure out otherwise: https://issues.alfresco.com/jira/browse/ALFCOM-3813

xkahn
Champ in-the-making
Champ in-the-making
Filed as a bug until I can figure out otherwise: https://issues.alfresco.com/jira/browse/ALFCOM-3813

Solution (on Red Hat Enterprise Linux 5):

mkdir -p WEB-INF/lib 
cp /usr/share/java/classpathx-mail/mail-1.3.1-providers.jar /usr/share/java/classpathx-mail/mail-1.3.1-api.jar WEB-INF/lib
zip -d WEB-INF/lib/mail.jar
zip -u alfresco.war WEB-INF/lib/*
rm -rf WEB-INF/lib

In other words, mail.jar is bad, mail-1.3.1-api.jar and mail-1.3.1-providers.jar are missing and need to be added.

This also fixes outgoing mail.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.