procmail
[Top] [All Lists]

Re: assignment as an action

1996-04-16 18:59:39
Stefan Monnier asked,

| I'd like to do something like
| 
|       FOLDER=inbox
| 
|       :0
|       * ^From: toto
|       FOLDER=toto
| 
|       :0
|       * ^From: tata
|       FOLDER=foo

As Philip Guenther and Soren Dayton have posted, you need to place the
assignments in braces.  That way the left brace is a valid action, the
assignment occurs by itself inside the block, and the right brace terminates
it.  Absolutely do not use the `c' flag, because then you'll have a clone
where the variable is assigned delivering another copy in addition to the
parent procmail, where the variable will be unassigned.

|       :0
|       | rcvstore +$FOLDER

Suggestion: make it like this just to be safe in case the value of FOLDER
got lost somehow:

        :0
        * ${FOLDER+!}!
        | rcvstore +$FOLDER

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