Camel route to filter out the auto response emails

只谈情不闲聊 提交于 2020-01-03 00:53:34

问题


I am using camel rout to consume the emails from my inbox folder. But I want to filter out the auto responded emails like out of offices etc.

I see there is a option for to process only unread messages by using option unseen=true.

The URI that I am using to consume the emails looks like:

pop3://username@host?password=password;delete=true&unseen=true&consumer.delay=60000

回答1:


I think what you're looking for is the searchTerm property to add to your endpoint URI.

If you want to filter out e-mails with the term Out Of Office in them, your endpoint URI might look like this:

pop3://username@host.com?password=password;delete=true&searchTerm.subjectOrBody=Out+Of+Office&searchTerm.unseen=true

The searchTerm property lets you search on the basis of several other criteria as mentioned below:

  1. searchTerm.unseen - Whether to limit by unseen mails only
  2. searchTerm.subjectOrBody - To limit by subject or body to contain the word.
  3. searchTerm.subject - The subject must contain the word.
  4. searchTerm.body - The body must contain the word.
  5. searchTerm.from - The mail must be from a given email pattern.
  6. searchTerm.to - The mail must be to a given email pattern.
  7. searchTerm.fromSentDate/toSentDate - Filters on sent date

Further documentation can be found here - http://camel.apache.org/mail.html



来源:https://stackoverflow.com/questions/25566011/camel-route-to-filter-out-the-auto-response-emails

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!