Index: lisp/nnimap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v retrieving revision 7.13 diff -u -u -r7.13 nnimap.el --- lisp/nnimap.el 26 Oct 2004 17:40:05 -0000 7.13 +++ lisp/nnimap.el 11 Jan 2005 08:53:24 -0000 @@ -1452,14 +1452,23 @@ (defun nnimap-expiry-target (arts group server) (unless (eq nnmail-expiry-target 'delete) - (with-temp-buffer - (dolist (art arts) - (nnimap-request-article art group server (current-buffer)) - ;; hints for optimization in `nnimap-request-accept-article' - (let ((nnimap-current-move-article art) - (nnimap-current-move-group group) - (nnimap-current-move-server server)) - (nnmail-expiry-target-group nnmail-expiry-target group)))) + (if (and (not (functionp nnmail-expiry-target)) + (gnus-server-equal (gnus-group-method nnmail-expiry-target) + (gnus-server-to-method + (format "nnimap:%s" server)))) + ;; moving article within same server, speed it up... + (and (nnimap-possibly-change-group group) + (imap-message-copy (imap-range-to-message-set arts) + (gnus-group-short-name nnmail-expiry-target) + 'dontcreate nil nnimap-server-buffer)) + (with-temp-buffer + (dolist (art arts) + (nnimap-request-article art group server (current-buffer)) + ;; hints for optimization in `nnimap-request-accept-article' + (let ((nnimap-current-move-article art) + (nnimap-current-move-group group) + (nnimap-current-move-server server)) + (nnmail-expiry-target-group nnmail-expiry-target group))))) ;; It is not clear if `nnmail-expiry-target' somehow cause the ;; current group to be changed or not, so we make sure here. (nnimap-possibly-change-group group server)))