Hello,

if I use the mail-component for polling emails and there is an error while 
consuming the mail, how can I skip this mail and move to the next?

For example:
      
from("imaps://{{email.server}}?username={{email.username}}&password=RAW({{email.password}})"
         + "&delete=true&copyTo={{email.folder}}/done&unseen=true& 
folderName={{email.folder}}"
         + "&fetchSize=1&contentType=text/html")
moves the processed mail in the "done"-subfolder of the email-folder, if 
everything is ok, eg, the route finishes.

But if the mail-consumer hits an error _before_ the route starts, the error 
will be logged and nothing more happens. This means, the processed mail remains 
unchanged in in the email-folder and will be the next polled email, that leads 
to the same error, where the error will be logged and...

How can I break this endless circle an mark the email as (unsuccessfully) 
processed, so that it will not be read again?

Best regards, 
Stefan Hof

Reply via email to