From d45e03d434942a883ee67ee5a120cdd04c62c59a Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Wed, 18 Feb 2015 17:51:37 +0800 Subject: [PATCH] Don't split imap messages back into original group * lisp/nnimap.el (nnimap-split-incoming-mail): If a message is already in the group it should be split to, don't re-copy it into the group. --- lisp/nnimap.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 6904e0a..9f89f39 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -2086,12 +2086,15 @@ Return the server's response to the SELECT or EXAMINE command." (ranges (cdr spec))) (if (eq group 'junk) (setq junk-articles ranges) - (push (list (nnimap-send-command - "UID COPY %s %S" - (nnimap-article-ranges ranges) - (utf7-encode group t)) - ranges) - sequences)))) + ;; Don't copy if the message is already in its + ;; target group. + (unless (string= group nnimap-inbox) + (push (list (nnimap-send-command + "UID COPY %s %S" + (nnimap-article-ranges ranges) + (utf7-encode group t)) + ranges) + sequences))))) ;; Wait for the last COPY response... (when sequences (nnimap-wait-for-response (caar sequences)) -- 2.3.0