RealRaven2000 / FiltaQuilla

Adds many new mail filter actions to Thunderbird
http://quickfilters.quickfolders.org/filtaquilla.html
GNU General Public License v3.0
88 stars 17 forks source link

Feature Request: Run through program #159

Open bleargh45 opened 2 years ago

bleargh45 commented 2 years ago

Let me start with, "I'm not even sure if this is possible in Thunderbird". But, it was one feature that I used with KMail and which saved my bacon more than a few times.

Essentially, rather than just calling out to "Run program" to execute a given program, I want to then be able to replace the headers/body of the message based on output provided from said program. With KMail, I had used this to feature to rewrite headers/body of messages so that I could get batches of repetitive filters pulled out into something that could iterate over them more quickly (e.g. filtering large volumes of Git commits, where it gets really slow if each filter rule has to check "is it to the Git mailing list?" and "which Project is it for?" before even beginning to check message contents).

Is something like that even possible with Thunderbird / FiltaQuilla? (if not, do feel free to simply close this as "won't do").

RealRaven2000 commented 2 years ago

It may be possible to manipulate headers, or at least copy to a new email, but it may be a little too much work on my end to do all the conversion access necessary. TO start, there is no easy way to do this; and obviously it would all be legacy, high risk, undocumented back-end code. Can you give an example on what headers you would modify how and what exactly you wanted to do in the body of the mail (if anything)?

bleargh45 commented 2 years ago

My current use case is actually "be able to determine which Folder to file the message into, based on the contents of the message body", and which in the past I had implemented by piping the message through an external program that determined which folder to send it to and then rewrote the message to set a message header that I could then pick up on later via Filters.

While I can filter messages in Thunderbird right now and have them filed into various folders, the filters are definitely not efficient by any means (right now I have several hundred filters looking for paths/verbiage in the message bodies, but all of which have to be prepended by rules catching "this is a Git commit e-mail, and for this particular project").

But, perhaps I should step back from how I implemented it previously and think solely about the end goal... "the ability to determine which folder to file the message into, by running an external program which is then handed the headers+body of the message (or pointed at a file on disk which contains the message itself)".

RealRaven2000 commented 2 years ago

I think one thing here is that the external program action is an action; you really want it as a search condition. I don't think I would like to take it on as a task as it could make the whole filtering process unstable. Have you looked into the JavaScript action variant?