[Spambayes] Using MySQL [WAS: The joys of error messages.]

Michael C. Neel neel at mediapulse.com
Thu May 13 10:46:03 EDT 2004

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:

Traceback (most recent call last):
  File "/usr/bin/sb_imapfilter.py", line 121, in ?
    from spambayes.UserInterface import UserInterfaceServer
  File "/usr/lib/python2.3/site-packages/spambayes/UserInterface.py",
line 89, in ?
    from spambayes import Stats
  File "/usr/lib/python2.3/site-packages/spambayes/Stats.py", line 34,
in ?
    from spambayes.message import msginfoDB
ImportError: cannot import name msginfoDB

Looking at message.py shows there isna't a case for "mysql" in the
messageinfo.db setup:

message_info_db_name = get_pathname_option("Storage",
if options["Storage", "persistent_use_database"] is True or \
   options["Storage", "persistent_use_database"] == "dbm":
    msginfoDB = MessageInfoDB(message_info_db_name)
elif options["Storage", "persistent_use_database"] is False or \
     options["Storage", "persistent_use_database"] == "pickle":
    msginfoDB = MessageInfoPickle(message_info_db_name)

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

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


> 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!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/spambayes/attachments/20040513/2e7350ff/attachment.html

More information about the Spambayes mailing list