<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
There may be a problem in 1.0rc1 in using MySQL, which I'm trying to do to see how it would go. Currently you get the traceback:<BR>
<BR>
Traceback (most recent call last):<BR>
File "/usr/bin/sb_imapfilter.py", line 121, in ?<BR>
from spambayes.UserInterface import UserInterfaceServer<BR>
File "/usr/lib/python2.3/site-packages/spambayes/UserInterface.py", line 89, in ?<BR>
from spambayes import Stats<BR>
File "/usr/lib/python2.3/site-packages/spambayes/Stats.py", line 34, in ?<BR>
from spambayes.message import msginfoDB<BR>
ImportError: cannot import name msginfoDB<BR>
<BR>
Looking at message.py shows there isna't a case for "mysql" in the messageinfo.db setup:<BR>
<BR>
message_info_db_name = get_pathname_option("Storage", "messageinfo_storage_file")<BR>
if options["Storage", "persistent_use_database"] is True or \<BR>
options["Storage", "persistent_use_database"] == "dbm":<BR>
msginfoDB = MessageInfoDB(message_info_db_name)<BR>
elif options["Storage", "persistent_use_database"] is False or \<BR>
options["Storage", "persistent_use_database"] == "pickle":<BR>
msginfoDB = MessageInfoPickle(message_info_db_name)<BR>
<BR>
<BR>
I'm not sure exactly how MySQL is supposed to work, I can't find docs on it other than source code comments =). My impressions is the msgingo.db is *not* placed into the mysql database at this time, only the hammie.db.<BR>
<BR>
I'd like to work on this some more, as I'd love to be able to setup spambayes for a mass-hosting email server; users still have their own hammie.db's<BR>
<BR>
Mike<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#0000ff"><I>You need to set the [Storage] persistent_use_database option to "mysql".
You can do this via the web interface, I believe, or just by manually
editing your configuration file. The 'name' of your database should be
something like:
host:localhost user:username pass:password dbname:database_name
(If you leave any one item out, they default to:
host = "localhost"
username = "root"
password = ""
db_name = "spambayes"
)
You need to set the mySQL db up yourself first, creating the appropriate
database. The table "bayes" will be created by SpamBayes.
Feedback would be great!
</I></PRE>
</BLOCKQUOTE>
<PRE><A HREF="http://mail.python.org/mailman/listinfo/spambayes"></A></PRE>
</BODY>
</HTML>