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#47130: 28.0.50; Gnus: mairix doesn't work anymore Date: Wed, 17 Mar 2021 20:33:43 -0700 Message-ID: <87tup9kueg.fsf@ericabrahamsen.net> References: <87v99u49v2.fsf@web.de> <87r1ki49au.fsf@web.de> <87pn01oy7o.fsf@web.de> <871rcg2cwb.fsf@ericabrahamsen.net> <87blbjg5rv.fsf@web.de> <875z1r2256.fsf@ericabrahamsen.net> <87h7lamw34.fsf@web.de> <87v99pohcp.fsf@ericabrahamsen.net> <874kh9jtg6.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12764"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 47130@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 18 04:34:25 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 1lMjQX-0003Dc-02 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Mar 2021 04:34:25 +0100 Original-Received: from localhost ([::1]:46850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMjQV-0007Zb-Mr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Mar 2021 23:34:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMjQA-0007ZU-8D for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2021 23:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMjQ9-0003A1-Sp for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2021 23:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMjQ9-00013e-Nx for bug-gnu-emacs@gnu.org; Wed, 17 Mar 2021 23:34: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: Thu, 18 Mar 2021 03:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47130 X-GNU-PR-Package: emacs Original-Received: via spool by 47130-submit@debbugs.gnu.org id=B47130.16160384364054 (code B ref 47130); Thu, 18 Mar 2021 03:34:01 +0000 Original-Received: (at 47130) by debbugs.gnu.org; 18 Mar 2021 03:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:44525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMjQ4-00013K-E2 for submit@debbugs.gnu.org; Wed, 17 Mar 2021 23:33:56 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:57354 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMjPz-000131-G6 for 47130@debbugs.gnu.org; Wed, 17 Mar 2021 23:33:55 -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 964A0FA0FB; Thu, 18 Mar 2021 03:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1616038425; bh=KGTmMvgrjDvamsW8zbL0i3H5PRr6nQ2Yn7NQQK/Fx3o=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=gYH+uYwA0WTV9vmXxw7Sp2z+mcfDWNoHB+CHQSEJPDA/suiyHz0NvfRbBPMTaqlTy 8aARzloBkjnxUJl+XY9KwQylr3v6flldz7PcbCfhWwpNLQnkk10wReXM60fCT0Rldu FFnW5VSiUSu32zLv2ed2m/hBAt2LCKKLDEk5j+Ag= In-Reply-To: <874kh9jtg6.fsf@web.de> (Michael Heerdegen's message of "Wed, 17 Mar 2021 23:39:37 +0100") 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:202546 Archived-At: On 03/17/21 23:39 PM, Michael Heerdegen wrote: > Eric Abrahamsen writes: > >> I was finally able to get mairix to index a test server, and searching >> worked just fine. One thing I realized afterwards is that I had set the >> remove-prefix to the directory where the actual mails are kept >> ("/home/eric/Mail"), whereas it looks like you've set it to the >> directory where mairix is supposed to put its search-result symlinks >> ("/home/micha/mairix"). > > Indeed: I changed that and now searching works well! Many thanks, dunno > how long I would have had to continue debugging until I had found that. You would have had to find your way to the definition of `gnus-search-indexed-parse-output', implemented for the `gnus-search-indexed' engine class. Mairix isn't mentioned anywhere around there. Generic functions are awesome, but there can definitely be a discoverability problem. >> This is the main difference between nnmairix and gnus-search with >> mairix: nnmairix actually creates new groups and reads them directly, >> gnus-search returns a list of results that refer to messages on the >> original server. The "-r" option is passed to mairix, which tells it not >> to create its own folders but return the original file names of matched >> results -- that's why remove-prefix has to refer to the underlying >> server. >> >> Hope that makes sense. > > Makes a lot of sense, yes. > >> I suppose I should add a note to the documentation? > > Yes, it would be good to make that clearer. I will add a note to the manual, and probably also some code comments at the top of gnus-search.el, giving hints for bug-hunters. I can close this bug report when that's done. > BTW, I didn't even understand why it is even necessary to provide that. > If Gnus gets absolute names from mairix, why isn't it able to resolve > them in this case? The local-indexed search code conflates the two issues of 1) where is the file that represents a single search results, and 2) how do we get from that file path to an article number that a Gnus server will understand. If you look at the code in the function mentioned above, you'll see the whole process is surprisingly hacky. The "remove-prefix" is chopped off the front of the filepath, then the next part of the filepath is interpreted as a group name, then it attempts to turn the non-directory filename into an article number somehow. If the remove-prefix is wrong, the later code gets a full filepath and doesn't know what to do with it. I think all nnmail-type servers have some config for "directory" or "nnmh-directory" or whatever, and I think there's a good chance that the remove-prefix can be made redundant with this config. I'm a little surprised it works as well as it does! Eric