Content-type: text; charset=iso-8859-1
Here's what happens when i try to fetch the BODYSTRUCTURE:
On page 61 of RFC 2060, it says:
"A body type of type TEXT contains, immediately after the basic fields, the size of the body in text lines. Note that this size is the size in its content transfer encoding and not the resulting size after any decoding."
But here, courier failed to returned the size of the body in text lines. The field immediately following the basic fields (which ends with the size in octets, 1270 in this case), is NIL.
I agree that the message was malformed, it should have had the Content-Type: as text/plain or something, but in the handling of this malformed message it seems that courier didn't correctly follow the RFC by specifying the mime type as text and not supplying # lines.
I created the following patch which has fixed the problem for me. It was created against the courier sources in debian version 0.47-3, but it sould apply cleanly to the current courier-imap sources.
--------
diff -ru courier-0.47/imap/msgbodystructure.c courier-0.47-fixbodystructure/imap/msgbodystructure.c
--- courier-0.47/imap/msgbodystructure.c 2002-09-20 08:22:48.000000000 -0400
+++ courier-0.47-fixbodystructure/imap/msgbodystructure.c 2005-02-25 17:51:26.000000000 -0500
@@ -206,7 +206,7 @@
(content_type_s[1] == 'e' || content_type_s[1] == 'E') &&
(content_type_s[2] == 'x' || content_type_s[2] == 'X') &&
(content_type_s[3] == 't' || content_type_s[3] == 'T') &&
- content_type_s[4] == '/')
+ !isalnum( content_type_s[4] ) )
{
(*writefunc)(" ", 1);
sprintf(buf, "%lu", (unsigned long)nbodylines);