title: Mule ESB: Retrieving email messages from Gmail using IMAP connector
body: <p>I am new to Mule and im trying to create a Mule configuration that pulls sent emails from a GMail account via imap and pushes them to a php script that processes and stores them in a custom CRM that i've built.
  For starters, i'm just trying to get the inbox emails dumped into a text files and i plan to work from there.</p>
  
  <p>As new messages are received by the mailbox, Mule should pick up the new messages and process them automatically.</p>
  
  <p>The Mule config looks like this so far:</p>
  
  <pre><code>&lt;imaps:connector name="IMAP" mailboxFolder="INBOX" validateConnections="false" doc:name="IMAP" /&gt;
  &lt;flow name="flows1Flow1" doc:name="flows1Flow1"&gt;
      &lt;imaps:inbound-endpoint host="imap.gmail.com" port="993" user="[[username]]%40gmail.com" password="[[password]]" connector-ref="IMAP" doc:name="IMAP"/&gt;
     &lt;file:outbound-endpoint path="D:\mailflow" outputPattern="msg_#[function:date].txt" doc:name="File"/&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p>The program runs and gets to this point:</p>
  
  <pre><code>    INFO  2012-01-12 13:51:06,606 [main] org.mule.DefaultMuleContext: 
      **********************************************************************
      * Application: mailflow                                     *
      * OS encoding: Cp1252, Mule encoding: UTF-8                          *
      *                                                                    *
      * Agents Running:                                                    *
      *   JMX Agent                                                        *
      **********************************************************************
      INFO  2012-01-12 13:51:06,606 [main] org.mule.module.launcher.DeploymentService: 
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      + Started app 'mailflow'                          +
      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  </code></pre>
  
  <p>And then just sits there indefinitely, doing nothing?!</p>
  
  <p>There is documentation suggesting that because i'm using IMAPS i need to add a TLS client and TLS key store to the imaps connector. I'm not sure what these are or how to use them though and the documentation is highly specialized and hard to understand.
  I'm also not sure that that's what the problem is in the first place as the app doesn't crash at any point.</p>
  
  <p>Has anyone had success creating an imap flow with GMail? 
  Please Help?!</p>