camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mezai 279 <mezai....@gmail.com>
Subject Re: camel-imap
Date Wed, 04 Feb 2015 04:53:18 GMT
Thanks a ton!! this worked for me...
I have done some thing like below:

              <route streamCache=*"true"*>

                     <from uri=
*"imaps://{{mailScanner.imap.host}}:{{mailScanner.imap.port}}?username={{mailScanner.email}}&amp;password={{mailScanner.email.password}}&amp;delete=true&amp;unseen=true&amp;closeFolder=false&amp;disconnect=false&amp;consumer.delay=60000&amp;copyTo=folder1"*
/>

                     <log message=*"Email Read from mailbox.
${in.header.copyTo}, ${out.header.copyTo}, ${header.copyTo},
${property.copyTo}"*/>

                     <process ref=*"folderNameProcesor"*/>

                     <log message=*"##header.copyTo = ${header.copyTo},
${property.copyTo}"*/>

              </route>



My processor in the route *folderNameProcesor,*has a static variable and
every time processor is called it sets folder(n+1) in the copyTo header.

This did not work for me in the route (check header value and setting new
value based on current header value) as the header gets reset every time
inbox is polled.

-Regards
Sasi

On Tue, Feb 3, 2015 at 7:57 PM, Bart Horré <bart@anova.be> wrote:

> If I read the docs of copyTo correctly you should be able to change to add
> a header with the copyTo value at runtime.
>
> *Camel 2.10:* Consumer only. After processing a mail message, it can be
> copied to a mail folder with the given name. You can override this
> configuration value, with a header with the key copyTo, allowing you to
> copy messages to folder names configured at runtime.
>
> Is that an option?
>
>
> Bart Horré
> Anova r&d bvba
>
> On Tue, Feb 3, 2015 at 3:02 PM, Mezai 279 <mezai.279@gmail.com> wrote:
>
> > Thanks Bart Horre!
> > Here i want to change a particular attribute in the <from it self
> >
> > <from uri="imaps://{{mailScanner.
> >
> >
> imap.host}}:{{mailScanner.imap.port}}?username={{mailScanner.email}}&amp;password={{mailScanner.email.password}}&amp;delete=true&amp;unseen=true&amp;closeFolder=false&amp;disconnect=false&amp;consumer.delay=60000&amp;copyTo=
> > *folder2*"/>
> >
> > copyTo should be changed dynamically each time it is polling the mail
> > server.
> >
> > I believe recipient list will not be helpful here.
> >
> >
> >
> >
> > -Thanks
> > Sasi
> >
> >
> > On Tue, Feb 3, 2015 at 7:10 PM, Bart Horré <bart@anova.be> wrote:
> >
> > > Hi,
> > >
> > > you could use a recipient list to dynamically identify the endpoint.
> > >
> > > http://camel.apache.org/recipient-list.html
> > >
> > > Bart Horré
> > > Anova r&d bvba
> > >
> > > On Tue, Feb 3, 2015 at 10:39 AM, Mezai 279 <mezai.279@gmail.com>
> wrote:
> > >
> > > > I m planning to write a route which will have to move messages from
> > inbox
> > > > to four different folders folder1, folder2, folder3, folder4 every 5
> > > > minutes. How can i do this?
> > > >
> > > > <from
> > > >
> > > >
> > >
> >
> uri="imaps://{{mailScanner.imap.host}}:{{mailScanner.imap.port}}?username={{mailScanner.email}}&amp;password={{mailScanner.email.password}}&amp;delete=true&amp;unseen=true&amp;closeFolder=false&amp;disconnect=false&amp;consumer.delay=60000&amp;copyTo=
> > > > *folder2*"/>
> > > >
> > > > I need to dynamically change folder2 to folder1, folder4 every 5
> > miutes.
> > > >
> > > > -Thanks
> > > > Sasi
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message