vladimiry/ElectronMail

Ability to run filters against existing emails

Opened this issue · 7 comments

It'd be awesome if ElectronMail implemented an option to run filters against existing emails; whether they're the filters native of the email provider or a custom filtering feature. ProtonMail is only able to run filters the moment the emails are received or sent, and there's no way to apply them to the emails already in the account.

I've more-or-less been able to sort out this limitation by using Thunderbird's filters; however they're pretty archaic (they treat labels as folders), and Thunderbird + Bridge is an incredibly slow combination and it has been a very frustrating task to keep my messages organized.

If ElectronMail had a similar feature, it'd help the service compensate for another basic feature that most email providers offer and this one is still lacking.

It sounds like the search capabilities need to be enchanted by adding there more filters. Currently the filters list includes only only folder/label + full-text search keyword (see #92).

Yes, adding some advanced search options to ElectronMail along with the ability to select all messages matching the query (and not only the ones in view like in ProtonMail's web client, where you can only select batches of 50 mails at a time) would already be a huge plus. The filtering feature could then be built on top of this as it'd merely be an automation of searches + actions.

It's technically possible to enable requested features but the task is huge. Not planned for the near future.

The filtering feature could then be built on top of this as it'd merely be an automation of searches + actions.

One example of such action is already here, see make all read button enabled since https://github.com/vladimiry/ElectronMail/releases/tag/v3.8.0. The button works with the whole mails list loaded in the offline/local database view mode, including the full-text search result list.

The next app release is going to enable two more full-text search filters, "sentDateAfter" and "hasAttachments".

full-text search filters

Picked from #380:

The workaround is to export all the emails to EML files (in the app can be done in 2 mouse clicks), then import them to any mature mail app or EML viewer and run the search there.

Implemented and planned for next release.

  • Enabled support for JavaScript-based / programmatic messages search filters (#257, aaf0235). This basically enables the unlimited capabilities for messages filtering. Notice that the code editor is enhanced by highlighting the syntax and it understands the email message data model (thanks to TypeScript). The simplest way to get a better idea about the message data model is to export some message to JSON and then review the file structure (exporting to JSON enabled since v4.11.0, see #160). The feature comes with a simple filtering code snippets library which in new releases might get transformed into a per-account and user-editable library. The feature requires the local store option to be enabled for the email account.
    js-search