procmail
[Top] [All Lists]

Re: How to use variables as the action line?

2006-02-15 09:36:11
Michael,

Thanks everyone for the help.  I'm trying to step back a bit and just
write a simple recipe that pulls the action line from a variable, since
I think that was hinted at possibly helping me achieve my goal.  I'm
not sure whether to enclose the variable in braces, but it doesn't seem
to work whether I do or not.

ACTION='!disposable(_at_)michaelbluejay(_dot_)com'

:0
$ACTION

That won't work, because procmail parses for the type of action before 
expanding variables.  This is about as close as you can get:

  :0
  * ACTION ?? ^!\/.+
  ! $MATCH
  :0E
  * $ ACTION ?? ^\|\/.*[$SHELLMETAS].*
  | $MATCH ;
  :0E
  * ACTION ?? ^\|\/.+
  | $MATCH
  :0E
  * ACTION ?? .
  $ACTION

and you have to watch the quoting very carefully when you assign values 
to ACTION.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail