Hello All,

To fix my issue I am using Message Filter. I have already implemented
filter. I read every mail has unique Message-Id in header so When polling
to mailbox starts I'm keeping Message-Id of first read message. And then
comparing it with other message Ids if match is success then I'm stopping
the Context. So far it worked fine. Please share any idea or let me know if
I'm doing it in wrong way.

Thank you
Ketan
On Oct 5, 2012 11:11 PM, "Ketan Barapatre" <ketanbarapa...@gmail.com> wrote:

>
> Hello All,
>
> I am reading mail using Mail Component http://camel.apache.org/mail.html
>
> I have created following Route
>
> from("imaps://imap.gmail.com?username=" + user.getUserName() +
> "&password=" + user.getPassword()
>                 +
> "&unseen=false&fetchSize=10&consumer.delay=100").filter(messageFilter).process(mailProcessor);
>
> Now, I am expecting to get all read and unread mails from INBOX
> folder. When I run my app I am able to get all read and unread mail from
> INBOX but
> Mail reading starts from very first mail(from INBOX) and when last
> mail(latest mail from INBOX) is fetch it again starts reading mail from
> first mail(from INBOX) but I am expecting it should stop after reading last
> mail (which is latest mail) from INBOX. So I found that Polling to INBOX
> start again it goes in loop.
>
> Please suggest me How can I stop looping when mail reading is done.
> Or is there any way I can poll my mail box to get mail only from specified
> start date upto specified end date or
>
> Please correct me if i'm not clear with question or suggest me How can do
> this.
>
> Thank You
> Ketan
>
>
>

Reply via email to