procmail
[Top] [All Lists]

Re: are variables local or global?

2001-08-03 09:28:37
George Chelidze asked,

| if I use some variables in my /etc/procmailrc file that are user
| dependent, is there a chance that two different instances of procmail
| use them erronously. I mean are these variable local per procces or are
| they global?

When I first read your subject line, my instinct was to say "global" because
procmail puts all variables into its environment.  But the way I think
you're using the two adjectives, George, I guess "local" is closer.

Any variable you set for procmail, whether it's on the command line, in an
assignment statement in an rcfile, or in a capture recipe, is in the
environment for that procmail process and for any other process that it
forks.  If two messages come in at the same time, the MTA will invoke a
separate procmail process for each, so they won't share variables with each
other.

If /etc/procmailrc has a line like this:

  OPINION="$LOGNAME is a jerk."

then when procmail handles mail coming in for sillything(_at_)your(_dot_)domain,
$OPINION will be "sillything is a jerk." for the rest of /etc/procmailrc and
for sillything's ~/.procmailrc until the variable is changed or unset.  If a
message for dipwad(_at_)your(_dot_)domain is being processed at the same time, 
it will
have "dipwad is a jerk." as the value of $OPINION.



_______________________________________________
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>