RealRaven2000 / quickFilters

Thunderbird Add-on: quickFilters
http://quickfilters.quickfolders.org/
Other
46 stars 11 forks source link

Is there a way to pattern match the Reply To field? #209

Open infinitelyintrigued opened 10 months ago

infinitelyintrigued commented 10 months ago

I would like to create a regex message filter that matches the message's Reply-To field. Can this be done?

RealRaven2000 commented 10 months ago

I was about to say yes quickly, thinking you can achieve this in conjunction with my Add-on FiltaQuilla, it has a number of regex options; but it seems there is no regex option for address fields specifically.

This may be something I might add to quickFilters as premium function for Pro users would you be interested?

However there is a generic way to regex match any text field:

image

I tested it for you, something like this should work:

Header Regex Match matches replyTo:/.*(test).*/

Here is a successful test I did, using a pattern to match a replyTo that contains a hash followed by a set of numbers (e.g. #2000)

image

RealRaven2000 commented 10 months ago

PS: it seems the documentation at https://quickfilters.quickfolders.org/filtaquilla.html#header_regex is missing the entry for replyTo, so I am going to add that to the page now.

infinitelyintrigued commented 10 months ago

Hi, the sample filter does work. However, I'm having trouble matching specific email addresses. I'm doing something like this:

replyTo:/(bob|sue|tom|mary)@example.com/i

However, this works for the sender field. sender:/(bob|sue|tom|mary)@example.com/i

Yes, I'd be interested in seeing it for Pro users.

RealRaven2000 commented 10 months ago

/.*(bob|sue|tom|mary)@example\.com.?/

this will match Bobby Fischer <bob@example.com> As well as bob@example.com

RealRaven2000 commented 10 months ago

Slightly improved version:

/(.*\W)?(bob|sue|tom|mary)@example\.com.?/

to avoid matching jimbob@example.com

infinitelyintrigued commented 10 months ago

Hmm. The suggested filters do not work.

I looked at the Reply-To section of the message source of one of the messages I wanted to filter. It looked like this.

Reply-To: bob@example.com

RealRaven2000 commented 10 months ago

Hmm. The suggested filters do not work.

I looked at the Reply-To section of the message source of one of the messages I wanted to filter. It looked like this.

Reply-To: bob@example.com

I don't know what's happening, the only way I could find out by importing your filter, (using quickFilters Pro) you can export it like this:

image

You can also export the test email via Thunderbird File menu (as eml file, please)

image

infinitelyintrigued commented 10 months ago

I found that this issue only occurs to messages when they are sent from one particular system I use. I was successfully able to apply your replyTo filter to other messages from other systems. I guess I will live with it. Thank you.