On Wed, 26 Mar 2025 20:18:50 +0100, Roland Rosenfeld wrote:
Here's a module I'm using locally since quite some time, in addition to other modules, and which might be useful for other notmuch users as well:
Many thanks for your contribution!
Thanks for the nice tool, and for your quick reply!
I fear that this won't make it into trixi since I try to start with some test cases before I add new modules to lbdb in the meantime.
No worries, that makes perfect sense.
I did some early tests with notmuch-addrlookup and noted some (for me) unexpected effects like looking up "example" returns only two lines (with "example.org"), while looking up "example.com" returns 15 lines with the same test database and config.
That's indeed weird … I don't find anything with example{,.com}, but: % notmuch-addrlookup debian | wc -l 6 % notmuch-addrlookup debian.org | wc -l 6 (And the results are the same.)
In contrast to this "notmuch address" returns 15 lines for "example.com" and 16 lines for "example".
I never used "notmuch address" but it feels a bit weird to me. % notmuch address debian | wc -l 2083 % notmuch address debian | grep -i debian | wc -l 586Looking at the latter list, this feels more realistic than the 6 from notmuch-addrlookup; but still without grepping for /debian/i it's a bit random.
Probably this needs some search terms … % notmuch address from:debian | wc -l 583 This looks quite good. % notmuch address from:debian | grep -i debian | wc -l 581 2 less? Well, almost :)% notmuch address to:debian | wc -l 1637
% notmuch address to:debian | grep -i debian | wc -l 546 Also not bad but only after filtering … % notmuch address to:debian or from:debian | wc -l 1677% notmuch address to:debian or from:debian | grep -i debian | wc -l 586
Hm, hm, maybe something like that?
Seems that this needs some deeper digging including the question whether to use "notmuch address" vs." notmuch-addrlookup". Maybe this will result in some bug report against notmuch-addrlookup (after I understand the root cause).
Right, I didn't know "notmuch address" and I'm now surprised about the huge difference of numbers between it and notmuch-addrlookup (maybe that has something to do with my notmuch usage?)
Then there's also the question of how to handle special cases of empty or strangely quoted real names and mail addresses. Here the "--format=mutt" (since 0.10 or "--mutt" until version 0.9) option may of notmuch-addrlookup may have some benefits, but with some sed voodoo also "notmuch address" output may be possible.
I don't remember any problems with "notmuch-addrlookup --format=mutt".
This said, it may take some time, but it pushes notmuch some lines up in the TODO- and priority-list (where it was added in 2017).
Great, thanks again! Cheers, gregor -- .''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06 `. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe`-
signature.asc
Description: Digital Signature