To handle IMAP Server brokenness, Returning empty body, etc. Fixes #355640
authorSankar P <psankar@novell.com>
Thu, 9 Aug 2007 17:15:36 +0000 (17:15 +0000)
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>
Thu, 9 Aug 2007 17:15:36 +0000 (17:15 +0000)
2007-08-09  Sankar P  <psankar@novell.com>

* camel-imap-folder.c: (parse_fetch_response):
To handle IMAP Server brokenness, Returning empty body, etc.
Fixes #355640 and a lot of duplicates as well.

svn path=/trunk/; revision=7930

camel/providers/imap/ChangeLog
camel/providers/imap/camel-imap-folder.c

index 62919d2..96863cc 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-09  Sankar P  <psankar@novell.com>
+
+       * camel-imap-folder.c: (parse_fetch_response):
+       To handle IMAP Server brokenness, Returning empty body, etc. 
+       Fixes #355640 and a lot of duplicates as well.
+
 2007-07-09  Gilles Dartiguelongue  <gdartigu@svn.gnome.org>
 
        * camel-imap-folder.c: (do_append), (decode_internaldate),
index 5b04ef6..f4a6278 100644 (file)
@@ -2867,7 +2867,10 @@ parse_fetch_response (CamelImapFolder *imap_folder, char *response)
                        response = strchr (response, ' ') + 1;
                        start = response;
                        imap_skip_list ((const char **) &response);
-                       g_datalist_set_data_full (&data, "BODY", g_strndup (start, response - start), g_free);
+                       if (response && (response != start)) {
+                               /* To handle IMAP Server brokenness, Returning empty body, etc. See #355640 */
+                               g_datalist_set_data_full (&data, "BODY", g_strndup (start, response - start), g_free);
+                       }
                } else if (!g_ascii_strncasecmp (response, "UID ", 4)) {
                        int len;