junkfilter a junk email filter system for procmail Copyright 1997, Gregory Sutter and Matthew Hunt All rights reserved. Version 4 README Contents: 1. Use of junkfilter 2. How to get junkfilter 3. Installation instructions 4. Sample .procmailrc file 1. Use of junkfilter junkfilter is copyright 1997 Gregory Sutter and Matthew Hunt. junkfilter may be used freely in any not-for-profit, noncommercial situation. junkfilter may NOT be used if you are a spammer, in any business agreement of any type with a spammer, or to improve spam or spamming techniques in any way. If you have questions regarding your ability to legally use junkfilter, please make an inquiry with the authors. junkfilter comes with no warranty of any kind. 2. How to get junkfilter The junkfilter web page is http://www.pobox.com/~gsutter/junkmail/ junkfilter and this documentation are available at the web site. 3. Installation of junkfilter We assume you've already got procmail installed and running properly, as this is explicitly a "junk email filter system for procmail". Consult the procmail documentation if you need help installing procmail. Set the $PMDIR variable. We recommend that you make a directory ".procmail" in your home directory and a symlink from $HOME/.procmailrc to $HOME/.procmail/procmailrc. This file is not part of junkfilter; it is the procmailrc file that you already have installed. If you do this, you can set PMDIR=$HOME/.procmail Place the junkfilter files (rc.jun*, jf-domains, jf-addresses) wherever you want them. This can be in $PMDIR or anywhere else. Set $JFDIR in your procmailrc to the directory in which you placed junkfilter. To call junkfilter, place a line in your procmailrc file that reads: INCLUDERC=$JFDIR/rc.junk This will call junkfilter. All other junkfilter files are called from within this first file. You now have a basic junkfilter setup. You now need to configure junkfilter to fit your every desire. Edit rc.junk.config and change the various options from 0 to 1 and vice-versa. 0 means "false"; 1 means "true". A given piece of code will only execute if it is set true. Please read the comments at the beginning of each one before changing anything. Second, you can change the default action to whatever you prefer. The only action command in junkfilter is to set the variable SPAMMER to a relevant piece of text. It is up to you to then take some action. Since you've called rc.junk from your .procmailrc file, you can easily take action depending on the output (in the SPAMMER variable) of junkfilter. I use this recipe in my .procmailrc directly after the INCLUDERC=$JFDIR/rc.junk statement: :0 : * SPAMMER ?? . | formail -i "X-Fkey: junk" -i "X-Spammer: $SPAMMER" >> junkmail Instead of this, you can change it to whatever you prefer. The most common change will be the name of the mailbox in which the junk mail is stored. You can change it to /dev/null if you wish, but remember that no matter how good the filter, mistakes will be made. The authors do NOT recommend immediately discarding any mail filtered by junkfilter. 4. Sample .procmailrc file that calls junkfilter Everything between the two lines of "----------" is the file. ---------- SHELL=/bin/sh PATH="$HOME/bin:/usr/ucb:/usr/local/ucb:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/etc:/usr/sbin:/usr/lang:/etc:/opt/local/bin:/usr/ccs/bin:/opt/local/adm/bin" MAILDIR=$HOME/mail PMDIR=$HOME/.procmail JFDIR=$HOME/.procmail DEFAULT="inbox" LOGFILE=$PMDIR/log LOGABSTRACT=all VERBOSE=no # Procmail mailing list :0 : * ^Resent-From:.*procmail@Informatik.RWTH-Aachen.DE | formail -i "X-Fkey: procmail" >> procmail # Call junkfilter INCLUDERC=$JFDIR/rc.junk # Take action if junkfilter caught a junkmail. :0 : * SPAMMER ?? . |formail -i "X-Fkey: junk" -i "X-Spammer: $SPAMMER" >> junkmail # Catches everything else. :0 : inbox ---------- EOF rc.junk.readme