camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to avoid sending message headers with mail component ?
Date Thu, 03 Jan 2013 08:28:24 GMT
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 <claus.ibsen@gmail.com> wrote:
> On Tue, Jan 1, 2013 at 11:55 AM, JackMigger <j.dorfschmid@web.de> 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

Mime
View raw message