From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/71280 Path: news.gmane.org!not-for-mail From: Andrew Cohen Newsgroups: gmane.emacs.gnus.general Subject: Re: More IMAP testing, please Date: Tue, 21 Sep 2010 07:49:38 -0400 Message-ID: <877hifuxil.fsf@andy.bu.edu> References: <874odl5jhk.fsf@uwo.ca> <877hig40q9.fsf@uwo.ca> <8762xzzyww.fsf@uwo.ca> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285069845 8408 80.91.229.12 (21 Sep 2010 11:50:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Sep 2010 11:50:45 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M19653@lists.math.uh.edu Tue Sep 21 13:50:41 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oy1Mu-0002d7-HF for ding-account@gmane.org; Tue, 21 Sep 2010 13:50:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Oy1MB-0000VB-Bj; Tue, 21 Sep 2010 06:49:55 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Oy1M9-0000Ut-JO for ding@lists.math.uh.edu; Tue, 21 Sep 2010 06:49:53 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Oy1M4-0002yO-0A for ding@lists.math.uh.edu; Tue, 21 Sep 2010 06:49:53 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1Oy1M3-0003CY-00 for ; Tue, 21 Sep 2010 13:49:47 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Oy1M3-0002JV-0F for ding@gnus.org; Tue, 21 Sep 2010 13:49:47 +0200 Original-Received: from andy.bu.edu ([128.197.41.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Sep 2010 13:49:46 +0200 Original-Received: from cohen by andy.bu.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Sep 2010 13:49:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 68 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: andy.bu.edu User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:DSic/9DsEDxN9U8kEg7rODmab88= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:71280 Archived-At: >>>>> "Dan" == Dan Christensen writes: Dan> There are still some bugs with `B m'. The most serious one is Dan> that if I try to use `B m' to move a message from an IMAP group Dan> to that same IMAP group, then *all* articles in the IMAP group Dan> lose their Seen flags, gnus-expire flags, and maybe other flags Dan> too. I think this sequence of commands are the relevant ones, Dan> and commands 330 and 331 look particularly suspicious to me. The message-id in nnimap-request-move-article is not getting set properly. There are two issues: 1. The article headers need to be fetched first, since we may not be looking at the article. 2. message-field-value doesn't strip the carriage return at the end. My elisp is terrible but this seems to work for me. I've changed message-field-value and I don't know if this has negative consequences somewhere else. diff --git a/lisp/message.el b/lisp/message.el index f3697eb..0e6d6d5 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1959,6 +1959,8 @@ see `message-narrow-to-headers-or-head'." (when value (while (string-match "\n[\t ]+" value) (setq value (replace-match " " t t value))) + (while (string-match "\r$" value) + (setq value (replace-match "" t t value))) value))) (defun message-field-value (header &optional not-all) diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 434ad01..3196c0f 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -459,7 +459,25 @@ textual parts.") (when (nnimap-possibly-change-group group server) ;; If the move is internal (on the same server), just do it the easy ;; way. - (let ((message-id (message-field-value "message-id"))) +; (let ((message-id (message-field-value "message-id"))) + (let ((message-id + (with-current-buffer (nnimap-buffer) + (nnimap-send-command "SELECT %S" (utf7-encode group t)) + (erase-buffer) + (nnimap-wait-for-response + (nnimap-send-command + "UID FETCH %s %s" + article + (format "(UID RFC822.SIZE BODYSTRUCTURE %s)" + (format + (if (member "IMAP4REV1" + (nnimap-capabilities nnimap-object)) + "BODY.PEEK[HEADER.FIELDS %s]" + "RFC822.HEADER.LINES %s") + '(Message-Id) + ))) + t) + (message-field-value "message-id")))) (if internal-move-group (let ((result (with-current-buffer (nnimap-buffer)