I wrote this a while ago, for dspam v. 2.10, and things have changed a bit since then. In particular, the ./configure options --enable-delivery-to-stdout --enable-spam-delivery no longer exist, and you need to change --deliver-spam to --deliver=innocent,spam when invoking it. I'm still getting well over 99.9% accuracy with my current setup which is why I'm loathe to change it. When I do I'll rewrite this. In the meantime, email me if you have any trouble following this. -- Dickon Hood, 20041114. Using dspam for a single user ============================= All errors in this documnt are mine, Dickon Hood , and please bear in mind I wrote it from memory a couple of days after the fact in a situation marginally different to the one here, due to our setup at work. Any questions, let me know. dspam is aimed at large-scale implementations, but that doesn't mean it has to be installed like that. If you're not root on your machine, but need some good spamfiltering, dspam as a single-user is a good thing. It's not that difficult. First, you'll need to choose your DB format. I'm always *very* wary of BerkeleyDB, as I've had a bunch of DBM files get corrupted, and programs using them sit and chew all the RAM and swap in the machine, and leave it very unhealthy. Not much of a problem on a workstation (as you can usually spot it going mad and kill it before it's done too much damage), but on an unattended server, it's an issue. If you have a proper database around, I suggest you use it. I went to the effort of compiling and installing MySQL (because I could, because it isn't that hard, and because I've not done it before and rarely have an opportunity to fiddle with databases). Compiling dspam isn't difficult. Amongst other options, I chose: ./configure --with-userdir=$HOME/.dspam --with-userdir-owner=none \ --with-userdir-group=none --with-dspam-mode=none --with-dspam-owner=none \ --prefix=$HOME --enable-spam-delivery --enable-delivery-to-stdout but you may also want to set --enable-whitelist, --enable-experimental, and suchlike. If you have ~/bin and ~/lib directories, you may as well set prefix to $HOME as it'll put all binaries and libraries into bin and lib under it. Your userdir may as well be ~/.dspam or something similar as you'll be the only user using it. Build it with 'make && make install'. On Solaris with MySQL this may fail when building libdspam.la (IIRC) as it fails to link against the libmysqlclient.a properly, and spits out some 5600-odd (!) errors at you. 'make 2>&1 | head' will give you the commandline that fails. You'll need to look for the './buildtool' line, and C&P it into the shell. Change the '-L/path/to/mysql/lib -lmysqlclient' bits into an explicit '/path/to/mysql/lib/libmysqlclient.a'. Google was spectacularly unhelpful when trying to debug this; I hope this helps someone... If you're using MySQL, you'll need to setup a MySQL user, and set a password on your root account. Start mysql, login as the root user, and type: CREATE DATABASE dspamdb; GRANT ALL PRIVILEGES ON dspamdb.* TO dspam IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON dspamdb.* TO dspam@localhost IDENTIFIED BY 'password'; USE dspamdb; SOURCE /path/to/dspam/source/tools.mysql_drv/mysql_objects.sql.space.optimized; to create the database and install the schema. Create your mysql.data file in ~/.dspam/ as detailed in the docs; use the username 'dspam' and whatever you used as the password. If you're not using MySQL, then all that was irrelevant to you. Feed your dspam a mail to check it works. Hopefully it should. Run dspam_stats to check that it's learned a spam / ham. To actually use it, you'll need to feed it a corpus of ham, a corpus of spam, and you'll need to be able to spawn it automatically on receipt of an email. I run it from procmail, delivering to stdout, and I filter spam based on the headers dspam outputs. Launch procmail by putting: "|/path/to/procmail" in your ~/.forward file. Stick the following in your ~/.procmailrc file: ------8<------ # Begin spam treatment. :0fw | dspam --user username --stdout --deliver-spam :0: * ^X-DSPAM-Result: spam spam.inbox # End spam treatment. ------>8------ and you'll find your spam is delivered to a mailbox called 'spam'. To train a spam, pipe the spam through 'dspam --addspam', and a false-positive through 'dspam --falsepositive'. You can set up keybindings in mutt if you so wish, but as it's one of the very few things I need pipes for, I generally just use its use of getline and hit uparrow-return rather a lot. With this setup, you don't need the quarantine (with attendant webserver), you don't need the added aliases for spam / ham misclassification (per user), but you do have to know how to pipe mail through it. This probably won't be much of a problem for most people. And that should hopefully be it. It's fairly simple in concept, you just need to think a bit. Any questions, drop me an email.