[Spambayes] content-type causing sb_filter.py to bail out

Adam J. Henry hank at marinar.com
Mon Apr 26 16:40:20 EDT 2004


Spambayes1.0b1.1
Python2.3

When these lines are in the body of an email message:

	Content-Type: text/html;
		boundary="--7615487063415977"

sb_filter.py spits out the following error:

	Traceback (most recent call last):
	  File "/usr/bin/sb_filter.py", line 256, in ?
	    main()
	  File "/usr/bin/sb_filter.py", line 248, in main
	    action(msg)
	  File "/usr/bin/sb_filter.py", line 180, in filter
	    return self.h.filter(msg)
	  File "/usr/lib/python2.3/site-packages/spambayes/hammie.py", line
	146, in filter
	    return msg.as_string(unixfrom=(msg.get_unixfrom() is not None))
	  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 102, in flatten
	    self._write(msg)
	  File "/usr/lib/python2.3/email/Generator.py", line 130, in _write
	    self._dispatch(msg)
	  File "/usr/lib/python2.3/email/Generator.py", line 156, in _dispatch
	    meth(msg)
	  File "/usr/lib/python2.3/email/Generator.py", line 199, in
	_handle_text
	    raise TypeError, 'string payload expected: %s' % type(payload)
	TypeError: string payload expected: <type 'list'>

I have verified the same behavior with Spambayes1.0a7 as well as the
version from CVS (200404261633).  I have attached the whole message that
originally suggested this problem.

Perhaps the format of the above Content-Type: header is in violation
with header syntax.  Does anyone know for sure while I gather time to
read the appropriate RFC?  If this is the case, I bet there is a way to
block this stuff at the MTA before filtering.

hank
-------------- next part --------------
>From rxsztts at xtra.co.nz Mon Apr 26 15:01:53 2004
Return-path: <rxsztts at xtra.co.nz>
Envelope-to: postmaster at marinar.com
Delivery-date: Mon, 26 Apr 2004 15:01:53 -0400
Received: from ponyexpress.marinar.com ([65.255.160.216] helo=mail.mwweb.com)
	by intrepid.marinar.com with esmtp (Exim 4.31)
	id 1BI7GB-0000lV-TY
	for postmaster at marinar.com; Mon, 26 Apr 2004 10:39:03 -0400
Received: from SMTP32-FWD by mail.mwweb.com
  (SMTP32) id A000002A0; Mon, 26 Apr 2004 10:36:07 -0400
Received: from intrepid.marinar.com [65.255.160.16] by mail.mwweb.com with ESMTP
  (SMTPD32-6.06) id AE545B400DA; Mon, 26 Apr 2004 10:36:07 -0400
Received: from mail by intrepid.marinar.com with spam-scanned (Exim 4.31)
	id 1BI7GA-0000kt-Oe; Mon, 26 Apr 2004 10:39:02 -0400
Received: from wbar10.tampa1-4-7-051-144.tampa1.dsl-verizon.net ([4.7.51.144])
	by intrepid.marinar.com with smtp (Exim 4.31)
	id 1BI7G8-0000fG-Rv; Mon, 26 Apr 2004 10:39:02 -0400
Received: from 182.50.168.47 by web307.mail.yahoo.com; Mon, 26 Apr 2004 08:39:22 -0700
Message-ID: <QHHPQXPFYNHJXQZIWOPY at cox.net>
From: "Cedric Terry" <rxsztts at xtra.co.nz>
To: kenray at mwweb.com, postmaster at mwweb.com, kjones at mwweb.com
Subject: Change your Future. Re-Finance Now!
Date: Mon, 26 Apr 2004 08:36:22 -0700
MIME-Version: 1.0
Content-Type: text/html;
	boundary="--7615487063415977"
X-CS-IP: 213.170.38.228
X-Spam-Status: No, hits=1.7 required=8.0
	tests=HTML_20_30,HTML_FONT_COLOR_GRAY,MIME_HTML_ONLY
	version=2.54
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 2.54 (1.174.2.17-2003-05-11-exp)

----7615487063415977
Content-Type: text/html;
Content-Transfer-Encoding: 7Bit

<html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><p>If you are paying more than 6% on your mort.gage, we can slash your payment!
<p>
GUARANTEED LOWEST RA.TES ON THE PLANET
<p>
APPROVAL REGARDLESS OF C.REDIT HISTORY!
<p>
Start saving today
<p>
<b><a href="http://www.expeditemortgage.net/?mal">Show Me The Lowest Ra.tes</a></b>
<p><font color=#CCCCCC>mamma mushroom proverb tartary anatole iranian steven adjudge hemispheric chelate johannesburg medici imperative henbane draftsman woe upheaval adulate assign stubble trodden carruthers thresh edelweiss thorny amplitude legitimate necromancy thompson axes washout amongst discuss  today'll annulling eigenspace tabulate snip buffoon charisma complicate artemis bridget calorimeter agree pandemonium tableland enumerate hanukkah exhilarate bullish arachnid carborundum songbag dig darn turbofan bergstrom acuity cigar </font> <p><p><a href="http://www.expeditemortgage.net/100/">re.move</a><p>
</html>

----7615487063415977--




More information about the Spambayes mailing list