Jeffrey Bell had this code,
| > # If the body of the msg contain the word REDHAT
| > # This top rule works.
| > :0 B:
| > * redhat
| > | $RCVSTORE +$SPAMFOLDER
| > # Soon to be /dev/null
| >
| > # or if the subject line is about REDHAT
| > # throw the msg away.
| > :0 E:
| > * ^Subject.*redhat
| > | $RCVSTORE +$SPAMFOLDER
Among his other suggestions, Philip Guenther recast it as this:
| # If the body of the msg contain the word REDHAT, or if
| # the subject contains the work redhat, then throw the
| # message away.
| :0
| * B ?? ()\<redhat\>
| * ^Subject:.*\<redhat\>
| |$RCVSTORE +$SPAMFOLDER
| # Soon to be /dev/null
While Philip was right about everything else, he slipped there. That will
save the message to $SPAMFOLDER only if [procmail entered the outer braces
that I'm not showing here and] *both* the body and the subject contain
"redhat".
To look for a pattern in *either* the body or the subject, one can use [a]
two recipes as Jeffrey originally did, [b] scoring, [c] the double inverse
DeMorgan gambit, or [d] a condition like this:
* HB ?? ^^(.+$)*(Subject:|$(.*$)*).*\<redhat\>