From dffcefea13b2bd6391c42198494d7e0d874293c8 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 19 Sep 2010 04:20:14 +0200 Subject: [PATCH] Check that we really got an article when we requested one. --- lisp/ChangeLog | 2 ++ lisp/nnimap.el | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05ff44fa6..24afe1f45 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 0fe5816a6..c27b3ec77 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -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) -- 2.34.1