procmail
[Top] [All Lists]

automatically adding names to a file

1997-01-27 10:15:41

I get email from a SPAM fighting group with the subject like this:

Subject: spam: waltercan(_at_)worldnet(_dot_)att(_dot_)net: Hello

Where the first word is "spam: " the second word is the offending  
email address, and the third word is the subject of the message that  
this offendee sent.

I would like to take the second argument (the email address) and  
REMOVE the ":" at the end of the email address and paste that to a  
file of known spammers:

I've been thinking about this:

:0
* ^From spam-list-owner(_at_)toby(_dot_)han(_dot_)de
* ^Subject: spam: \/.*$
{
        spammer=`echo $MATCH | awk '{print $1}' |tr -d ":"`
        
        
        :0hi: spamfile.lock
        * ! ? grep -s -i -w "$spammer" $PROCDIR/killfile-by-from-line
        |/bin/echo "$spammer" >> $PROCDIR/killfile-by-from-line

        :0
        |appnmail DuplicateSpam

}

The only thing I am worried about is the "tr -d" line.  Should I be  
worried about that?  is there a better way to do this?

and about the "DuplicateSpam" thing... I put that there to catch if  
I get two reports about the same guy (ie they are already in the  
killfile).  Is there another way of doing this?  I don't really care  
to see the message, I suppose I could send it to /dev/null.

Thoughts/comments?

TjL






-- 

Tj Luoma (luomat(_at_)peak(_dot_)org) 

If you have a web page about NeXTStep|OpenStep, email me the URL!

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