Re: [exim] "mail to" for rewriting a body ?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: TN
CC: exim-users
Subject: Re: [exim] "mail to" for rewriting a body ?
On Wed, 25 May 2005, TN wrote:

> I'm trying to write a filter which will intercept email, and stop
> delivery of the original email and replace it with another email going
> to the intended recipient.
>
>
> I have this
>
> # Exim filter
>
> if $header_from: contains "someone@???"
> then
> mail to $header_to from $header_from subject $header_subject
> text "This email was intercepted"
> endif


Change the "mail" line to

seen mail to $header_to from $header_from subject $header_subject

> My problem is that this delivers both the original email plus my "mail
> to" email, whereas I only want my rewritten email to be sent. I have
> tried preceding 'mail' with 'seen', but this kills both the original
> email and my reply, since the reply is going to the intended recipient
> and exim is discarding this because of the 'seen' command.


Ah yes, it would, wouldn't it, because it matches the conditions! Why
don't you try

  if $header_from: contains "someone@???" and
    $message_body is not "This email was intercepted" 


so that you don't pick up the new message.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book