Re: [Exim] filter for comparing $h_From:

Top Page
Delete this message
Reply to this message
Author: hank
Date:  
To: exim-users
Subject: Re: [Exim] filter for comparing $h_From:
On Fri, Mar 12, 2004 at 04:00:33PM -0500, hank@??? wrote:
> Quick question. I have a router that performs the function of a
> filter; the "data" of which is below:
>
>         data = # Exim filter\n \
>           if \
>             ${quote:$h_From:} matches "(staff|support|admin|abuse)@$domain" \
>           then \
>             logfile LOG_PATH/malware \
>             logwrite ${quote:$tod_log $message_id malware_bagle: $h_From:} \
>             save /dev/null \
>           endif

>
> For From: header addresses that contain a '$' character, I get this
> error:
>
>     R=malware_bagle defer (-17): error in filter data: failed
>     to expand "CarInfo <$Help@???>" in filter file:
>     unknown variable name "Help"

>
> Should I use ${rxquote:} instead to avoid the expansion of "variables"
> that are inserted into the body of a message by a connecting MTA?



As followup to my own post, I believe I have solved the problem. I
have found that the following data excerpt is required in order to
handle the " and $ characters in the body of email:

data = # Exim filter\n \
  if \
    ${quote:${rxquote:$h_From:}} matches "(abuse|support|staff|admin)@$domain" \
  then \
    save /dev/null \
  endif



The ${rxquote:} handles the strange characters such as $, and the
${quote:} makes certain that any unbalanced "'s don't impact the
lvalue expansion. If I missed this somewhere, I apologize for
repeating the information.

hank