Problem with struct.unpack in oe_mailbox.py

Spandex <[email protected]>
Newsgroups gmane.mail.spam.spambayes.devel
Organization pr0k
Message-ID <[email protected]>
Hi,

I previously sent this mail to the spambayes users list, without
response.  Apologies for the repost... I'm hoping it's more
appropriate here:-

I'm running spambayes (1.0.4-3) on Debian unstable with Python 2.4.4c0
and a custom compiled 2.6.17 kernel. I'm using an AMD64 chip.

sb_server starts up ok and proxies pop3 and smtp connections ok.
I can train from the commandline ok.

The problem comes when I try to train it from the web interface (using
either mbox or dbx format).  It bombs with the following error:-

----------------
Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/spambayes/Dibbler.py", line 470, in found_terminator
    getattr(plugin, name)(**params)

  File "/usr/lib/python2.4/site-packages/spambayes/UserInterface.py", line 494, in onTrain
    content = self._convertToMbox(content)

  File "/usr/lib/python2.4/site-packages/spambayes/UserInterface.py", line 536, in _convertToMbox
    content = oe_mailbox.convertToMbox(content)

  File "/usr/lib/python2.4/site-packages/spambayes/oe_mailbox.py", line 444, in convertToMbox
    if header.isValid() and header.isMessages():

  File "/usr/lib/python2.4/site-packages/spambayes/oe_mailbox.py", line 117, in isValid
    return self.getEntry(0) == dbxFileHeader.MAGIC_NUMBER

  File "/usr/lib/python2.4/site-packages/spambayes/oe_mailbox.py", line 126, in getEntry
    self.dbxBuffer[dbxEntry * 4:(dbxEntry * 4) + 4])[0]

error: unpack str size does not match format
----------------

I'm wondering whether this is something to do with my machine
architecture and the sizes of datatypes?  But I'm stabbing in the
dark.

I can easily disable dbx support by commenting out..
content = oe_mailbox.convertToMbox(content)
.. around line 536 of UserInterface.py, and this does enable me to
train on mbox format via the web interface, but I'd rather keep dbx
support if possible.  I don't speak Python so commenting out the
offending code was about as far as I could go.

Any ideas?

Thanks,

Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.