From: Taylor R Campbell Date: Sun, 27 Jun 2010 22:18:10 +0000 (+0000) Subject: Work around a buggy IMAP server that returns bogus UNSEEN counts. X-Git-Tag: 20100708-Gtk~9 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c6072e2314cca7dad2b691797c8ea7db59d657da;p=mit-scheme.git Work around a buggy IMAP server that returns bogus UNSEEN counts. --- diff --git a/src/imail/imail-imap.scm b/src/imail/imail-imap.scm index f88b80981..333b1d2c7 100644 --- a/src/imail/imail-imap.scm +++ b/src/imail/imail-imap.scm @@ -2298,7 +2298,11 @@ USA. (vector-ref (imap-folder-messages folder) index)) (define-method first-unseen-message-index ((folder )) - (or (imap-folder-unseen folder) 0)) + (or (let ((unseen (imap-folder-unseen folder))) + (and unseen + (< unseen (folder-length folder)) + unseen)) + 0)) (define-method expunge-deleted-messages ((folder )) (imap:command:expunge (guarantee-imap-folder-open folder)))