BayesSpam - Version 2.0

Intelligently filters spam.

Author: mwalker@kydance.net

Features
========

* Dynamic filtering database - Defined by the individual user
* Can filter into folder of your choice
* Displays the calculated spam probability in the headers of a message
* Ignores folders that you choose, as well as the trash, and the folder
  it filters to.
* Compatible with 1.2.x and 1.3.x (Experimental)


Requirements
============

* SquirrelMail >= 1.2.x
* PHP >= 4.x
* PEAR-DB
* Compatible DB (See Docs Link Below)
* Courier IMAP (May work with other servers. Untested.)


Description
===========

Uses a Bayesian filter to intelligently filter out spam. The database
used for the filter is built by each user, so it will only filter what
they consider to be spam.


Links
=====

Article the idea was taken from:
	http://www.paulgraham.com/spam.html

PEAR-DB Docs:
	http://vulcanonet.com/soft/?pack=pear_tut


Credits
=======

Much of the code was originally borrowed from the Filters plugin as well
as the SpamCop plugin. Thanks go to Justin Mitchell for sending the link
above to the SM-USERS mailing list and giving me the idea to write this.

Justin Mitchell also provided the patch for MD5 message IDs, so that the
plugin no longer has to rely on the Message-ID header.

Ryan <ryan@vendetta.com> provided much useful feedback and many ideas
that were added in version 2.0. Thanks go to him for the performance
boost and many of the new 2.0 features.

Thanks are also due to all the users who have downloaded and used this
plugin, sending me bug reports to help make it a better product.


Future Work
===========

* File based database storage (May drop this)
* Optional message highlighting mode (Need hook first)
* Improved Auto Learn speed
* More IMAP Servers supported (NEED HELP WITH THIS)
* Suggestions?


Installation
============

Untar the plugin into the plugins directory. Inside you will find
'bayesspam.sql'. This file contains the table definitions that
BayesSpam needs added to a database in MySQL. Once you have them
added, go into config.php, and adjust the settings for your system.

Note that the sql script may need to be adjusted slightly for DBs
other than MySQL. This should be done by someone who is familiar
with both, and none of the names should be changed.

While there should not be any security holes in this plugin, I
suggest that you do /not/ use a MySQL user with access to everything.
I suggest you create a user just for BayesSpam, and only give it
access to the Database and/or tables that it needs to use.

Once you have completed the above, proceed with the typical path
of adding the plugin using the configure script, or adding it manually
to the config file.


Updating To 2.0
===============

Back up your old config.php, remove the bayesspam directory, and 
untar the now one over. Then, transfer your old settings back into
the config.php.

Make sure your DB matches the tables in bayesspam.sql.

Due to changes in the message ID hashing, you might as well delete the
old Messages table and start with a fresh one, since the old hashes
won't match their messages anyway.

Look over the config.php and update your settings.

Then just enable the plugin in the SM config, if it isn't already.


Changes
=======

2.0 - Major Overhaul
	New Features:
		MD5 message ID only uses Headers
		User option to control message size to scan
		Admin option to control max message size allowed
		Caching of scores to improve filter speed on messages it
			knows.
		Admin option to cleanup messages older than a set number
			of days.
		Link to recalculate score of a message

1.6 - Maintenance Release
	Small fix for missing $_REQUEST on old PHP versions

1.5 - Maintenance Release
	IMAP Command improvements
	SquirrelMail Version Checking
	SQL Connection Error Check

1.4 - More New Features
	Autolearn Improvements
	General Efficiency Improvements
	Customizable list of folders to ignore

1.3 - Several New Features
	Tracks what messages are added to the DB
	Moved links to be below the probability display
	Added ability to nuke your DB
	Added setting to affect the granularity of the DB

1.2 - Fixed bug in percentage calculation

1.1 - Many bugfixes, speed enhancments, code cleanup;
	Major Updates:
		Across the board speed enhancements
		Auto Learn speed improvement (I hope)
		Moved most code into functions to ease maintenance
		Added column to table specs to support a future feature

1.0 - Initial version
