Not all servers return UIDNEXT. Work past this problem.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 17 Sep 2010 18:42:44 +0000 (20:42 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Fri, 17 Sep 2010 18:42:44 +0000 (20:42 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 79726b4..75d651c 100644 (file)
@@ -5,6 +5,8 @@
        (nnimap-transform-headers): Get the number of lines in each message.
        (nnimap-retrieve-headers): Query for BODYSTRUCTURE so that we get the
        number of lines.
+       (nnimap-request-list): Not all servers return UIDNEXT.  Work past this
+       problem.
 
        * utf7.el (utf7-encode): Autoload.
 
index eef687c..84f33a7 100644 (file)
@@ -483,13 +483,17 @@ not done by default on servers that doesn't support that command.")
                    (setq exists (string-to-number (car elem)))))
                (when uidnext
                  (setq highest (1- (string-to-number (car uidnext)))))
-               (if (zerop exists)
-                   ;; Empty group.
-                   (insert (format "%S %d %d y\n"
-                                   (utf7-decode group t) highest (1+ highest)))
+               (cond
+                ((null highest)
+                 (insert (format "%S 0 1 y\n" (utf7-decode group t))))
+                ((zerop exists)
+                 ;; Empty group.
+                 (insert (format "%S %d %d y\n"
+                                 (utf7-decode group t) highest (1+ highest))))
+                (t
                  ;; Return the widest possible range.
                  (insert (format "%S %d 1 y\n" (utf7-decode group t)
-                                 (or highest exists))))))))
+                                 (or highest exists)))))))))
        t))))
 
 (defun nnimap-retrieve-group-data-early (server infos)