0

我有一个使用imaps:connector的Mule 2.2.1配置。但我无法处理带有附件的电子邮件。有什么经验吗?

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

或者,如果我删除 org.mule.transport.email.SimpleMailMessageAdapter ,则报告类型MimeBodyPart而不是MimeMessage 。

我试图尽可能地限制配置(没有出站,没有组件),但它没有帮助。

    <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>

    </model>

编辑

奇怪的!变形金刚没有帮助,因为它们甚至没有被调用。我写了一个自定义的,什么都不做,只是为了调试目的。如果将 Transformer 添加到入站,则调用 Transformer。它会导致跳过一个组件,即使是不存在的。

4

1 回答 1

0

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.

于 2010-11-10T15:14:59.007 回答