Mule - Receive email not working

2019-08-30 09:51发布

问题:

I know this question has been raised before, but I couldn't really find solution to this issue till now.

I am trying to get messages from outlook exchange for parsing.

I have a very simple flow to get the mails from outlook and it seems to work partially (It authenticates properly, and also checks all the necessary folders but it doesn't retrieve the mail from IMAP server).

This is the flow I am using...

 <imap:connector name="imapConnector" checkFrequency="500" 
        backupEnabled="true" backupFolder="inbox.backup"
        mailboxFolder="INBOX" moveToFolder="processed" deleteReadMessages="false" 
        defaultProcessMessageAction="SEEN" />
    <flow name="testFlow" doc:name="testFlow">
        <imap:inbound-endpoint host="ip"
            port="143" user="username" password="pwd" doc:name="IMAP" />
        <file:outbound-endpoint path="C:\"
            responseTimeout="1000" doc:name="File" />
    </flow>

The app seems to run without any errors, but its not retrieving any emails instead just sits there forever as below... Can someone help me?

**********************************************************************
* Application: test                                                  *
* OS encoding: Cp1252, Mule encoding: UTF-8                          *
*                                                                    *
* Agents Running:                                                    *
*   JMX Agent                                                        *
**********************************************************************
INFO  2013-02-06 18:26:45,814 [main] org.mule.module.launcher.DeploymentService: 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'test'                                       +

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

回答1:

There seem to be quite some literature around connecting to MS Exchange with JavaMail, which is what Mule uses behind the scene. Read for example:

  • http://kenai.com/projects/javamail/pages/Exchange
  • http://www.oracle.com/technetwork/java/faq-135477.html#Exchange-login
  • Java Mail API Cannot Read Inbox

So be sure your username is correctly formatted and also maybe use "Inbox" instead of "INBOX" (not sure it helps, but in examples, people do that).



回答2:

I had the same issue. Try this:

  1. stop mule
  2. delete or move all messages from the folder mule is listening on (in your case INBOX)
  3. restart mule
  4. send a new message to where mule is listening to