aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-folder.c14
-rw-r--r--camel/providers/imap/camel-imap-store.c2
2 files changed, 12 insertions, 4 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index f8d3a59594..0b9f785d21 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -1526,6 +1526,12 @@ content_info_get_part_spec (CamelMessageContentInfo *ci)
while (node->parent) {
CamelMessageContentInfo *child;
+ /* FIXME: is this only supposed to apply if 'node' is a multipart? */
+ if (node->parent->parent && header_content_type_is (node->parent->type, "message", "*")) {
+ node = node->parent;
+ continue;
+ }
+
child = node->parent->childs;
for (part = 1; child; part++) {
if (child == node)
@@ -1536,7 +1542,7 @@ content_info_get_part_spec (CamelMessageContentInfo *ci)
part_spec_push (&stack, part);
- len++;
+ len += 2;
while ((part = part / 10))
len++;
@@ -1581,7 +1587,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
camel_multipart_set_boundary (body_mp, NULL);
speclen = strlen (part_spec);
- child_spec = g_malloc (speclen + 16);
+ child_spec = g_malloc (speclen + 17); /* dot + 10 + dot + MIME + nul */
memcpy (child_spec, part_spec, speclen);
if (speclen > 0)
child_spec[speclen++] = '.';
@@ -1607,9 +1613,10 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
content = get_content (imap_folder, uid, part, ci, ex);
}
+
if (!stream || !content) {
- g_free (child_spec);
camel_object_unref (CAMEL_OBJECT (body_mp));
+ g_free (child_spec);
return NULL;
}
@@ -1620,6 +1627,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
ci = ci->next;
}
+
g_free (child_spec);
return (CamelDataWrapper *)body_mp;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index b97f8c0f1a..f45531145d 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -2271,7 +2271,7 @@ camel_imap_store_readline (CamelImapStore *store, char **dest, CamelException *e
#if d(!)0
if (camel_verbose_debug) {
fprintf (stderr, "received: ");
- fwrite (*dest, 1, nread, stderr);
+ fwrite (ba->data, 1, ba->len, stderr);
}
#endif