From ffbbdec9909bc08d853d239b798bd33726e6fa82 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/ChangeLog | 4 ++++ lisp/nnimap.el | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2047481..011e3cd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-02-27 Eric Abrahamsen + * 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. + 2015-02-26 Katsumi Yamaoka * gnus-art.el (gnus-mime-inline-part, gnus-mm-display-part): diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 369d9d3..c476be6 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.1