procmail
[Top] [All Lists]

Re: 1. Useless cat. 2. Counting spams

2002-05-01 18:55:33
At 01:11 2002-05-02 +0100, Alan Clifford did say:

   # save from address into greylist if not already there
    :0 wc : $PMDIR/list.grey.lock
    * $ ! ? echo ${FROMHEADER} | grep -F -isx -f $PMDIR/list.grey
    | cat > /dev/null; echo ${FROMHEADER} >> $PMDIR/list.grey

'c' means that even though THIS message is processed, the original continues to be processed through the rest of your rcfile (up until it is delivered).

If you want to eliminate the cat, go ahead, and just ADD the 'i' flag. Whatever reason you have the 'c' flag there now has NO bearing on the presence of the cat to null operation.

You could TEST this easily enough in a sandbox.  See my .sig.

What I would like to do is count the number of times I receive anything I
considered to be spam from an address and then, if I have received, say 5
from that address, put it in a blacklist.

No good:

        1. If some schmuck spams me, they're a spammer - why wait till they've
        sent you four more spams?

        2. few spammers send their junk from the same address more than once.

I blitz spam based on various heuristics - fixed email addresses aren't a big part of that. Domain references certainly, and partual addresses too ("Friend@" type BS), but rarely full address specifications.

The approach is valid for twit filtering though - filtering people from mailing lists, etc - who are otherwise participating under a valid and consistent email address.

Creating the list with a count is the problem.  I am considering writing a
'C' program with the Berkeley database that would take the address as
input and give the count as output.  But is there an easier way of
creating such a list?

Yea, just appending the address to a file (not unlike you're doing above), and then using:

        grep -c -u addrspec addrfile

Certainly though, a proper db implementation would allow you to track other info at will and not bloat a datafile with duplicate data.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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