unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 47130@debbugs.gnu.org
Subject: bug#47130: 28.0.50; Gnus: mairix doesn't work anymore
Date: Wed, 17 Mar 2021 20:33:43 -0700	[thread overview]
Message-ID: <87tup9kueg.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <874kh9jtg6.fsf@web.de> (Michael Heerdegen's message of "Wed, 17 Mar 2021 23:39:37 +0100")


On 03/17/21 23:39 PM, Michael Heerdegen wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> 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





  reply	other threads:[~2021-03-18  3:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-14  4:50 bug#47130: 28.0.50; Gnus: mairix doesn't work anymore Michael Heerdegen
2021-03-14  5:02 ` Michael Heerdegen
2021-03-15  4:08   ` Michael Heerdegen
2021-03-15 23:52     ` Eric Abrahamsen
2021-03-16  0:35       ` Michael Heerdegen
2021-03-16  0:50         ` Eric Abrahamsen
2021-03-18  3:42           ` Lars Ingebrigtsen
2021-03-18  4:16             ` Eric Abrahamsen
2021-03-16  3:02       ` Michael Heerdegen
2021-03-16  3:44         ` Eric Abrahamsen
2021-03-16  4:03           ` Michael Heerdegen
2021-03-16 21:46             ` Eric Abrahamsen
2021-03-16 23:31               ` Michael Heerdegen
2021-03-17  1:02           ` Michael Heerdegen
2021-03-17 16:49             ` Eric Abrahamsen
2021-03-17 22:39               ` Michael Heerdegen
2021-03-18  3:33                 ` Eric Abrahamsen [this message]
2022-02-14 23:51                 ` Michael Heerdegen
2022-02-15  0:05                   ` Eric Abrahamsen
2022-02-15  1:08                     ` Michael Heerdegen
2022-02-15  1:25                       ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tup9kueg.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=47130@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).