Subject: bug#20671: closed (Fixed)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 01 Jan 2017 19:13:02 +0000

Your bug report

#20671: [PATCH] Use IMAP MOVE extension if available

which was filed against the gnus package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
20671: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20671
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Fixed
From: Nikolaus Rath <[email-masked]>
To: [email-masked]
Date: Sun, 01 Jan 2017 11:12:03 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in commit fc9206b73a254a400245578b94542cfe82c68e9c

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

Subject: [PATCH] Use IMAP MOVE extension if available
From: Nikolaus Rath <[email-masked]>
To: [email-masked]
Date: Tue, 26 May 2015 20:24:08 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

[ Apologies for the duplicate messages, I've confused [email-masked] with
[email-masked] ]

Hello,

Currently Gnus uses a combination of COPY, STORE + EXPUNGE to move
messages from one imap group into another.

The attached patch enables the use of the MOVE command instead if the
server supports it.

Thanks for considering.

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

--- nnimap.el.bak	2015-05-25 11:04:15.671769838 -0700
+++ nnimap.el	2015-05-25 12:58:27.051313588 -0700
@@ -881,17 +882,19 @@
       ;; way.
       (let ((message-id (message-field-value "message-id")))
 	(if internal-move-group
-	    (let ((result
-		   (with-current-buffer (nnimap-buffer)
-		     (nnimap-command "UID COPY %d %S"
-				     article
-				     (utf7-encode internal-move-group t)))))
-	      (when (car result)
-		(nnimap-delete-article article)
-		(cons internal-move-group
-		      (or (nnimap-find-uid-response "COPYUID" (cadr result))
-			  (nnimap-find-article-by-message-id
-			   internal-move-group server message-id
+            (with-current-buffer (nnimap-buffer)
+              (let* ((can-move (nnimap-capability "MOVE"))
+                    (command (if can-move
+                                 "UID MOVE %d %S"
+                               "UID COPY %d %S"))
+                    (result (nnimap-command command article
+                                            (utf7-encode internal-move-group t))))
+                (when (and (car result) (not can-move))
+                  (nnimap-delete-article article))
+                (cons internal-move-group
+                      (or (nnimap-find-uid-response "COPYUID" (cadr result))
+                          (nnimap-find-article-by-message-id
+                           internal-move-group server message-id
                            nnimap-request-articles-find-limit)))))
 	  ;; Move the article to a different method.
 	  (let ((result (eval accept-form)))