A NOTE has been added to this issue. ====================================================================== http://www.dbmail.org/mantis/view.php?id=533 ====================================================================== Reported By: idk Assigned To: ====================================================================== Project: DBMail Issue ID: 533 Category: IMAP daemon Reproducibility: always Severity: minor Priority: normal Status: new target: ====================================================================== Date Submitted: 13-Mar-07 17:17 CET Last Modified: 17-Mar-07 01:54 CET ====================================================================== Summary: Socket connection drops down after trying to fetch of nonexistent message body part Description: Message with two parts (see additional information for example):
a uid fetch 540962 body[1] * 92 FETCH (UID 540962 BODY[1] NIL ) a OK UID FETCH completed a uid fetch 540962 body[2] * 92 FETCH (UID 540962 BODY[2] {218} JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29k U2l6ZSAyOSAvUm9vdCAxIDAgUiAvSW5mbyAyIDAgUgovSUQgWyjTdpjn/EkhpgW6t5bht6urKSjT dpjn/EkhpgW6t5bht6urKV0KPj4Kc3RhcnR4cmVmCjI2MzU5CiUlRU9GCg== ) a OK UID FETCH completed a uid fetch 540962 body[3] * 92 FETCH (UID 540962 After this (UID number) connection drops down and into dbmail.err is logged: (process:22110): gmime-CRITICAL **: g_mime_object_get_content_type: assertion `GMIME_IS_OBJECT (object)' failed dbmail-imapd: misc.c:2293: imap_get_partspec: Assertion `object' failed. On first fetch server replies "(UID 540962 BODY[1] NIL )", is that correct? On this message SquirrelMail fails (expect {length} instead of NIL): if (ereg('\\{([^\\}]*)\\}', $topline, $regs)) ... else ... echo "Body retrieval error. The reason for this is most probably that the message is malformed." (I don't know IMAP specification well). ====================================================================== ---------------------------------------------------------------------- aaron - 17-Mar-07 00:41 ---------------------------------------------------------------------- misc.c, imap_get_partspec doesn't look like it handles all of its error cases. I think the assertions are invalid because they are not restricted to the results of strictly internally generated data. With user-specified data, we should be gracefully handling error conditions. What IMAP response should we give to a request for a nonexistent bodypart? NIL with OK or just plain BAD? ---------------------------------------------------------------------- aaron - 17-Mar-07 00:57 ---------------------------------------------------------------------- Please test SVN 2471 and post logs! I want to see some of the new imap_get_partspec info messages :-) ---------------------------------------------------------------------- idk - 17-Mar-07 01:54 ---------------------------------------------------------------------- I mean there is existent bodypart, it has some headers and one empty line - five header lines ended by CRLF CRLF, then nothing ended by CRLF, and delimitor for next part, so body will be or zerolength string, or two octets (CR and LF). So if we'll be consensual this is a body with zero octects, I mean the correct response is (UID 123456 BODY[1] "") or (UID 123456 BODY[1] {0}). For consistency I prefer the second form. >From upgrading to 2470 I had got no error message (like ones above). I saw some relevant changes in svn (rev. 2466? 2468? my connection to svn server is now down, I cannot check this), this will be the reason for errors stop. A captured logs in level 5 for FETCH BODY[1], but it is useless for this. I will upload them. Issue History Date Modified Username Field Change ====================================================================== 13-Mar-07 17:17 idk New Issue 17-Mar-07 00:41 aaron Note Added: 0001914 17-Mar-07 00:57 aaron Note Added: 0001915 17-Mar-07 01:54 idk Note Added: 0001916 ====================================================================== _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://twister.fastxs.net/mailman/listinfo/dbmail-dev