notmuch-addrlookup-c
notmuch-addrlookup-c copied to clipboard
Results are not filtered properly
What is returned:
$ notmuch-addrlookup robin
"Robin John" <[email protected]>
<[email protected]> <<[email protected]>>
What I'd expect:
$ notmuch-addrlookup robin
"Robin John" <[email protected]>
I am also not too sure on the double angle brackets around the mail is actually valid; it happens for some mails, but not all.
Update: My email client (aerc) does not like the angle brackets; I have to grep -v them away
Hmm, is the regex here at fault?
I couldn't tell if my life depended on it. While I like reading & writing regexes, these have way to many backslashes in them.
My idea to solving this (while being not at all familiar with the codebase) is to trim the resultlist by checking if an email without a name is already present. A hashmap would come to mind, but my C skills are not nearly advanced enough to even attempt this.
Basically, everything not matching (.+) <([^ ]+)> should probably not be considered as an email address with a name attached. (angle brackets and spaces around "pure" addresses should still be removed though)