[spambayes-dev] sb_unheader.py bug?

Tony Meyer tameyer at ihug.co.nz
Sat Jul 24 02:44:02 CEST 2004


[Skip Montanaro]
> When run with Python 2.3 it works just fine.  I thought I saw some 
> checkins related to a change in Python 2.4.  Could this be another 
> manifestation of that problem?  Any clues appreciated.

[Neil Schemenauer]
> I believe the 'email' package is significantly changed in 
> 2.4.  On mail.python.org I noticed that it did not parse 
> messages that used '\r\n' as line endings.  I notified Barry 
> but I guess I should file a bug too.

Was this pre a1?  2.4a1 seems to parse \r\n endings ok for simple messages,
at least:

Python 2.4a1 (#54, Jul  8 2004, 11:30:13) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import email
>>> msg = email.message_from_string("Subject: Test\r\n\r\nTest
Message.\r\n")
>>> msg.as_string()
'Subject: Test\n\nTest Message.\r\n'
>>> msg["Subject"]
'Test'
>>> msg.get_payload()
'Test Message.\r\n'

Although it has converted the header endings to '\n' (and since messages
sent are meant to use \r\n, that means you need to do an appropriate replace
before sending out a msg.as_string() - but sb_server and sb_imapfilter do
this already, anyway).

If there is a \r\n problem (with multipart, for example), then this would
cause SpamBayes lots of strife, because we ensure that all the line endings
*are* \r\n.  I haven't noticed it with 2.4a1, but have done very limited
testing.  If you can find a problem with a1, then definitely +1 to filing a
bug, too.

=Tony Meyer



More information about the spambayes-dev mailing list