procmail
[Top] [All Lists]

Re: Setting variables properly

1996-04-28 21:52:54
Brock Rozen <brozen(_at_)netvoyage(_dot_)net> writes:
Below is an example. I want to set the PGHOST variable with what it's
listed as, but don't know how to do it properly so that it'll match
(of course, the message *should* match) when I try to use it as part of a
matching function.



PGHOST=(@|%)(((.*)?\.)?Destek\.net|torah\.org)

:0
* ^TOgabbai$PGHOST


How do I set the variable properly and use it as a condition properly,
given the fact that I need gabbai to be set individually and NOT as part
of the variable. Thanks,

You set it just fine.  However, procmail doesn't expand variables in
conditions unless explicitly told to, but preceding the condition with
a dollar sign, i.e.:

:0
* $ ^TOgabbai$PGHOST


As for PGHOST, I would be tempted to change it to read:

PGHOST = (@|%)(([-a-z0-9]\.)*Desktek\.net|torah\.org)

That is, only domain name parts to follow the '@' or '%' and precede
Desktek.net.  As you have it now, the following header would match:

        To: gabbai(_at_)somewhere(_dot_)else, bob(_at_)desktek(_dot_)net


Philip Guenther

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