procmail
[Top] [All Lists]

Re: ackmail question

1997-08-10 18:41:00
On Sun, 10 Aug 97 18:55:12 -0400,
Timothy J Luoma <luomat+procmail(_at_)luomat(_dot_)peak(_dot_)org> wrote:
So I thought maybe using 'fgrep -i $SENDER $ACKFILE | wc -l' but how do I  
test if that is less than 6?

Here's what I have in place to trigger greylisting of anybody not on
the whitelist who sends me more than three messages in a day (WHOLOG
resolves to something like `date +'/tmp/wholog.%y%m%d'` and
whitelisted folks don't get added to the WHOLOG in the first place):

    NUM=`fgrep -xic "$FROM" $WHOLOG`
    :0:
    * -3^0
    * $$NUM^0
    scratch/greylist

Note that fgrep -c obviates the need for wc -l and associated
contortions. (So far, this particular recipe hasn't made my life much
easier, but the mechanics seem to work as expected.)

/* era */

Would this be more efficient than backticks?

    :0i
    NUM=| fgrep -xic "$FROM" $WHOLOG

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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