procmail
[Top] [All Lists]

Re: procmail and formail question

2002-09-18 23:19:42
LuKreme <kremels(_at_)kreme(_dot_)com> writes:
On Wednesday, September 18, 2002, at 08:59 PM, Mark Moshe Kaye wrote:
:0
* ? formail -I "" \
   | egrep -is -f $HOME/procmail/.mail_badwords

The $HOME will not expand without a $ in your condition, right?

Wrong.  Everything to the right of the '?' is a command and will have
variable and command expansion performed on it just like any other
command executed by procmail, whether by procmail itself or by a shell
that procmail uses to invoke the command.  Do not place a '$' before the
'?' unless you want *two* rounds of variable expansion to take place,
ala eval.

BTW, the formail command there is unnecessary, as you can tell procmail
directly to feed just the body of the message to the egrep using the
'B ??' syntax:

        :0
        * B ?? ? egrep -is -f $HOME/procmail/.mail_badwords
        ...etc

That actually saves two process, as procmail can then execute the command
directly without using a shell.


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