afewmail / afew

an initial tagging script for notmuch mail
ISC License
325 stars 97 forks source link

Handling multiple matches in HeaderMatchingFilter #311

Open darrenkenny opened 2 years ago

darrenkenny commented 2 years ago

I have a scenario where e-mails are being sent to multiple mailing lists (that are not handled by ListMailsFilter due to them basically being just distribution lists rather than what ListMailsFilter relies on.

Basically I may have multiple matches to the pattern for HaderMatchingFilter, and extract part of the name to be a tag, but only the first match is used.

Is there any way to have it handle this scenario? I can't see anything in the documentation.

benmezger commented 2 years ago

Do you think this could help? https://notmuchmail.org/faq/#index8h2

GuillaumeSeren commented 2 years ago

Hey, sorry to be late.

So those mails, does not have list-id header ?

Does the thread works if you search / show them with notmuch ?

darrenkenny commented 1 year ago

When it comes to ListMailsfilter, there is only one list-id entry, so it cannot handle thngs.

So when trying to work around this using HeaderMatchingfilters instead, it is only matching on the first entry in the To or Cc which means that it only will be tagged for that first match, and not all the lists that should match.