diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-folder.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 89082fded2..6939587f10 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1853,8 +1853,30 @@ imap_update_summary (CamelFolder *folder, int exists, mi = messages->pdata[seq - first]; if (mi == NULL) { - g_datalist_clear (&data); - continue; + CamelMessageInfo *pmi = NULL; + int j; + + /* This is a kludge around a bug in Exchange + * 5.5 that sometimes claims multiple messages + * have the same UID. See bug #17694 for + * details. The "solution" is to create a fake + * message-info with the same details as the + * previously valid message. Yes, the user + * will have a clone in his/her message-list, + * but at least we don't crash. + */ + + /* find the previous valid message info */ + for (j = seq - first - 1; j >= 0; j--) { + pmi = messages->pdata[j]; + if (pmi != NULL) + break; + } + + g_assert (pmi); + + mi = camel_message_info_new (); + camel_message_info_dup_to (pmi, mi); } uid = g_datalist_get_data (&data, "UID"); |