From b28753b55ce83215b15661d16bfbafe3c8964b2a Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 24 Mar 2015 22:12:58 +0000 Subject: [PATCH] lisp/gnus/nnimap.el: Don't split imap messages back into original group --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/nnimap.el | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 4903796a7ff..724112fe3a5 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Eric Abrahamsen + + * 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-03-23 Ben Bacarisse (tiny change) * nnmh.el (nnmh-request-expire-articles): diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 369d9d36418..c476be6bc8d 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/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.39.5