Re: It would happen parse imap bodystructure error from GMAIL IMAP server response while libetpan send IMAP BODYSTRUCTURE command

"DINH Viêt Hoà" <[email protected]> Wed, 9 Jan 2008 09:06:03 +0100
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
On 1/9/08, [email protected] <[email protected]> wrote:
>
> Hi, libetpan guys
>
>  I set mailstream_debug = 1 to dump mailstream
>
>  It seem like happen parse imap bodystructure error from GMAIL IMAP server
> response
>  while libetpan send send IMAP BODYSTRUCTURE command

Hello,

There is a problem both on gmail IMAP server side and in libetpan IMAP cache.
Could you try to use non-cached driver to verify that it works properly ?

Additionally, could you verify that the attached patch will fix the
problem on libetpan side ?

Thanks,

-- 
DINH Viêt Hoà

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

_______________________________________________
Libetpan-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libetpan-users
libetpan-boundary.patch (application/octet-stream, 2.2 KB)
Index: src/low-level/mime/mailmime_types_helper.c
===================================================================
RCS file: /cvsroot/libetpan/libetpan/src/low-level/mime/mailmime_types_helper.c,v
retrieving revision 1.27
diff -u -r1.27 mailmime_types_helper.c
--- src/low-level/mime/mailmime_types_helper.c	27 Oct 2007 10:08:26 -0000	1.27
+++ src/low-level/mime/mailmime_types_helper.c	8 Jan 2008 23:39:54 -0000
@@ -507,7 +507,7 @@
 
 #define MAX_MESSAGE_ID 512
 
-static char * generate_boundary()
+char * mailmime_generate_boundary(void)
 {
   char id[MAX_MESSAGE_ID];
   time_t now;
@@ -576,7 +576,7 @@
     if (attr_name == NULL)
       goto free_list;
 
-    boundary = generate_boundary();
+    boundary = mailmime_generate_boundary();
     attr_value = boundary;
     if (attr_name == NULL) {
       free(attr_name);
Index: src/low-level/mime/mailmime_types_helper.h
===================================================================
RCS file: /cvsroot/libetpan/libetpan/src/low-level/mime/mailmime_types_helper.h,v
retrieving revision 1.16
diff -u -r1.16 mailmime_types_helper.h
--- src/low-level/mime/mailmime_types_helper.h	1 Jun 2005 12:22:19 -0000	1.16
+++ src/low-level/mime/mailmime_types_helper.h	8 Jan 2008 23:39:56 -0000
@@ -190,6 +190,9 @@
 struct mailmime_fields * mailmime_fields_new_filename(int dsp_type,
     char * filename, int encoding_type);
 
+LIBETPAN_EXPORT
+char * mailmime_generate_boundary(void);
+
 #ifdef __cplusplus
 }
 #endif
Index: src/low-level/mime/mailmime_write_generic.c
===================================================================
RCS file: /cvsroot/libetpan/libetpan/src/low-level/mime/mailmime_write_generic.c,v
retrieving revision 1.9
diff -u -r1.9 mailmime_write_generic.c
--- src/low-level/mime/mailmime_write_generic.c	25 Nov 2007 14:56:58 -0000	1.9
+++ src/low-level/mime/mailmime_write_generic.c	8 Jan 2008 23:39:56 -0000
@@ -779,8 +779,11 @@
     if (build_info->mm_type == MAILMIME_MULTIPLE) {
       boundary = mailmime_extract_boundary(build_info->mm_content_type);
       if (boundary == NULL) {
-        res = MAILIMF_ERROR_INVAL;
-        goto err;
+        boundary = mailmime_generate_boundary();
+        if (boundary == NULL) {
+          res = MAILIMF_ERROR_MEMORY;
+          goto err;
+        }
       }
     }