procmail
[Top] [All Lists]

Catching first time posters to procmail

1997-08-05 15:39:00

Well, being tired of spam sent to the list, I've set up a filter before I  
send them to my procmail folder

How does this look?

:0
* ^X-Loop: procmail(_at_)informatik\(_dot_)rwth-aachen\(_dot_)de|\
  ^TOprocmail(_at_)Informatik\(_dot_)RWTH-Aachen\(_dot_)DE
{

        # set the reply-to to the list
        # personal preference of mine....
        :0fhw
        | formail -I"Reply-To: 
procmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE"

        # IF the person HAS posted to the list before
        # send the message right to the procmail mailbox
        #
        # There are 1607 entries in the procmail list
        #
        :0w
        * ? fgrep -wis "$REPLYTO" $PROCDIR/known-users/procmail.txt
        | $APPNMAIL $LISTS/procmail
        
        # OTHERWISE, add a header line with the address that
        # DID NOT match
        
        :0fhw
        | formail -I"X-FirstTimeProcmail: $REPLYTO"

        # and send the message to its own Mailbox
        :0cw
        | $APPNMAIL NewProcmail
        
        # Add the name to the list, since most spammers
        # do not use the same address twice, this will mean
        # that when new valid users come to the list
        # I only have to deal with one message in the
        # 'NewProcmail' list
        :0hi
        |/bin/echo "$REPLYTO" >> $PROCDIR/known-users/procmail.txt
}


NOTES:
        REPLYTO=`formail -rtzxTo:`
        is run before this
        
        APPNMAIL is a NeXTStep program that does its own locking.

I'll let you know how it works if you let me know of any bugs you see :-)

TjL

        

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