Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to parse inbound e-mail when using Mule's IMAP transport?
    primarykey
    data
    text
    <p>I am just starting to learn mule so please forgive me if this is a very basic question.</p> <p>I have successfully configured mule to monitor my mail box so whenever a mail comes in I write the mail to text file (just for testing).</p> <p>Now I need to parse this mail and get the message / From / To from the mail.</p> <pre><code>&lt;flow name="testFlow" doc:name="testFlow"&gt; &lt;imap:inbound-endpoint host="ip" port="143" user="username" password="pwd" doc:name="IMAP" responseTimeout="10000" transformer-refs="Message_Properties"&gt; &lt;/imap:inbound-endpoint&gt; &lt;file:outbound-endpoint path="C:\" outputPattern="#[function:datestamp].dat" doc:name="File"&gt; &lt;/file:outbound-endpoint&gt; &lt;/flow&gt; </code></pre> <p>I thought I would be able to get the header information using the below expression (using expression transformer) </p> <pre><code>#[inboundProperties['email-header-name']] </code></pre> <p>but this doesn't seem to work. I also tried the below expressions but didn't work,</p> <pre><code>#[map-payload:HOST] #[map-payload:MESSAGE] #[map-payload:TIMESTAMP] </code></pre> <p>Can someone help? Also does anyone know if there is a document with the list of available expressions?</p> <p>EDIT:</p> <p>I included the logger to view the properties and it displayed all the properties but I couldnt find the body.. Also, I tried getting the fromAddress using </p> <pre><code>#[map-payload:fromAddress] and #[inboundProperties['fromAddress']] </code></pre> <p>but didn't work, can someone let me know where I am wrong? </p> <p>The properties are something like below,</p> <pre><code>inbound.fromAddress=Service &lt;service@xx.com&gt; inbound.subject=Test Final inbound.toAddresses=Service </code></pre> <p>Edit 2:</p> <p>This is what I have tried but doesnt work :(</p> <p>I am trying to retrieve the email subject and write to file or just show it using logger based on email subject but I am getting the below error. </p> <pre><code>ERROR 2013-02-07 19:22:45,275 [[test].connector.file.mule.default.dispatcher.01] org.mule.exception.DefaultMessagingExceptionStrategy: ******************************************************************************** Message : Could not find a transformer to transform "SimpleDataType{type=javax.mail.internet.MimeMessage, mimeType='*/*'}" to "SimpleDataType{type=java.io.InputStream, mimeType='*/*'}". Code : MULE_ERROR-236 </code></pre> <p>Can you let me know where I am making mistake?</p> <pre><code>&lt;flow name="testFlow1" doc:name="testFlow1"&gt; &lt;imap:inbound-endpoint host="ip" port="143" user="uname" password="pwd" doc:name="IMAP" responseTimeout="10000" disableTransportTransformer="true"&gt; &lt;/imap:inbound-endpoint&gt; &lt;logger message="#[message.inboundProperties['inbound.fromAddress']]" level="INFO" doc:name="Logger"/&gt; &lt;choice doc:name="Choice"&gt; &lt;when expression="message.inboundProperties['inbound.subject']=='plain test'"&gt; &lt;processor-chain&gt; &lt;logger message="#[message.inboundProperties['inbound.fromAddress']]" level="INFO" doc:name="Logger"/&gt; &lt;/processor-chain&gt; &lt;/when&gt; &lt;otherwise&gt; &lt;processor-chain&gt; &lt;file:outbound-endpoint path="C:\mule" outputPattern="#[function:datestamp].dat" responseTimeout="10000" disableTransportTransformer="true" doc:name="File"&gt; &lt;/file:outbound-endpoint&gt; &lt;/processor-chain&gt; &lt;/otherwise&gt; &lt;/choice&gt; &lt;/flow&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload