Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 507CF10330 for ; Tue, 8 Apr 2014 08:58:29 +0000 (UTC) Received: (qmail 75235 invoked by uid 500); 8 Apr 2014 08:58:28 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 74819 invoked by uid 500); 8 Apr 2014 08:58:27 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 74810 invoked by uid 99); 8 Apr 2014 08:58:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2014 08:58:26 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.223.180 as permitted sender) Received: from [209.85.223.180] (HELO mail-ie0-f180.google.com) (209.85.223.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2014 08:58:22 +0000 Received: by mail-ie0-f180.google.com with SMTP id as1so573515iec.25 for ; Tue, 08 Apr 2014 01:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=EqTQ3da+lWe2TX5mFgFOB5hoCFB7r/X1Db5GwSNIR/o=; b=RFr8RPacbGK2wG8DGsiI6y6NC8I0JpcHWBzN6l2aaegFXvHWlWkEV3HfCnyBZn2vrb qp6YQ9/nHE2V9Xo3Nvn0E1OGCf5WT3ThfMPE8T8Bxgmwuto7tmnOw4fe6YHWO8phBJ8s v700KL9J7jS0ep0398zMRB51Ie0jmzFVweqB4gfeKlTYtABXddcq3DT8y74IHj3R+IqE bfESsuaig+/u9BygerGEaoEW0OPw+sOD+6GlB39Hq/fKrIsdhsqcqPrdoliJUQAM3Z+X 8JAXICnrLEj2yb5AZxfB6KTP5GqKkw8nlZ8PTIEDOtFDYgC1jJeq2cgs46At0IwLWAe9 yocw== X-Received: by 10.50.122.9 with SMTP id lo9mr2882455igb.27.1396947482357; Tue, 08 Apr 2014 01:58:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.147.69 with HTTP; Tue, 8 Apr 2014 01:57:42 -0700 (PDT) In-Reply-To: <241616E998699141B69B9BF77D41B53203A154AF0546@ZV-SRV-EX02.zentrale.zv.fhg.de> References: <241616E998699141B69B9BF77D41B53203A154AF0546@ZV-SRV-EX02.zentrale.zv.fhg.de> From: Claus Ibsen Date: Tue, 8 Apr 2014 10:57:42 +0200 Message-ID: Subject: Re: error blocking camel-mail consumer To: "users@camel.apache.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi You can try with mapMailMessage=3Dfalse, and then use Camel's error handler if parsing the body / attachments of the mail fails. Though there was a bug in Camel when using mapMailMessage=3Dfalse. You may need to use next release of Camel and/or latest release if the bug was fixed in that release. An alternative is to add functionality to the mail component to deal with parsing errors before routing, such as mark it as seen or move it etc. On Mon, Apr 7, 2014 at 5:27 PM, wrote= : > Hello, > > if I use the mail-component for polling emails and there is an error whil= e consuming the mail, how can I skip this mail and move to the next? > > For example: > from("imaps://{{email.server}}?username=3D{{email.username}}&passwo= rd=3DRAW({{email.password}})" > + "&delete=3Dtrue©To=3D{{email.folder}}/done&unseen=3Dtrue& = folderName=3D{{email.folder}}" > + "&fetchSize=3D1&contentType=3Dtext/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 err= or 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 > --=20 Claus Ibsen ----------------- Red Hat, Inc. Email: cibsen@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io