[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ideas: tutorial and mail filter



> Brandon Mitchell writes:
> 
> >   2) Is there a way to convert the following from my .procmailrc:
> > :0:
> > * .*(@mega.net|\
> > Joeisme@ix.netcom.com|\
> > master@master-graphics.com|\
> > sonnyv@webspawner.com|\
> > BigProfit@mailcity.com|\
> > ...
> > a20@mary-world.com)
> > 
> > to search for one of these e-mail addresses in a file?  The idea being I
> > can get a list of spam addresses, append them to a file, and procmail does
> > it's dirty job if the address is in the file.  Otherwise, I'll get one
> > long and dirty .procmailrc file.

I'd like to thank Joey for his help with procmail on  LISC irc
(irc.linpeople.org#Debian).

You can find a good example at Lars Wirzenius' webpage.  If you are
interested please take a look at http://www.iki.fi/liw/mail-to-lasu.html.

As to what I have done, I process mailing list, pull out e-mail from
trusted addresses, and check the remaining mail for spam addresses and for
strings commonly found in spam.  After I get it to a final state, I was
thinking of submitting it to the procmail maintianer for addition to the
/usr/doc/procmail/examples directory.

--- .procmailrc ---
PMDIR=$HOME/.procmail

# debian stuff from mailing list
INCLUDERC=$PMDIR/rc.deb

# White list is a list of personal friends, mail will go to inbox
WHITELIST =   $PMDIR/white.list
WHITEBOX  =   $DEFAULT
INCLUDERC=$PMDIR/rc.white

# Black list contains a list of known spammers plus a scan through the
# body for well known spam strings
BLACKLIST =   $PMDIR/black.list
BLACKSTRING = $PMDIR/black.string
BLACKTEXT =   $PMDIR/black.text
INCLUDERC=$PMDIR/rc.black

--- rc.white ---
:0 Whic
| (formail -x from: -x sender: | grep -iqFf $WHITELIST)

:0 a
$WHITEBOX

--- rc.black ---
:0 Whic
* !^X-Loop: bhmit1@mail.wm.edu
| (formail -x from: -x sender: | grep -iqFf $BLACKLIST)

:0 a
| (formail -rt -A"Precedence: junk" \
   -A"X-Loop: bhmit1@mail.wm.edu" ; \
   cat $BLACKTEXT) | $SENDMAIL -t

:0 Wic
* !^X-Loop: bhmit1@mail.wm.edu
| grep -iqFf $BLACKSTRING

:0 a
| (formail -rt -A"Precedence: junk" \
   -A"X-Loop: bhmit1@mail.wm.edu" ; \
   cat $BLACKTEXT) | $SENDMAIL -t

--- white.list ---
# list of trusted people
bhmit1@mail.wm.edu
root@
postmaster@

--- black.list ---
# list of known spammers and spam sites
sonnyv@webspawner.com
BigProfit@mailcity.com
@cyberpromo.com


--- black.string ---
# strings commonly found in spam letters
get rich quick
$$$

Thanks again Joey and Lars,
Brandon

-----
Brandon Mitchell                         E-mail: bhmit1@mail.wm.edu
  Homepage: http://www.geocities.com/SiliconValley/7877/home.html

"We all know Linux is great...it does infinite loops in 5 seconds."
	--Linus Torvalds



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: