ClassCastException when storing multipart message without Msg ID
----------------------------------------------------------------
Key: JAMES-447
URL: http://issues.apache.org/jira/browse/JAMES-447
Project: James
Type: Bug
Components: MailStore & MailRepository
Versions: 2.3.0a1
Reporter: Bernd Fondermann
This problem occurs with James HEAD, but not with James 2.2.0
When sending a multipart message which has no Message-ID header field to an
internal user, the following exception is raised:
javax.mail.MessagingException: Exception caught while storing Message
Container: javax.mail.MessagingException: MIME part of type "multipart/mixed;
boundary="bmQykoPt9wvlXeBFetOZnNCi/trubV+f25KeVm5YJYo="" contains object of
type com.sun.mail.util.SharedByteArrayInputStream instead of MimeMultipart
at
org.apache.james.mailrepository.AvalonMailRepository.store(AvalonMailRepository.java:329)
at
org.apache.james.transport.mailets.ToMultiRepository.storeMail(ToMultiRepository.java:226)
at
org.apache.james.transport.mailets.ToMultiRepository.service(ToMultiRepository.java:151)
at
org.apache.james.transport.mailets.LocalDelivery.service(LocalDelivery.java:64)
at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:414)
at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:397)
at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:306)
at java.lang.Thread.run(Thread.java:534)
the exception is thrown within JavaMail, the last related James call is in line
67 of MimeMessageUtil:
public static void writeTo(MimeMessage message, OutputStream headerOs,
OutputStream bodyOs, String[] ignoreList) throws IOException,
MessagingException {
if (message instanceof MimeMessageCopyOnWriteProxy) {
MimeMessageCopyOnWriteProxy wr = (MimeMessageCopyOnWriteProxy)
message;
MimeMessage m = wr.getWrappedMessage();
if (m instanceof MimeMessageWrapper) {
MimeMessageWrapper wrapper = (MimeMessageWrapper)m;
wrapper.writeTo(headerOs, bodyOs, ignoreList);
return;
}
} else if (message instanceof MimeMessageWrapper) {
MimeMessageWrapper wrapper = (MimeMessageWrapper)message;
wrapper.writeTo(headerOs, bodyOs, ignoreList);
return;
}
if(message.getMessageID() == null) {
message.saveChanges(); //// <====== exception thrown from here
}
the exception is going away if at least one of the following is done:
+ a message id header field is added when sending the message
+ the receiver is not a James internal account
+ the message mime type is changed from "multipart" to something else
+ James 2.2.0 is being used.
I did the first one for the stress test tool, but wonder if a Message-ID is
mandatory.
I debugged this problem but did not find neither a fix nor the critical change
from 2.2.0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]