procmail
[Top] [All Lists]

Re: escaping dots (was: Re: ^TO_)

2001-09-09 02:42:33
Just curious, but if one uses the following notation:

GOODGUYS=me(_at_)foo(_dot_)bar|you(_at_)bar(_dot_)org|her(_at_)bar(_dot_)foo

:0
* ! $ ^TO_$GOODGUYS
$TRASH

Does one still have to escape the "." [dots] in the e.mail addresses
listed in the GOODGUYS var? Or does using the var expansion
automaticly do this?

In this case it's the other way around.  The dots will match any
character after the variable GOODGUYS has been expanded, whether you
write it as:

 GOODGUYS=me(_at_)foo(_dot_)bar|you(_at_)bar(_dot_)org|her(_at_)bar(_dot_)foo

or

 GOODGUYS=me(_at_)foo\(_dot_)bar|you(_at_)bar\(_dot_)org|her(_at_)bar\(_dot_)foo

To get literal dots you'll want to do something like:

 
GOODGUYS='me(_at_)foo\(_dot_)bar|you(_at_)bar\(_dot_)org|her(_at_)bar\(_dot_)foo'

Or you could just use the first version and make your condition:

 * ! $ ^TO_($\GOODGUYS)

and it will match against the literal dots, but it will also match
against the literal vertical bars, which is probably not what you want.
Note the parentheses also.  You probably meant

 * ! $ ^TO_($GOODGUYS)

in your original condition.

There are more details on all that in the man pages.  And you can test
it out by setting VERBOSE=1 in your procmailrc file, sending a few test
messages, and looking at your logs to see how the variable was actually
expanded out.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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