1. SPAMBAYES (1.1a3) /w python2.4 as POP3-Proxy (+ as root user)
this is a installation-howto written by a non-expert linux user for a fresh debian 4.0 (etch, stable) installation (business card).
please feel free correcting... (and excuse my english
)
Testsystem (in case problemes should occur due to):
-
AMD @366MHz
-
128MB SDRAM
-
4.3GB MAXTOR HDD
Legend: "~" -> homedir
1.1. Browse releases, download & unzip
-
Browse https://sourceforge.net/project/showfiles.php?group_id=61702
-
cd ~
-
wget http://downloads.sourceforge.net/spambayes/spambayes-1.1a3.tar.gz
-
tar xzvf spambayes-1.1a3.tar.gz
1.2. Prerequisites
-
apt-get install python python-dev python-zodb
-
apt-get install python-crypto (only for http_auth: Digest but unsure if this was the needed package, pls confirm)
-
apt-get install python-imaging ocrad (for experimantal "crack_image" - could not test it out though)
1.3. Installation
-
cd spambayes-1.1a3 (assuming you are still in "~")
-
python setup.py install
-
delete spambayes-1.1a3.tar.gz + ~/spambayesXXX
1.4. Configuration
-
mostly it should be installed in: /usr/bin/sb_*
-
if not, try "updatedb" and then "locate sb_"
-
make a first run of "sb_server.py", this will create default files (unfortuneatly, no config file) in "~"
-
shutdown and "nano bayescustomize.ini" to create config-file with following content:
[html_ui] allow_remote_connections:1.2.3.4
Remember to change "1.2.3.4" with the IP of the computer going to access it for the first time (maybe 192.168.2.111)
-
start again "sb_server.py"
-
access webui over http://IP.OF.SERVER:8880
-
do configuration as needed
1.5. Missing
ATTENTION: this tutorial is not finished as I need some help (please :))-
did not try yet the experimental stuff (bugs below must first be fixed so I can test this in a productive enviroment)
-
SpamBayesAsUnixDaemon was not working for me (see attachments for "workaround")
-
when using http_auth: digest, on FireFox2.x I have to keep on typing the username/password when reloading the page (or parts of the page, e.g. images) - is this intended?
-
missing following options during installation:
1) use some "sb_data" path during installation (e.g. not place the db in ~ but something like ~/sb_data -> fixed, see init.d/daemon script below! (sorry for my missunderstanding)
2) auto-generate "bayescustomize.ini" with all values (even if default - I think/believe this would make a better handling with that file)
3) Very important: when auto-generating the config (see above) please make default value auf html_ui -> allow_conne* to "*", so remote installations are actually possible
-
still error occurs when saving config via webui (see attachments):
-
using zeodb as backend, fresh db -> webui training (the direct input box) will not function. (did not test yet with other backends)
-
as far as my tests go, "reviewing messages" (and train there over) works
-
http://mail.python.org/pipermail/spambayes-dev/2006-November/003808.html
http://mail.python.org/pipermail/spambayes/2006-December/020246.html
http://mail.python.org/pipermail/spambayes/2006-November/020179.html
-
But so far I can say: restarting spambayes will solve the problem (I persume the "restart" what the webui actually would have to do, does not work - please confirm)
1.6. Attachments (Beta)
1.6.1. init.d/daemon script
#!/bin/sh
#
# Version: @(#) /etc/init.d/spambayes 0.2
# Feedback: guwapo AT thedoghouse DOT bz
# Changelog:
# 21.04.2007 / guwapo / added: "pidof" syntax for better recon
# guwapo / added: config overhead for better overview
# guwapo / fixed: if workingdir does not exist -> mkdir!
# config (please change)
SBPROXY=/usr/bin/sb_server.py
SBDIR=/opt/sb_data
# main algo (no changes below!)
start () {
echo -n "Starting SpamBayes POP3 proxy: "
if [ ! -d $SBDIR ]
then
mkdir $SBDIR
fi
cd $SBDIR
$SBPROXY > /dev/null &
kid=`pidof -x sb_server.py`
if [ $kid ]
then
echo "ok."
fi
}
stop () {
echo -n "Stopping SpamBayes POP3 proxy: "
kid=`pidof -x sb_server.py`
if [ $kid ]
then
kill $kid
echo "stopped."
else
echo "nothing to kill."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
esac
-
this is only beta, many things are missing!!
-
remember: I am not a pro, surely this is not 100% perfect code
-
it works fine on debian 4.0 etch - for me!
1.6.2. error when saving config
after saving:500 Server error
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/spambayes/Dibbler.py", line 476, in found_terminator
getattr(plugin, name)(**params)
File "/usr/lib/python2.4/site-packages/spambayes/UserInterface.py", line 884, in onChangeopts
self.reReadOptions()
File "/usr/lib/python2.4/site-packages/spambayes/ProxyUI.py", line 782, in reReadOptions
state = self.state_recreator()
File "/usr/bin/sb_server.py", line 1007, in _recreateState
prepare()
File "/usr/bin/sb_server.py", line 1022, in prepare
state.prepare(can_stop)
File "/usr/bin/sb_server.py", line 822, in prepare
self.createWorkers()
File "/usr/bin/sb_server.py", line 889, in createWorkers
self.stats = Stats.Stats(options, self.mdb)
File "/usr/lib/python2.4/site-packages/spambayes/Stats.py", line 60, in __init__
self.from_date = self.messageinfo_db.get_statistics_start_date()
AttributeError: 'NoneType' object has no attribute 'get_statistics_start_date'
when then going to home:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/spambayes/Dibbler.py", line 476, in found_terminator
getattr(plugin, name)(**params)
File "/usr/lib/python2.4/site-packages/spambayes/ProxyUI.py", line 184, in onHome
state.buildStatusStrings()
File "/usr/bin/sb_server.py", line 835, in buildStatusStrings
nspam = self.bayes.nspam
AttributeError: 'NoneType' object has no attribute 'nspam'
