Re: Initial tagging all mail from mailing lists

Subject: Re: Initial tagging all mail from mailing lists

Date: Thu, 15 May 2025 15:39:32 +0200

To: David Bremner, Avid Seeker, notmuch@notmuchmail.org

Cc:

From: Gregor Zattler


Hi David,
* David Bremner <david@tethera.net> [2025-05-15; 15:51 +09]:
> Gregor Zattler <telegraph@gmx.net> writes:
>
>>
>> If you would like to tag all emails from
>> all lists:
>>
>> notmuch tag +news -- 'List:*'
>>
>
> I don't think that part will work correctly. As far as I know you need
> to use a sexp query, as I mentioned in my other message.

It works for me, except for emails which
were indexed before I made this
configuration.

I need help in escaping or quoting ":"
and "," in file names for reindexing
single files in maildirs.

One example of an email which's List-Id
header is not indexed:

$ notmuch search --output=files id:20030813053850.GE16974@lug-owl.de
/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,

$ grep "^List-Id:" /home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit\:2\, 
List-Id: Die Mailingliste der BeLUG (Berliner Linux User Group) <linux-l.mlists.in-berlin.de>

# no output
$ notmuch search --output=messages List:linux-l.mlists.in-berlin.de | grep 20030813053850.GE16974@lug-owl.de

# no hit/match
$ notmuch count List:linux-l.mlists.in-berlin.de  AND id:20030813053850.GE16974@lug-owl.de
0

I would like to reindex this one file
but I do not manage to provide the
correct format of the path: search term:

$ notmuch search --output=files 'path:"/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,"'
notmuch search: A Xapian exception occurred
A Xapian exception occurred parsing query: unmatched regex delimiter in '/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,'
Query string was: path:"/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,"
# no output
$ notmuch search --output=files 'path:"~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,"'
$ notmuch search --output=files 'path:~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,'
$ notmuch search --output=files 'path:"\\/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,"'
$ notmuch search --output=files 'path:"\/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,"'
$ notmuch search --output=files 'path:"~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2,"'
$ notmuch search --output=files 'path:"/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit.*/"'
$ notmuch search --output=files 'path:"/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.*/"'
$ notmuch search --output=files path:/1060758271.3350_0/
$ notmuch search --output=files 'path:/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.*/'
$ notmuch search --output=files 'path:/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.*/'
$ notmuch search --output=files path:~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit\:2\,
$ notmuch search --output=files path:~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit\\:2\\,

It is possible to reindex a single file:

$ cp -a "/home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit:2," /home/grfz/Mail/~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit-to-be-deleted

$ notmuch reindex path:~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit-to-be-deleted

# after reindexing the search now succeeds
$ notmuch count List:linux-l.mlists.in-berlin.de  AND id:20030813053850.GE16974@lug-owl.de
1

$ notmuch search --output=messages List:linux-l.mlists.in-berlin.de | grep 20030813053850.GE16974@lug-owl.de
id:20030813053850.GE16974@lug-owl.de

But strangely I'm not able to search for
this one file:

# no output
$ notmuch search --output=files path:~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit-to-be-deleted
$ notmuch search --output=files 'path:"~ml/linux-l@mlists.in-berlin.de/cur/1060758271.3350_0.pit-to-be-deleted"'


Can you/someone help me with formating /
escaping / quoting filenames in path:
search terms?

Thanks Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: