[Spambayes] A most peculair problem with SB 1

Tony Meyer tameyer at ihug.co.nz
Thu Nov 11 00:39:07 CET 2004

> This is going to take some time to respond to since there are now 
> several issues cropping up.

Indeed.  It's good to get them sorted though - the service hasn't really
been all that developed, IIRC, so the help is appreciated :)  (as is the
explanation of the 2003 Server stuff, which I am not familiar with at all)

> To keep things a bit simpler I shall deal 
> with each of them as distinct reply messages.

Sounds good.

> The issue of installing a service, and where that service should look 
> for its configuration data, and where and how it should store any 
> output data or logging is therefore a fraught one. The one thing that 
> one can say with great certainty is that none of these things should 
> ever be stored in the user data or user profile areas
> Service data [whether config or output] is - at least in my opinion - 
> normally best stored either within a subdirectory of the directory 
> structure of the application itself - in this case that would be 
> somewhere such as c:\Python23\Spambayesconfig  - or in a location 
> within the Windows tree such as %SYSTEMROOT%\System32\Spambayesconfig 
> or similar. 

OK then, so what about I change pop3proxy_service.py to (when run with
"install") look for an existing configuration file and if there isn't one
create one in the parent directory of the script.  This would mean:

  * Binary: in the (eg) \Program Files\SpamBayes directory, so the cache
directories would be at the same level as the 'bin', 'lib', and 'doc'

  * Source (outside Python): in the root spambayes directory, so the cache
directories would be at the same level as the 'contrib', 'spambayes',
'windows' (etc) directories.

  * Source (inside Python): in the root Python directory, so the cache
directories would be at the same level as the 'Lib', 'DLLS', 'Scripts' (etc)

The directory that is chosen gets:
  * the bayescustomize.ini file
  * the hammie.db database
  * the spambayes.messageinfo.db database
  * the pop3proxy-ham-cache, pop3proxy-spam-cache, pop3proxy-unknown-cache
(IIRC, that's all at the moment).

Alternatively, I could get it to create a (eg) "SpamBayesData" directory in
the parent directory of the script.  It would then be in the places
described above, but have the three files and three directories inside it.
That's tidier, although slightly more complicated.

> I'd also suggest that log files should not be sent to temp 
> directories which get scavenged by 2003, and that the WMI interface
> be used to send warnings etc to the Windows Application Event log.

This is do-able as well.  I'll try and create something that does this later
today.  (As an aside: it would be nice in many ways if all the spambayes
code was converted to use the Python logging module rather than print
statements (the Outlook plug-in actually has it's own logging system), and
things like this would be much simpler and easier to change as necessary.
That's a fair bit of work, though - maybe it'll make it to 1.1, but maybe it

> Hope this begins to clarify some of the issues.

It does indeed, thanks :)


Please always include the list (spambayes at python.org) in your replies
(reply-all), and please don't send me personal mail about SpamBayes.
http://www.massey.ac.nz/~tameyer/writing/reply_all.html explains this.

More information about the Spambayes mailing list