Emails with Attachments Cause an Error in Mule
I have a working Mule 2.2.1 configuration with the imaps:connector. But I am not able to proceed emails with attachments. Any experience?
org.mule.api.service.ServiceException: Cannot route event as component "imap" is stopped. Component that caused exception is: SedaService{imap}. Message payload is of type: MimeMessage
Or alternatively type MimeBodyPart is reported instead of MimeMessage if I remove org.mule.transport.email.SimpleMailMessageAdapter.
I tried to restrict configuration as much as possible (no outbouds, no components), but it does not help.
<imaps:connector name="imapConnector" checkFrequency="${imap.checkFrequency}" deleteReadMessages="${imap.deleteReadMessages}" >
<imaps:tls-client path="${keystore}" storePassword="${keystore.password}" />
<imaps:tls-trust-store path="${keystore}" storePassword="${keystore.password}" />
</imaps:connector>
<model>
<service name="imap">
<inbound>
<imaps:inbound-endpoint host="${imap.host}"
port="${imap.port}" user="${imap.user}"
password="${imap.password}" connector-ref="imapConnector">
</imaps:inbound-endpoint>
</inbound>
</service>
开发者_StackOverflow中文版 </model>
Edit
Strange! Transformers do not help because they are not even called. I wrote a custom one doing nothing, just for debugging purpose. Transformer is called if is added to inbound. It causes skipping a component, even non existing.
I could not identify the problem because of FunctionalTestCase. Mule behaves differently there. The server throws understandable exception.
java.lang.ClassCastException: javax.mail.internet.MimeMultipart cannot be cast to java.lang.String
at org.mule.transport.email.transformers.EmailMessageToString.doTransform(EmailMessageToString.java:57)
The default e-mail transformer EmailMessageToString does not expect that MimeMultipart may contain another MimeMultipart, not only string.
精彩评论