[spambayes-bugs] [ spambayes-Bugs-1019797 ] some spam repeatably crashes sb_filter.py

SourceForge.net noreply at sourceforge.net
Fri Jan 21 05:36:13 CET 2005


Bugs item #1019797, was opened at 2004-09-01 03:59
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1019797&group_id=61702

Category: hammie
Group: Binary 1.0rc2
>Status: Pending
Resolution: Wont Fix
Priority: 5
Submitted By: Nathan Kurz (nkurz)
Assigned to: Nobody/Anonymous (nobody)
Summary: some spam repeatably crashes sb_filter.py

Initial Comment:
I'm running Python 2.3.1 on Linux, processing my mail
with procmail.  Recently I've been getting spam that
crashes sb_filter.py.  Failure can be repeated from the
command line.  

Seems to affect only mail that SpamAssassin has tagged
as spam.  Repeatable for any message that fails.  I had
this problem starting 2 weeks ago with Source 1.0rc1,
upgraded to Source 1.0rc2 and problem persists. 
Affects ~10% of messages.

(note: no option for Source 1.0rc2 in reporting form)

Backtrace looks looks like this:

Traceback (most recent call last):
  File "/usr/bin/sb_filter.py", line 257, in ?
    main()
  File "/usr/bin/sb_filter.py", line 253, in main
    result = mboxutils.as_string(msg, unixfrom=unixfrom)
  File
"/usr/lib/python2.3/site-packages/spambayes/mboxutils.py",
line 170, in as_string
    parts.append(part.as_string())
  File "/usr/lib/python2.3/email/Message.py", line 130,
in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/usr/lib/python2.3/email/Generator.py", line
103, in flatten
    self._write(msg)
  File "/usr/lib/python2.3/email/Generator.py", line
131, in _write
    self._dispatch(msg)
  File "/usr/lib/python2.3/email/Generator.py", line
157, in _dispatch
    meth(msg)
  File "/usr/lib/python2.3/email/Generator.py", line
298, in _handle_message
    g.flatten(msg.get_payload(0), unixfrom=False)
  File "/usr/lib/python2.3/email/Generator.py", line
103, in flatten
    self._write(msg)
  File "/usr/lib/python2.3/email/Generator.py", line
131, in _write
    self._dispatch(msg)
  File "/usr/lib/python2.3/email/Generator.py", line
157, in _dispatch
    meth(msg)
  File "/usr/lib/python2.3/email/Generator.py", line
200, in _handle_text
    raise TypeError, 'string payload expected: %s' %
type(payload)
TypeError: string payload expected: <type 'list'>

Test message attached.


----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2005-01-21 17:36

Message:
Logged In: YES 
user_id=552329

We haven't heard from the original reporter of the bug for some
time.  Without the requested information, there really isn't much
we can do.  If anyone does provide further information, please
also change the bug status back to "Open".

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-11-05 11:19

Message:
Logged In: YES 
user_id=552329

Ok, now I'm even more confused!

You're right - the attached message appears to parse fine.

However, with Python 2.2.3/2.3.4/2.4b2 and (unpatched)
spambayes 1.0 (which didn't change from 1.0rc2) sb_filter
filters this fine for me - I can't duplicate that traceback
at all.

Do you definately get the traceback with unpatched mobxutils
with the spam.test attached here?  I am on a different OS,
but I can't see how that would effect this...

----------------------------------------------------------------------

Comment By: Nathan Kurz (nkurz)
Date: 2004-11-04 17:54

Message:
Logged In: YES 
user_id=965823

I'm fine with keeping it as a local patch if indeed the
message is malformed, but I'm not sure if it is.  Can you
take a look at the spam.test I attached originally and
confirm that it is not to spec?  To my untrained eye it
looks legal.  If it's broken due to SpamAssassin, I'll
report it as a bug there if the breakage exists in their
latest version.

Thanks!

Nathan Kurz


----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-11-04 16:29

Message:
Logged In: YES 
user_id=552329

(I see that I wasn't correct when I guessed what type of
malformation it was - the code handles one that generates a
TypeError, but in a different part of the message).

The general rule at the moment seems to be that we won't
patch for any specific malformations (because we'd just be
duplicating the email package folk's work, and eventually
people will be able to use email 3.0/Python 2.4), except in
cases where there is a flood of a particular type.

Since you have a patch that works for you, I'm inclined to
leave this unless there are more people bumping into the
problem.  (Once we start patching for malformed messages,
there's really nowhere to stop).

If you feel this is a mistake, say so and I (or another
developer) can probably be convinced otherwise :)

----------------------------------------------------------------------

Comment By: Nathan Kurz (nkurz)
Date: 2004-11-04 07:03

Message:
Logged In: YES 
user_id=965823

Sorry for the lack of response.  After your last comment, I
tried a number of things and intended to report back after
testing it for a while.  Problem seems to be with multipart
messages that have been passed through SpamAssassin and
tagged as spam.  Somehow, the quoting of the multipart
messes up SpamBayes.

Yes, I'm using 1.0rc2.  No, I can't switch currently to
Python 2.4.  The attached patch seems to work for me, at
least I haven't had any apparent problems since applying it
a couple months ago.  Probably kludgy, though, and I am not
a Python programmer.

Thanks for your follow up.

Nathan Kurz

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-11-03 16:52

Message:
Logged In: YES 
user_id=552329

We haven't heard from the original reporter of the bug for some
time.  Without the requested information, there really isn't much
we can do.  If anyone does provide further information, please
also change the bug status back to "Open".

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-09-16 15:15

Message:
Logged In: YES 
user_id=552329

I thought that sb_filter handled these ok with 1.0rc2 - is
that definately the version you are using?

If you are able/willing to use Python 2.4, you will stop
having these problems, BTW.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1019797&group_id=61702


More information about the Spambayes-bugs mailing list