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#49926: [PATCH] Fix NNIMAP search command in the gnus Date: Sun, 08 Aug 2021 12:26:28 -0700 Message-ID: <87eeb391qz.fsf@ericabrahamsen.net> References: <20210807045230.23998-1-jan@stranik.org> <87tuk097of.fsf@ericabrahamsen.net> <8735rjeqo5.fsf@stranik.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="21367"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 49926@debbugs.gnu.org To: Jan Stranik Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 08 21:27:19 2021 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 1mCoS6-0005JB-PL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Aug 2021 21:27:18 +0200 Original-Received: from localhost ([::1]:49750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCoS5-0004cK-3C for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Aug 2021 15:27:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCoRq-0004c8-PL for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2021 15:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCoRq-0001Cv-ID for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2021 15:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCoRq-0003YC-Bu for bug-gnu-emacs@gnu.org; Sun, 08 Aug 2021 15:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Aug 2021 19:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49926 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49926-submit@debbugs.gnu.org id=B49926.162845080313621 (code B ref 49926); Sun, 08 Aug 2021 19:27:02 +0000 Original-Received: (at 49926) by debbugs.gnu.org; 8 Aug 2021 19:26:43 +0000 Original-Received: from localhost ([127.0.0.1]:54854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCoRX-0003Xd-Cs for submit@debbugs.gnu.org; Sun, 08 Aug 2021 15:26:43 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:51398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCoRS-0003XM-0r for 49926@debbugs.gnu.org; Sun, 08 Aug 2021 15:26:41 -0400 Original-Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 630F8FA081; Sun, 8 Aug 2021 19:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1628450790; bh=xrSAjK70jFqz0V/yjwvjYyBo9Ljl3nNes7RVKl4VhSI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=o9tURX7ggBG49aNueYNxuNVnPeVli6QOzGlqlNLDeq5q8KWbSoA0lMyKDfXB655Kj +5p8dDRq/09Tf0oHYVredHdcW/6u3924W4qQaT8TJFh71GZ0e53iXRRab+C/gc9Ksd LQ3UHMXoMrcRbaQYSV2OeV5p7DS2K6NZ5Up2Sidc= In-Reply-To: <8735rjeqo5.fsf@stranik.org> (Jan Stranik's message of "Sun, 08 Aug 2021 14:29:14 -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:211411 Archived-At: On 08/08/21 14:29 PM, Jan Stranik wrote: > On 08/07/21 16:06 PM, Eric Abrahamsen wrote: >> Jan Stranik via "Bug reports for GNU Emacs, the Swiss army knife of text >> editors" writes: >> >>> In the version 27.2 of emacs, the nnimap search commands stopped >>> working in gnus. >>> >>> Good example is a command AT to find a referred >>> thread in the summary buffer. The observed behaviour was that the >>> search command returned no error. >>> >>> The problem turned out to be in the way how imap query is sent to the >>> server. The function nnimap-make-thread-query used a format function >>> with foramt specifier %S. For string values with formatting the string >>> returned is in the format #("string" ....). The result was tha the >>> query sent to the server looked like: >>> 23:52:00 [stranik.org] 1980 UID SEARCH (OR HEADER REFERENCES >>> #("<87pmurac3u.fsf@stranik.org>" 0 28 (ws-butler-chg chg)) HEADER >>> Message-Id #("<87pmurac3u.fsf@stranik.org>" 0 28 (ws-butler-chg >>> chg))) >>> >>> which is an invalid query. >>> >>> The change formats the string with %s specifier which discards text >>> properties. >> >> But that also removes the quoting around the message ids -- are we sure >> that's still valid? (Putting debbugs back in the cc) > You're right. Per the specification, the strings are expected to be > either in literal or quotes syntax > (https://datatracker.ietf.org/doc/html/rfc3501#section-4.3). > > Adding quotes back to make the strings to be in quoted syntax. > > Interestingly, dovecot seems to accept the strings without quotes as > well. I've found dovecot to be generally pretty permissive, though obviously we want to stick closely to the RFCs here. > New patch attached. This seems fine, but just thinking out loud: is there anything else the %S could potentially get us, here? Extra quoting of special characters? Our other option would be to explicitly remove properties from the strings beforehand; I'm just wondering if one approach is preferable over another. Eric