procmail
[Top] [All Lists]

Re: problem with the fgrep trick

1997-09-16 11:14:39
On Mon, 15 Sep 1997, James L. McGill wrote:

On Mon, 15 Sep 1997, W. Wesley Groleau x4923 wrote:
I just by accident discovered the discard of a legitimate message.
There was an In-Reply-To: 
<(_dot_)(_dot_)(_dot_)(_dot_)(_dot_)(_at_)triceratops(_dot_)com> which 

* formail -ISubject: | fgrep -i -f llv.domains

hit on (because atops.com is in the LLV list).

Substrings vs. regular expressions!
Is there a way to do the perlish /\btriceratops.com\b/ ?

Does any listee have a general purpose (and not too expensive)
hook to use perl instead of fgrep?  

Yes and yes.  Here's a recipe from junkfilter
(http://www.pobox.com/~gsutter/junkmail/):

# This section takes lists of domains, concatenates them and checks against
# the full list.  It requires a long LINEBUF but makes overall better sense
# because perl is only invoked once per mail rather than multiple times.
DOMAINS=`cat $PMDIR/domains/* | perl -p0e 's/\012(.)/\|$1/g; s/\./\\./g; 
s/\015//g; s/\|{2,}/\|/g'`
:0
* 
$()\/^(((Resent-|Apparently-)?From|(X-)?Sender|Reply-To|Return-Path|(X-)?Envelope-From).*@|Received:)(.*\<)?($DOMAINS)
{ SPAMMER=$MATCH }

GReg
--
Gregory S. Sutter                       "How do I read this file?"
mailto:gsutter(_at_)pobox(_dot_)com                "You uudecode it."
http://www.pobox.com/~gsutter/          "I I I decode it?"

<Prev in Thread] Current Thread [Next in Thread>