A good procmailrc setup

Alexy Khrabrov alexy.khrabrov at setup.org
Fri Mar 7 19:59:41 CET 2003


Greetings -- I'm thinking of improving a procmailrc setup
to use with bogofilter.  The new options, adding bogosity
headers, and -u allow for many possible setups.  I wanted
to share mine and see whether people use similar ones
and what and how can be improved.

First of all, I'm surprised how many people fight spam
_without first junking mail sent NOT to them_!
Most spam I receive is not ^TO me in procmail sense.

Hence, even before bogofilter, the following procmailrc
setup saved me from 95% of all spam:

-----
# .procmailrc AK1 -- before bogofilter
# ...
# file all lists first
:0
* mutt-users
mutt

:0
* netflix
flix

#...

# everything which is NOT for me is spam!

:0
* !^TOmyaddress1
* !^TOmyaddress2
# ...
# Junk folder is called z:
z

# falls into $DEFAULT inbox
=====

Now, I added bogofilter in the spam naturally so it gets
trained and exercised every few minutes:

-----
# .procmailrc AK2 -- training bogofilter

ORGMAIL=/chroot/httpd/var/spool/mail/alexy
DEFAULT=$ORGMAIL

# Is MAILDIR=Mail always equivalent to MAILDIR=$HOME/Mail?
MAILDIR=Mail
FILTER=/usr/local/bin/bogofilter

######################################################################
# all that remains here is supposed to be sent to me individually.
# if it is not, store it in the reject folder (should be /dev/null)
#

:0c
all

:0
* bogofilter
bogo

:0
* mutt-users
mutt

:0
* netflix.com
flix

# Some nasty terms can still be junked specifically:
:0:
* PrizesAndOffers
z

# Use bogofilter's attained wisdom:
:0HB
* ? $FILTER -u
z

:0:
* !^TOmyaddress1
* !^TOmyaddress2
#z
 {
	:0HBc
	| $FILTER -s

	:0
	z
 }

:0E
{ 	:0HBc
	| $FILTER -n

	# :0:
	# * further criteria for useful folders
	# folder
	# ...

	# finally falls into
	:0
	$DEFAULT 
}

# Shouldn't be reached, but just in case:
:0
$ORGMAIL
=====

I wonder what folks think of this setup.  The {} blocks came
from the initial Eric Raymond's docs for v0.7, but in the new docs
it shows -u with immediate junking, or :0fw and subsequent X-Bogosity
checking.  NB: I'm not sure whether $ORGMAIL and $DEFAULT are any
different, looks like they're the same.  I save all mail to "all"
just so that an omitted c in :0c somewhere doesn't lose mail --
it can easily happen when piping through the bogofilter.

Also, we could train bogofilter on all lists by adding a block
for piping with -n.

Would be great to see better, or just otherwise interesting procmailrc
setups!

-- 
Cheers,
Alexy Khrabrov :: www.setup.org :: Age Quod Agis




More information about the Bogofilter mailing list