Check that we really got an article when we requested one.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 02:20:14 +0000 (04:20 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 02:20:14 +0000 (04:20 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 05ff44f..24afe1f 100644 (file)
@@ -2,6 +2,8 @@
 
        * nnimap.el (nnimap-finish-retrieve-group-infos): Protect against
        groups that have no articles.
+       (nnimap-request-article): Check that we really got an article when we
+       requested one.
 
        * gnus-agent.el (gnus-agent-load-alist): Nix out the alist if the file
        doesn't exist.
index 0fe5816..c27b3ec 100644 (file)
@@ -315,7 +315,11 @@ not done by default on servers that doesn't support that command.")
                 (if (member "IMAP4REV1" (nnimap-capabilities nnimap-object))
                     "UID FETCH %d BODY.PEEK[]"
                   "UID FETCH %d RFC822.PEEK")
-                article)))
+                article))
+         ;; Check that we really got an article.
+         (goto-char (point-min))
+         (unless (looking-at "\\* [0-9]+ FETCH")
+           (setq result nil)))
        (let ((buffer (nnimap-find-process-buffer (current-buffer))))
          (when (car result)
            (with-current-buffer (or to-buffer nntp-server-buffer)