Subject: bug#44509: 28.0.50; Error querying with new gnus-search and notmuch

From: Eric Abrahamsen <[email-masked]>
Date: Sat, 07 Nov 2020 20:53:14 -0800

On 11/08/20 02:49 AM, Jose A. Ortega Ruiz wrote:
> On Sat, Nov 07 2020, Eric Abrahamsen wrote:
>
>> "Jose A. Ortega Ruiz" <[email-masked]> writes:
>>
>>> Hi,
>>>
>>> I've been trying the recently added gnus-search with an nnimap local
>>> server (dovecot) that i index with notmuch.  More concretely:
>>
>> I'm curious if this used to work before gnus-search? My understanding is
>> that it never should have worked: notmuch returns search results as
>> filenames on your local system, while dovecot wants search results
>> returned as its own internal message UIDs.
>>
>> If this worked before gnus-search, I would very much like to know that,
>> and to know *how* it worked, given that it's two systems that aren't
>> meant to talk to one another.
>
> I would have sworn it worked, but now you make me doubt it.  I think the
> gist might be that I am telling dovecot to store its mails in maildirs,
> and there the filenames are essentially the maildir followed by the
> message id.
>
> But if that doesn't make sense, i might be misremembering.  I'll have to
> go back to a previous commit, recompile and check again.

It's something that's come up on gnus.general several times over the
years, but I think no one's ever sat down and tried to figure out
exactly how/if it's supposed to work. Thinking about it logically, I
just don't see how it could. On my filesystem (in the maildir maintained
by Dovecot), your message has the filename:

1604808232.M340024P65055.slip,S=3293,W=3369:2,a

And that's how notmuch will return it. If I search for the same message
via Dovecot's internal search, the UUID is 1116. Is there anything to go
from one to the other?

In a few days I can try to set this up and see if there's a way to make
it work.

(BTW have you turned on full text search in your local Dovecot? That
makes imap searches "fast enough" for me, though I doubt they're as fast
as notmuch.)