procmail
[Top] [All Lists]

Re: Can someone please design/point me to a recipe that.....

1996-07-24 01:07:29
On Wed, 24 Jul 1996, AIRWAVES MEDIA wrote:

I am serious.  Is anyone willing to write something in Perl, Shell, or
if possible just using procmail/formail to do this in an easy, turnkey
fashion?  I am sure it will be an instant hit.

My spam removal system:

--------

FROMZ="Brock Rozen's Spam Removal System <$COMSAT>"
SPAMLOG=$PMDIR/log.spams
SPAMCACHE=$PMDIR/cache.spams
SPAMMATCH=`perl -p -0377 -e 's:\n*$::;s:\n+:|:g;s:\.:\\.:g' $SPAMCACHE`

:0hc
* !^X-Loop: $COMSAT
* $ ? test -s $SPAMCACHE
* $ ^From:.*(${SPAMMATCH})
| ($FORMAILZ -I 'From ' \
        -I"From: $FROMZ" -r \
        -A"X-Loop: $COMSAT" \
        -A"Precedence: junk" \
        -I"Subject: Stop Spamming Me!";\
   cat $PMDIR/text.spams) | $SENDMAIL -oi -t

        :0A:
        | ( $FORMAILZ -XFrom: -XDate: -XSubject: ; echo ) >> $SPAMLOG

------

It logs it, it responds to the user with text of your choice but it
doesn't save the message (you could easily modify it to do that...)

SPAMCACHE is of the format:

first(_at_)email(_dot_)address
second(_at_)email(_dot_)address
third(_at_)e(_dot_)mail(_dot_)address

Brock Rozen

 ------------------------------------------------------------------------- 
 | Brock Rozen | brozen(_at_)netvoyage(_dot_)net | 
http://www.netvoyage.net/~brozen | 
 -------------------------------------------------------------------------