Unfortunately it is not sufficient to provide own SearchTerm class and overriding "match" because com.sun.mail.imap.protocol.SearchSequence checks specific implementations of SearchTerm provided by com.sun.mail and all implementations are final. I worked around the issue by resetting the searchTerm in Camel MailEndpoint everytime I want to update the criteria. This works as MailConsumer retrieves the searchTerm from the endpoint on each poll.
2016-10-06 13:21 GMT+02:00 Claus Ibsen <claus.ib...@gmail.com>: > I think you just need to keep state yourself in the bean, and then the > mail component will call the match method to see if a mail messages > matches or not. > > Then your state can then update with new sent date information so the > matches method can use a newer date. > > On Thu, Oct 6, 2016 at 2:43 AM, Michael Täschner <m.taesch...@gmail.com> > wrote: > > Hi Again, > > > > is there a possibility that the searchTerm bean reference picked up by > > camel-mail can update it's internal state to allow for a changing > sentDate > > for the query? > > > > Thanks and Best Regards, > > Michael > > > > 2016-09-23 16:21 GMT+02:00 Michael Täschner <m.taesch...@gmail.com>: > > > >> Hi Camel-Riders, > >> > >> is there a possibility to consume mails with modifiable > >> searchTerm.fromSentDate value? I am looking at a solution where the > >> consumer must not depend on "unseen" flag, manages an internal dateTime > >> variable to pick-up mail search from where it last stopped? There may > be > >> other clients on the mail account and I cannot depend on the "unseen" > flag. > >> Is this a case for poll-enrich or how can I manipulate the from query to > >> use the variable "searchTerm.fromSentDate"? > >> > >> Thanks and Best Regards, > >> Michael > >> > > > > -- > Claus Ibsen > ----------------- > http://davsclaus.com @davsclaus > Camel in Action 2: https://www.manning.com/ibsen2 >