From 4f4bc581d6124bc41354e3394daa7b2af1bf71d3 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Thu, 30 Sep 2010 18:42:26 +0200 Subject: [PATCH] Use EXAMINE instead of SELECT to get the message-id. --- lisp/ChangeLog | 3 +++ lisp/nnimap.el | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5129e914e..78993edfc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-09-30 Lars Magne Ingebrigtsen + * nnimap.el (nnimap-find-article-by-message-id): Use EXAMINE instead of + SELECT to get the message-id. + * mail-source.el (mail-sources): Removed webmail support. (defvar): Ditto. (mail-source-fetcher-alist): Ditto. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index d7c48823d..241dc7de8 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -729,16 +729,19 @@ textual parts.") (defun nnimap-find-article-by-message-id (group message-id) - (when (nnimap-possibly-change-group group nil) - (with-current-buffer (nnimap-buffer) - (let ((result - (nnimap-command "UID SEARCH HEADER Message-Id %S" message-id)) - article) - (when (car result) - ;; Select the last instance of the message in the group. - (and (setq article - (car (last (assoc "SEARCH" (cdr result))))) - (string-to-number article))))))) + (with-current-buffer (nnimap-buffer) + (erase-buffer) + (setf (nnimap-group nnimap-object) nil) + (nnimap-send-command "EXAMINE %S" (utf7-encode group t)) + (let ((sequence + (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) + article result) + (setq result (nnimap-wait-for-response sequence)) + (when (car result) + ;; Select the last instance of the message in the group. + (and (setq article + (car (last (assoc "SEARCH" (cdr result))))) + (string-to-number article)))))) (defun nnimap-delete-article (articles) (with-current-buffer (nnimap-buffer) -- 2.34.1