procmail
[Top] [All Lists]

Re: Test script wrong -- how to use variables?

1997-09-03 09:03:45
Jari Aalto <jaalto(_at_)tre(_dot_)tele(_dot_)nokia(_dot_)fi> writes:
...
       However, this won't work as I wanted. I want to filter out
       all mail that is not directly addressed to me or to my
       domains (nokia.com|uta.fi)
       
       What's the right syntax? When I send the following test message
       that is apparently addressed directly to me(jari) that would
       not go to reject mbx; but it does.
...
TO_ME       = (ssjaaa|jaalto|jari)

:0
*! TO ?? $TO_ME
{
       # - This tells the delivering sendmail that the user is unknown.
       # - Hope the spammer drops your name from their list when sees this.
       #   "No one at this address"
       #
       EXITCODE = 67

       :0
       $REJECTS
}

Variable expansion is only done inside conditions if the condition starts
with a dollarsign.  The next question is then "where is the TO variable
which you're testing against with 'TO ??' coming from?"  I think you
intended to do something like:

        # ^TO_ was introduced in procmail 3.11preX.  Older versions should
        # use ^TO
        :0
        * ! $ ^TO_$TO_ME
        {
                EXITCODE = 67
                # Should $REJECTS be locked?  If so, add a colon
                :0
                $REJECTS
        }


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>