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: Send Later / Time Delay #171

Open KonstabelKen opened 2 years ago

KonstabelKen commented 2 years ago

I'm using SmartTemplates and FiltaQuilla - working great. I'd like to add a time delay to certain templates.

  1. Message comes in.
  2. FiltaQuilla replies [with SmartTemplate] + [with send delay] OR
  3. FiltaQuilla replies with SmartTemplate and the specific SmartTemplate in question includes a send delay variable.

Perhaps it's possible for either FiltaQuilla or SmartTemplate to add a send delay variable, although it might be possible for you guys to hook into the Send Later addon.

I know that there's an integration with Send Later and Mail Merge allowing one to mail merge with a send delay, and so I'm assuming that the Send Later dev team are open to integrations.

Thanks in advance, Ken

KonstabelKen commented 2 years ago

Thinking about this some more, it might be possible to achieve a similar outcome by adding a delay before running the filter rather a delay on sending the message.

Currently there is an Age in days condition. An age in minutes condition would allow one add what amounts to a send delay simply by delaying the filter.

Not as powerful as plugging into the Send Later addon which allows some scripting e.g. delay sending until a specific window (business hours for instance), but probably less work to implement.

RealRaven2000 commented 2 years ago

Just brainstorming here on how to implement this. Even if I want to I cannot set a timer for something that "survives" a Thunderbird restart. Did you run a test with "age in days" - is it triggered on older mail after a day?

I would need to find out whether Thunderbird does something special (as in re-applying the filter on a regular basis to older incoming mail) and whether it needs that specific search term, or whether we can replace it with a more granular custom search term (wait for - "5:10:30") to wait for 5 hours, 10minutes and 30 seconds. If we can hook that into the behavior of what happens when the "age in days" search term is used, so it reliably works on old (incoming) mails then it should be implementable.

KonstabelKen commented 2 years ago

Did you run a test with "age in days" - is it triggered on older mail after a day? I have been unable to get the following set of mail filters to trigger automatically, however they trigger if run manually on a specific folder, and if run manually the filter correctly takes the age in days into account. image

I don't know why the filter fails to trigger automatically.

I would need to find out whether Thunderbird does something special (as in re-applying the filter on a regular basis to older incoming mail) I tried to get around this by setting "Apply filter when: Periodically, every 10 minutes" to true, but it didn't solve the problem.

I'm not sure if this is overdetermined, i.e. because I'm trying to run the filter on a "Folder Name, contains, Q~" rather than the inbox, and this might require inherited folder properties.

In the user guide for FiltaQuilla, I found the following:

By default, message filters in IMAP are only applied to the INBOX. If you have some server-side filters, there could be times when you also want to apply filters to other folders. FiltaQuilla includes an inherited folder property “Apply Incoming Filters” that you may use to specify additional folders that will have filters applied. See the post “Inherited Folder Properties – revisited” at http://www.mesquilla.com/2009/11/06/inherited-folder-properties-revisited/index.html for more information about using inherited folder properties.

It might be that I need to “Apply Incoming Filters” for this to work, but unfortunately the link is broken and so I'm not sure what the guide on inherited folder properties says.

RealRaven2000 commented 2 years ago

I'm not sure if this is overdetermined, i.e. because I'm trying to run the filter on a "Folder Name, contains, Q~" rather than the inbox, and this might require inherited folder properties.

this is likely because I wasn't able to convert the feature to the new "mail experiments" format. Being able to run filters automatically outside of the inbox is still a highly coveted feature that exceeds my own coding abilities.

RealRaven2000 commented 2 years ago

By default, message filters in IMAP are only applied to the INBOX. If you have some server-side filters, there could be times when you also want to apply filters to other folders. FiltaQuilla includes an inherited folder property “Apply Incoming Filters” that you may use to specify additional folders that will have filters applied. See the post “Inherited Folder Properties – revisited” at http://www.mesquilla.com/2009/11/06/inherited-folder-properties-revisited/index.html for more information about using inherited folder properties.

It might be that I need to “Apply Incoming Filters” for this to work, but unfortunately the link is broken and so I'm not sure what the guide on inherited folder properties says.

Unfortunately the original author, Kent James, has retired from Add-on development a few years ago, and I took over FiltaQuilla and ToneQuilla because he had mentored me before on some of my own Add-ons. It was quite difficult to convert the filter editor code (which was based on deprecated xbl bindings technology) but the inherited properties was beyond my own paygrade at that time. I am still not sure whether it is possible and whether something like this will ever be supported by the web extensions format.

ThiloteE commented 2 years ago

conversation about running filters outside of inbox refers to

Ugly workaround:

Creaty "dummy account" that acts as intermediate inbox folder for this specific filter rule.

This dummy account could be a:

KonstabelKen commented 2 years ago

Ugly workaround:

Creaty "dummy account" that acts as intermediate inbox folder for this specific filter rule.

This dummy account could be a:

  • inbox of new e-mail account

The ugly workaround can be made just a little prettier by using %header.set(from,"Postmaster pm@abc.com")% in the SmartTemplate addon to set the 'from' address to match the primary inbox instead of the dummy account so that the effect on the end recipient is invisible.

I realise not everyone is using SmartTemplate... they should be 😆

RealRaven2000 commented 2 years ago

The ugly workaround can be made just a little prettier by using %header.set(from,"Postmaster pm@abc.com")% in the SmartTemplate addon to set the 'from' address to match the primary inbox instead of the dummy account so that the effect on the end recipient is invisible.

I realise not everyone is using SmartTemplate... they should be laughing

hear hear! I think the main problem with SmartTemplates is really marketing, but it is quite hard to explain how it works. I am not doing my FAQ right as I keep writing instructions on how to add external templates and the difference to account templates. I still owe my YouTube channel a few new videos...

KonstabelKen commented 2 years ago

Even if I want to I cannot set a timer for something that "survives" a Thunderbird restart. Did you run a test with "age in days" - is it triggered on older mail after a day?

The following test triggers correctly when age in days is greater than 2 using @ThiloteE's idea of a dummy account i.e. works on inbox but not using the folder name property.

image