[spambayes-dev] Windows implementation using Command
webmaster at powerviewsystems.com
Wed Jul 14 15:59:20 CEST 2004
RE: [spambayes-dev] Windows implementation using Command line(forSpamBayes)
Thanks to everyone for their suggestions. I've made much progress so far.
But MORE assistance is needed...
(1) I create a bayescustomize.ini file in the root of the project.
(2) I discovered that the scripts would not run unless I copied the
particular script from the script folder to the base folder. Was that
correct? If so, should I have deleted the original file for that script
which I left in the scripts folder? (When I attempted to run the script from
the scripts folder, I got an error message saying that stuff was not found.)
(3) I then created custom folders and referenced these in the
bayescustomize.ini file which currently looks like this:
****** (but without the asterisks)
(4) At a command line, cued to the proper directory, I successfully ran
"sb_filter.py -n" The database file was created successfully.
(5) Next, I copied some spam and ham messages from my server to the proper
(6) At first sb_mboxtrain.py didn't work. It turns out, various assumptions
existed which didn't apply in my case. The closest function, as far as I
could tell, was the "maildir_train" function for "maildir" -type mail boxes.
But even this wasn't compatible. My mail was simply a collection of text
files in a folder. It didn't follow "maildir" conventions. Therefore, I had
to rem out the following lines:
# shutil.copystat(cfn, tfn)
# XXX: This will raise an exception on Windows. Do any Windows
# people actually use Maildirs?
# shutil.copystat(cfn, tfn)
# os.rename(tfn, cfn)
# if (removetrained):
(I hope that these were not important!!! ...Are they?)
Also, I made some other modifications regarding the path. Also, I'm assuming
here that (a) "cfn" is important, but (b) "tfn" is arbitrary. Again, is that
Now, when I run:
"sb_mboxtrain.py -s C:\SpamBayesServerEdition\sb_train_as_spam"
it SEEMS to work. It gives me the proper success message, and the date/time
stamp on the database updates.
(but I wish I could KNOW for sure that it worked. Could I be getting a false
(7) This is where I am stuck. When I actually attempt to run a file through
the filter, I've used the following:
(file name from my mail server)
It returns with NO feedback and NO errors. Therefore, I started placing
"print" statements in various parts of the code to see what actually gets
processed. It never seems to get past the following line:
for fname in args:
print "fname: " % fname
(notice my print line I eventually added. When this print line is place
here, an error message occurs:
File "C:\SpamBayesServerEdition\sb_filter.py", line 247, in main print
"fname: " % fname
TypeError: not all arguments converted during string formatting"
(note that the line number I report may be different than yours because of
modifications I've made)
Any suggestions? Was my command well formed?
rob at PowerViewSystems.com
More information about the spambayes-dev