diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 90ee0d4..3852e71 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -3041,6 +3041,8 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
 
 done:
 	if (msg) {
+		gboolean has_attachment;
+
 		/* FIXME, this shouldn't be done this way. */
 		camel_medium_set_header (CAMEL_MEDIUM (msg), "X-Evolution-Source", store->base_url);
 
@@ -3059,8 +3061,13 @@ done:
 			}
 		}
 
-		if ((mi->info.flags & CAMEL_MESSAGE_ATTACHMENTS) && !camel_mime_message_has_attachment (msg)) {
-			mi->info.flags = mi->info.flags & ~CAMEL_MESSAGE_ATTACHMENTS;
+		has_attachment = camel_mime_message_has_attachment (msg);
+		if (((mi->info.flags & CAMEL_MESSAGE_ATTACHMENTS) && !has_attachment) ||
+		    ((mi->info.flags & CAMEL_MESSAGE_ATTACHMENTS) == 0 && has_attachment)) {
+			if (has_attachment)
+				mi->info.flags = mi->info.flags | CAMEL_MESSAGE_ATTACHMENTS;
+			else
+				mi->info.flags = mi->info.flags & ~CAMEL_MESSAGE_ATTACHMENTS;
 			mi->info.dirty = TRUE;
 
 			if (mi->info.summary)
