Don't split imap messages back into original group
authorEric Abrahamsen <eric@ericabrahamsen.net>
Wed, 18 Feb 2015 09:51:37 +0000 (17:51 +0800)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Tue, 24 Mar 2015 15:18:30 +0000 (23:18 +0800)
* 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
lisp/nnimap.el

index b975dc7..72202b1 100644 (file)
        (gnus-registry-remove-extra-data): Use slot names rather than initarg
        names in `oref' and `oset'.
 
+2015-02-27  Eric Abrahamsen  <eric@ericabrahamsen.net>
+       * 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-25  Adam Sj√łgren  <asjo@koldfront.dk>
 
        * message.el (message-insert-formatted-citation-line): Change %F to
index 369d9d3..c476be6 100644 (file)
@@ -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))