procmail
[Top] [All Lists]

Re: Setting Environment Variables in Procmail

1997-06-07 11:05:00
Catherine Hampton asked,

| I've got a recipe that attempts to set an environment variable.  It looks
| like this:
| 
| :0:
| * (^FROM_MAILER|\
|    ^From.*[^0-9a-z]abuse@|\
|    ^From(_dot_)*[^0-9a-z]dummy(_at_)c-zone\(_dot_)net|\
|    ^From.*[^0-9a-z]hostmaster@|\
|    ^From(_dot_)*[^0-9a-z]mattm(_at_)idci\(_dot_)net|\
|    ^From.*[^0-9a-z]nobody@|\
|    ^From.*[^0-9a-z]noc@|\
|    ^From(_dot_)*[^0-9a-z]NotesServer1(_at_)hotmail\(_dot_)com|\
|    ^From.*[^0-9a-z]spam@|\
|    ^From.*[^0-9a-z]support@)
| ADMINTAG=yes
| 
| This causes all mail which matches to be saved in a folder named
| ADMINTAG=yes, which is (obviously) not what I wanted.  How do I make
| procmail understand it is to set the variable and then move on? 

As Stan Ryckman has said, you need to surround the assigment in braces
so that procmail will see it as a nesting block rather than as a folder
name.  Additionally, though, you could do some serious reduction on the
regexp!

 * ^FROM_MAILER|^From.*\<(\
    abuse@|dummy(_at_)c-zone\(_dot_)net|mattm(_at_)idci\(_dot_)net|hostmaster@|\
    nobody@|noc@|NotesServer1(_at_)hotmail\(_dot_)com|spam@|support@)

or even

 * ^FROM_MAILER|^From.*\>((abuse|hostmaster|no(c|body)|spam|support)@|\
    
(dummy(_at_)c-zone|mattm(_at_)idci)\.net|NotesServer1(_at_)hotmail\(_dot_)com)

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