You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

You can use SQL to store your bayes and awl databaes if you're running on Windows. Storing the database in SQL reportedly reduces cpu overhead and increases speed. You can likely use any database that has a DBD module and permits threads to share handles. ADO does not permit handle-sharing, so you may not use it. Others have successfully installed mysql on Windows and used that. This how-to provides information on using Microsoft's data engine. It was tested with MSDE 2000.

  1. Install the MSDE database engine. You can get it on the SQL 2000 service pack 4 download page: http://www.microsoft.com/downloads/details.aspx?familyid=8E2DFC8D-C20E-4446-99A9-B7F0213F8BC5&displaylang=en. You want the SQL2000.MSDE-KB884525-SP4-x86-ENU.EXE file near the bottom of the page. Extract it and follow the installation instructions. 2. Create a new database. Create a new login. Give the login rights to the database. I use the tools that came with SQL Server 2000 to do this. I don't know that Microsoft still has the tools available for MSDE 2000 since they want you to use SQL Express 2005 now. I haven't tested SQL Express 2005 mainly because our environment uses SQL Server 2000. 3. Create the tables in the database.
CREATE TABLE [dbo].[awl] (
	[username] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[email] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[ip] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[count] [int] NOT NULL ,
	[totscore] [float] NOT NULL 
) ON [PRIMARY]

CREATE TABLE [dbo].[bayes_vars] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[username] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[spam_count] [int] NOT NULL ,
	[ham_count] [int] NOT NULL ,
	[token_count] [int] NOT NULL ,
	[last_expire] [int] NOT NULL ,
	[last_atime_delta] [int] NOT NULL ,
	[last_expire_reduce] [int] NOT NULL ,
	[oldest_token_age] [int] NOT NULL ,
	[newest_token_age] [int] NOT NULL 
) ON [PRIMARY]

CREATE TABLE [dbo].[bayes_expire] (
	[id] [int] NOT NULL ,
	[runtime] [int] NOT NULL 
) ON [PRIMARY]

CREATE TABLE [dbo].[bayes_global_vars] (
	[variable] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[value] [varchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]

CREATE TABLE [dbo].[bayes_seen] (
	[id] [int] NOT NULL ,
	[msgid] [varbinary] (200) NOT NULL ,
	[flag] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL 
) ON [PRIMARY]

CREATE TABLE [dbo].[bayes_token] (
	[id] [int] NOT NULL ,
	[token] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[spam_count] [int] NOT NULL ,
	[ham_count] [int] NOT NULL ,
	[atime] [int] NOT NULL 
) ON [PRIMARY]

4. Edit local.cf to change the settings for AWL

auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList                       # Use SQL
user_awl_dsn DBI:ODBC:Driver={SQL Server};Server=localhost;Database=database-name # Use ODBC connector
user_awl_sql_username database-user                                               # Database user
user_awl_sql_password database-user-password                                      # Database user's password
user_awl_sql_override_username global                                             # Use this for global AWL
  • No labels