Index: camel-folder-summary.c
===================================================================
--- camel-folder-summary.c	(revision 7657)
+++ camel-folder-summary.c	(working copy)
@@ -3060,7 +3060,7 @@ info_set_flags(CamelMessageInfo *info, g
 			camel_folder_summary_touch(mi->summary);
 	}
 
-	if ((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK))
+	if (((old & ~CAMEL_MESSAGE_SYSTEM_MASK) == (mi->flags & ~CAMEL_MESSAGE_SYSTEM_MASK)) && !((set & CAMEL_MESSAGE_JUNK_LEARN) && !(set & CAMEL_MESSAGE_JUNK)))
 		return FALSE;
 
 	if (mi->summary && mi->summary->folder && mi->uid) {
