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 E9D9A9DE2 for ; Thu, 3 Jan 2013 08:29:20 +0000 (UTC) Received: (qmail 55529 invoked by uid 500); 3 Jan 2013 08:29:20 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 55487 invoked by uid 500); 3 Jan 2013 08:29:19 -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 55453 invoked by uid 99); 3 Jan 2013 08:29:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 08:29:19 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.215.46 as permitted sender) Received: from [209.85.215.46] (HELO mail-la0-f46.google.com) (209.85.215.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 08:29:05 +0000 Received: by mail-la0-f46.google.com with SMTP id fq13so7492908lab.33 for ; Thu, 03 Jan 2013 00:28:44 -0800 (PST) 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; bh=v1s+XPVt07xUypaIKZwJRVzJsajimGUc7YoVgUy/jwo=; b=sOCSGcr1QEljYjKiLiARvWBg83MFW7eSl2nbNBH94SFtjkRTMgOam97JMm9L/bKbY0 zRwv7GzvBPNEJYmr+JJ+OzzChZ2EL8fvKbUaILmDhU4sq3/y/fVadDEsjrS+nBBWqoNv su7fX9MMYbrbo/Kb8IaQg/ZF+u+sc5eI5Jj6NEtN0dGbP2IgPMLcUFtR9zcKJFUqfw9h Mreg+Ug2aGtF2P111GEKmJ2XpG0JOUSVPc1SL4as2caVxL0iyDmbokNBdRXvv8KaAEes zxix23kUsBwG3H3+HNPcg/+fcin85mQfQr0w5ysoNH20N5VvkVPDhi1jJX4byrhsThUR WvKg== Received: by 10.152.144.164 with SMTP id sn4mr45966027lab.57.1357201724288; Thu, 03 Jan 2013 00:28:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.103.129 with HTTP; Thu, 3 Jan 2013 00:28:24 -0800 (PST) In-Reply-To: References: <1356807722917-5724719.post@n5.nabble.com> <1357037727689-5724752.post@n5.nabble.com> From: Claus Ibsen Date: Thu, 3 Jan 2013 09:28:24 +0100 Message-ID: Subject: Re: How to avoid sending message headers with mail component ? To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Oh another approach could be to use a custom header filter strategy on the mail component / endpoint. That will filter out all the headers, then only the body is being sent. On Thu, Jan 3, 2013 at 9:27 AM, Claus Ibsen wrote: > On Tue, Jan 1, 2013 at 11:55 AM, JackMigger wrote: >> Happy new year and thanks for the quick reply ! >> >> But what happens in a (simplified) case like this: >> >> from("ibatis:selectUnprocessedAccounts?consumer.onConsume=consumeAccount") >> // returns a list of beans with partly private information >> >> .split( ... ) >> .removeHeaders("*") >> // set the message body from bean.text >> ... >> // set the headers to, cc, bcc from bean.email, bean.cc, etc... >> ... >> .to("smtp://...) >> >> // bcc header is also sent in the mail (?) >> >> // message/bean is now consumed, but any reference to the sql >> consumeAccount statement (e.g. #id#) >> // has gone >> .to("mock:results"); >> >> As far as I understand, I have to filter out all but the further needed >> headers (as "id"). >> Might there be a way to keep all camel message headers but configure that >> *only the body* is mailed ? > > You can use the wire tap to spawn off a new message (sending a new exchange) > where you only copy the body. > > See details at: > http://camel.apache.org/wire-tap.html > > Something like > .wireTap("smtp:...", false, simple("${body}")) > > > >> (I'm aware that I could always write my own processor) >> >> >> >> >> >> -- >> View this message in context: http://camel.465427.n5.nabble.com/How-to-avoid-sending-message-headers-with-mail-component-tp5724719p5724752.html >> Sent from the Camel - Users mailing list archive at Nabble.com. > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > FuseSource is now part of Red Hat > Email: cibsen@redhat.com > Web: http://fusesource.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cibsen@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen