procmail
[Top] [All Lists]

Re: Problem with spam detection/deletion

2001-01-31 00:22:00
  Given...
> trash_header="X-Procmail: unwanted"

  And...
> VERBOSE=1
> :0 H:$MAILDIR/trash/.lock
> *^$trash_header
^^^^^^^^^^^^^^^^^
> | /home/mcmaster/bin/rcvstore -nounseen +trash
> VERBOSE=0

The "* ^$trash_header" line should read...
*$ ^$trash_header

That's...
star
dollar_sign
blank_space
caret
$trash_header

  The technical explanation...
Procmail was looking for a *LITERAL STRING* "$trash_header".
You need to put in a "$" flag to tell procmail that you
want $trash_header parsed as a variable rather than as a
literal string.  As a matter of defensive programming, I
also prefer to use braces around the variable name, e.g.
${trash_header}, to prevent ambiguity.

Given...
trash="Hello"
trash_header="Goodbye"

"${trash}" expands to "Hello"
"${trash_header}" expands to "Goodbye"
"${trash}_header" expands to "Hello_header"
"$trash_header"   expands to "Goodbye", which might not be
  what was intended.

--
Walter Dnes
<walter(_dot_)dnes(_at_)sympatico(_dot_)ca>
<waltdnes(_at_)waltdnes(_dot_)org>

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