junkfilter a junk e-mail filter system for procmail Copyright 1997-98, Gregory Sutter and Matthew Hunt All rights reserved. Version 980508 README Contents: 1. Use of junkfilter 2. How to get junkfilter 3. Mailing list 4. Installation instructions 5. Sample .procmailrc file 6. Contributors 1. Use of junkfilter junkfilter is copyright 1997-98 Gregory Sutter and Matthew Hunt. junkfilter may be used freely by any individual or non-profit organization, subject to the following restrictions: junkfilter may not be used if you do or have ever sent unsolicited bulk email (UBE), defined here as greater than 100 recipients. junkfilter may not be used if you are in a business agreement of any type with a sender of UBE. junkfilter may not be used in any way to improve techniques for sending UBE. junkfilter may be used by employees of for-profit organizations under the individual restrictions specified above. junkfilter may not be installed systemwide; each junkfilter user must have their own copy. If you have questions regarding your ability to legally use junkfilter, or wish to inquire about a for-profit organization license to use junkfilter, please contact the authors. junkfilter comes with no warranty of any kind. Use at your own risk. 2. How to get junkfilter The junkfilter web page is http://www.pobox.com/~gsutter/junkfilter/ junkfilter and this documentation are available at the web site. 3. Mailing list The junkfilter mailing list is out of service until further notice. The machine that the list was hosted on has been disconnected from the Internet. When I find a new home for it, the list will return. Until then, please direct technical issues regarding junkfilter to gsutter@pobox.com. The junkfilter mailing list was junkfilter@mph124b.rh.psu.edu. To subscribe or unsubscribe, send a message with "(un)?subscribe" on the first line to junkfilter-request@mph124b.rh.psu.edu. DO NOT send administrative requests to the distribution address! 4. 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 (junkfilter*, jf*) 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/junkfilter 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 junkfilter.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. The file junkfilter.user is provided as a convenient place for you to store your own personal junk filtration recipes. If you follow the recommended format (given at the beginning of that file), junkfilter will treat your recipes the same as the rest of the files. The "user" section is the first section checked when junkfilter is called. In the distribution, the stock junkfilter.user is called junkfilter.user-default so that your personalized copy is not overwritten when you upgrade later. You can change the default action of jf to whatever you prefer. The only action command in junkfilter is to set the variable JFEXP to a relevant piece of text. It is up to you to then take some action. Since you've called junkfilter from your .procmailrc file, you can easily take action depending on the output (in the JFEXP variable) of junkfilter. I use this recipe in my .procmailrc directly after the INCLUDERC=$JFDIR/junkfilter statement (the formail statement is all on one line, of course): :0 : * JFEXP ?? . | formail -i "X-Fkey: junk" -i "X-junkfilter: $JFVERSION " -i "X-Spammer: $JFEXP" >> 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. 5. Sample .procmailrc file that calls junkfilter Everything between the two lines of "----------" is the file. Note how $PMDIR and $JFDIR are set in this file. ---------- SHELL=/bin/sh PATH="$HOME/bin:/usr/bin:/usr/local/bin:/usr/include:/usr/local/sbin:/bin:/sbin:/usr/sbin" MAILDIR=$HOME/mail PMDIR=$HOME/.procmail JFDIR=$HOME/.procmail/junkfilter 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/junkfilter # Take action if junkfilter caught a junkmail. :0 : * JFEXP ?? . |formail -i "X-Fkey: junk" -i "X-junkfilter: $JFVERSION" -i "X-Spammer: $JFEXP" >> junkmail # Catches everything else. :0 : inbox ---------- 6. Contributors to junkfilter Many people have contributed to junkfilter in various ways; the authors would like to thank the following people in particular: Era Eriksson David Tamkin Brian Goetz Edward Sabol Bryan D. McMeen Jeff A. Earickson John Wilkes Brad Knowles and the procmail mailing list EOF junkfilter.readme