From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#43129: 25.2; Typo in lisp/gnus/nnimap.el Date: Tue, 01 Sep 2020 15:43:58 -0700 Message-ID: <87a6y9azip.fsf@ericabrahamsen.net> References: <87zh6bgsu1.fsf@allyinics.org> <87wo1eep8n.fsf@ericabrahamsen.net> <87k0xdh85s.fsf@allyinics.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17754"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43129@debbugs.gnu.org To: Sean Connor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 02 00:45:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kDF1Z-0004VM-Rb for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Sep 2020 00:45:09 +0200 Original-Received: from localhost ([::1]:40764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDF1Y-0006o5-J4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 18:45:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDF1R-0006nn-Uh for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 18:45:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDF1R-0003F9-L0 for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 18:45:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kDF1R-00084K-I5 for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 18:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Sep 2020 22:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43129 X-GNU-PR-Package: emacs Original-Received: via spool by 43129-submit@debbugs.gnu.org id=B43129.159900025030942 (code B ref 43129); Tue, 01 Sep 2020 22:45:01 +0000 Original-Received: (at 43129) by debbugs.gnu.org; 1 Sep 2020 22:44:10 +0000 Original-Received: from localhost ([127.0.0.1]:57605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDF0b-000830-Mw for submit@debbugs.gnu.org; Tue, 01 Sep 2020 18:44:09 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:57684 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDF0Y-00082b-Ij for 43129@debbugs.gnu.org; Tue, 01 Sep 2020 18:44:08 -0400 Original-Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 8CF05FA30C; Tue, 1 Sep 2020 22:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1599000240; bh=OehrghkvEea/RrHJKnZ/VsKuf02qrFjYOZcqCFe+BhU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=U94b7mcGRi/Eks+cOei5mnhyIuC8sVHZI2RS7R2c+EF7pKLtWFODKdNdVSaG/Cmha lGufnmUV2Z+AYT/K+IxgM3kgy9sjihT9XVc8ZxxipAqhktKJD9oDnk6I7i3NZGTuTX XrDLcPWsTE29/40dnO5c20J01+HzmU3rap+ilJ70= In-Reply-To: <87k0xdh85s.fsf@allyinics.org> (Sean Connor's message of "Tue, 01 Sep 2020 10:40:47 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186893 Archived-At: Sean Connor writes: > Eric Abrahamsen writes: > >> Thanks for this report! Can you tell us which IMAP servers you've >> tested this on? I just tried Dovecot, and the "(cadr result)" fix works >> properly there. Unless we know there are some servers where "(caddr >> result)" is appropriate (I wonder what server Nikolaus was using), I'm >> inclined to put the simpler fix in. > > I was a bit mistaken. My initial tests were on an old server that > didn't support MOVE, so I overlooked something important, the reason for > the change: the COPYUID is given as an "untagged response" for MOVE but > a "tagged response" for COPY [0]. IOW, caddr is what to use for getting > the COPYUID from a response to a MOVE command. > > The COPYUID response is given by both the COPY and MOVE commands. I'd > only been testing the COPY command, oops. And my dovecot test was done in a clean environment where, by default, Gnus doesn't let dovecot use MOVE, so in effect I was only testing COPY as well. Looks like cautious is the way to go! > The cautious patch seems to handle both cases, according to this test > code: > > (mapcar (lambda (imap-response) > (with-temp-buffer > (insert imap-response) > (or > (nnimap-find-uid-response > "COPYUID" (cadr > ;; simulate a call to nnimap-command. > (cons t (nnimap-parse-response)))) > (nnimap-find-uid-response > "COPYUID" (caddr (cons t (nnimap-parse-response))))))) > '( > ;; MOVE result > "* OK [COPYUID 1598849953 2 3] Moved UIDs.\r > * 1 EXPUNGE\r > 1 OK Move completed (0.015 + 0.000 + 0.014 secs).\r" > ;; COPY result > "6 OK [COPYUID 1395967160 10 3] Copy completed.")) Thanks, this is helpful. I feel like the "outer edges" of execution is the wrong place to be checking this stuff -- if the response parsing process handled the differences, this would never have been an issue in the first place. And ugh, this can-move thing is all over the place, and begging to be refactored... But! We will not be drawn down that rabbit hole. It seems to me that changing the code to read: (cons internal-move-group (or (nnimap-find-uid-response "COPYUID" (if can-move (caddr result) (cadr result))) (nnimap-find-article-by-message-id internal-move-group server message-id nnimap-request-articles-find-limit))) Should do the trick here. What do you think? > Sorry for the confusion. This problem is only going to affect those > whose IMAP servers don't support the MOVE extension, which is probably > why it was overlooked. > > I tested with courier, dovecot, RFC sample sessions and gmail IMAP > transcripts, FWIW. That's good to know! That gives us some confidence.