procmail
[Top] [All Lists]

Re: Recipe efficiency

2003-02-16 15:40:29
Dick asked,

| I've been getting spam containing ascii characters in the range
| of 128 to 255.  The recipe I am using follows.  My question is:
| Is this efficient or inefficiency?  Is there notably more
| efficient alternative.

| EGREP=/usr/bin/egrep
| FGREP=/usr/bin/fgrep
| SUBJ_TITL=`formail -zxSubject:`
| FROM_ADDR=`formail -rtzxTo:`
|
| # Interrogate extended_ASCII file.
| # --------------------------------
| :0:
| * ? echo "$SUBJ_TITL" | $EGREP -i -f zz.asc
| $TRASH

[zz.asc is a file of one non-ASCII character per line.]

In a word, oy.  You're calling formail, egrep, plus a shell to pipe them
together, and you're opening another file, all for something procmail can do
without outside help.

 :0: # brackets enclose caret, tab, space, hyphen, tilde
 * ^Subject:.*[^     -~]
 $TRASH

Note that the tab must precede the space.  If you want to follow John's advice
to require three non-ASCII characters in a row,

 :0: # brackets enclose caret, tab, space, hyphen, tilde
 * ^Subject:.*[^     -~][^     -~][^     -~]
 $TRASH



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