From 4392191f4f48cf83d7ae44a3bfd3a51db472783a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 3 Apr 2001 21:46:32 +0000 Subject: (imap_get_message): If the server_level < IMAP4rev1, always fetch messages all-at-once, since they don't support the [#.MIME] syntax. svn path=/trunk/; revision=9145 --- camel/providers/imap/camel-imap-folder.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'camel/providers/imap') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 0a8f0edd66..b05dcfb5e4 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -947,6 +947,7 @@ static CamelMimeMessage * imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex) { CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder); + CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); CamelMessageInfo *mi; CamelMimeMessage *msg; CamelStream *stream; @@ -954,8 +955,11 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex) mi = camel_folder_summary_uid (folder->summary, uid); g_return_val_if_fail (mi != NULL, NULL); - /* Fetch small messages directly. */ - if (mi->size < IMAP_SMALL_BODY_SIZE) { + /* If the message is small, or the server doesn't support + * IMAP4rev1, fetch it in one piece. + */ + if (mi->size < IMAP_SMALL_BODY_SIZE || + store->server_level < IMAP_LEVEL_IMAP4REV1) { camel_folder_summary_info_free (folder->summary, mi); stream = camel_imap_folder_fetch_data (imap_folder, uid, "", FALSE, ex); if (!stream) @@ -972,7 +976,6 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex) * an empty content struct.) */ if (!mi->content->type) { - CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); CamelImapResponse *response; GData *fetch_data; char *body, *found_uid; -- cgit