I would like to avoid spam when reading from a imap endpoint using Apache Camel.
My endpoint is configured in this way:
def camelContext = new DefaultCamelContext()
camelContext.addRoutes(new RouteBuilder() {
def void configure() {
from("imap://localhost:3143?username=myuserame&password=mypassword"
+ "&delete=false"
+ "&unseen=true"
+ "&consumer.delay=600"
+ "&fetchSize=10"
+ "&maxMessagesPerPoll=10").process{ exchange ->
...
}
I would like to add searchTerm
in order to avoid messages marked with *****SPAM****
in the subject or having the headers X-Spam-Flag: YES
or X-Spam-Status: YES
.
I would also like to blacklist some email addresses but I guess this can do this after having read the mail.