afewmail / afew

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

Filter mails from addresses in a list contained in a file? #310

Open vikasrawal opened 2 years ago

vikasrawal commented 2 years ago

I am sorry if this is not the place to post queries. I could not figure out where else to ask it.

I would like to tag mails from a list of addresses as spam. The list is contained in a file, to which i would like to keep adding addresses that I want to block. How can I do this using afew?

GuillaumeSeren commented 2 years ago

Hey @vikasrawal You could do that with just simple notmuch queries, maybe using a filter from afew to add the correct tag could also do it, like this

[Filter.5]
message = Tag all messages from the notmuch mailing list
query = to:notmuch@notmuchmail.org
tags = +notmuch
vikasrawal commented 2 years ago

I am sorry if my question was not clear. Can the filter read a list of addresses from a file?

GuillaumeSeren commented 2 years ago

Hey @vikasrawal I don't think you can do that actually, but you could: