-
Notifications
You must be signed in to change notification settings - Fork 11
Support triggering assistant through: deleting mail / flagging mail as junk / archiving #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here is a test version - this one enables the assistant for junk and trash: however these can be disabled through the config settings
I am planning to build a UI around these special assistant options later. To install the version above, download the zip file and then drag the file into Thunderbird Agd-ons Manager (do not extract contents). |
I used Pre9 with #143 and it works on delete but not for archiving. The two config settings cannot be found in the configuration here (neither in the thunderbird, nor in the debug settings directly accessible from the addon). |
@PotatoCarl - here is a new preview version: I provided a very primitive interface for unsetting the flag (that by default will ignore archived messages). Open quickFilters Settings, and on the actions screen click on the button "Folders to ignore Assistant..." This will display a filtered view of about:config. There you can change the setting:
...then archiving messages will trigger the assistant (unless you already have a matching rule set up that could have archived the message automatically) To install the prerelease version, download the zip file and drag it into Thunderbird Add-ons manager without extracting the contents. |
Hi Remark: My Archiv Settings form Thunderbird are set to "archive by years", so the folder structure is Archiv/ |
This is right - and now by design. because the folder listener cannot distinguish between the cases of whether the user dragged an email into the trash, hit the DEL button or used some other method (such as using a quickMove operation by QuickFolders). It won't even know whether a filter deleted the email. So there is only triggering the assistant or not, which is reflected in the setting
Strange I cannot confirm, using 5.7.2pre9, the assistant is not triggered if I archive (using the [A] key or dragging into the Archives folder) are you dragging it somewhere else (maybe a subfolder in Archives) or use yet another method of archiving? For reference - this is what my archives folder looks like:
By design so this on is working for you correctly. |
So, I checked my "Archive Options" (account settings) and switched it to "one folder". But still, whenever I Archive a message, the filter pops up. |
The following gest logged: msgsMoveCopyCompleted() Object { isMoved: true, aSrcMsgs: (1) […], targetFolder: XPCWrappedNative_NoHelper, aDestMsgs: (1) […] } |
FYI: I am doing everything on my IMAP server including Archiving. So I do not Archiv to local folders. |
It sounds like the assistant should actually be showing, at least with current versions of Thunderbird 91 / 102. Are you using a beta version? |
It is showing, that is exactly my problem. I am archieving messages, so they are moved where they are supposed to go and I do not want the assistent to make a filter for me. |
If you do not want the assistant to pop up during archiving, please reset the setting to its default (
in this context |
Here is a test version with additional log output: Please set Debug Mode = active and
|
Okay, this is funny: You will see that I archived TWO emails. The first one was sorted under Archives - no Assistant popped up. As It was directly after each other, and I did not change anything in between I have no understanding why they are treated differently and why at one time the assistant pops up and on another not. msgsMoveCopyCompleted() Object { isMoved: true, aSrcMsgs: (1) […], targetFolder: XPCWrappedNative_NoHelper, aDestMsgs: (1) […] } Object { isMoved: true, aSrcMsgs: (1) […], targetFolder: XPCWrappedNative_NoHelper, aDestMsgs: (1) […] } flags: 0x18082014 |
Thanks, so the first folder (Archives) has flags 0x10086014, which according to flags reference is comprised of:
The second folder (Archives/2023) has the flags 0x18082014 which is comprised of:
so indeed - these subfolders have not got the Archive flag. Not sure whether this is a bug or by design in the Thunderbird implementation. |
Well, I desperately deleted the folders (2023...) but Thunderbird recreates them when Archiving. |
Could you move the Archives folder out of Inbox to the root of the account? |
Strangely, I couldn't set yearly archives on my (gmail) Imap account, only if I chose "Archive in Local Folders". Otherwise the "Archive Options" button remains disabled. |
maybe because the folder already contains data? I will check that next... |
Ok, so the only strategy I can come up with right now is to also check the tree of parent folders, then check whether the parent has the archive flag. Patch code: const isArchiveExcluded = qF.Preferences.getBoolPref("assistant.exclude.archive");
if (isArchiveExcluded) {
excluded = excluded | FLG.Archive; // main (Archive) folder
}
if (isArchiveExcluded) { // exclude all Archive child folders
let p = targetFolder;
while (p) {
p = p.parent;
if (!p || p.isServer) break;
if (p.flags | FLG.Archive) {
console.log(`Disabled Assistant for folder: ${targetFolder.prettyName} \nIt is in an Archived parent folder.\nFlags: 0x${p.flags.toString(16)}\nURI: ${p.URI}`);
return;
}
}
} Patched version below: To install the prerelease version, download the zip file and drag it into Thunderbird Add-ons manager without extracting the contents. |
Translated new button to 18 languages: quickFilters-wx-5.7.2pre18.zip To install the prerelease version, download the zip file and drag it into Thunderbird Add-ons manager without extracting the contents. |
No, it is empty. |
It is in the root. We are running our own cyrus server in house, so no Gmail or so. |
Weird, according to your own log:
There is a big INBOX folder above it. Anyway, did you try prerelease 18? |
Well this is the root of the account like Cyrus is handling those. I do not get a "xxxyy@domain/INBOX//Archiv" but "xxxyy@domain//ARCHIV/" folder. The INBOX naming in the log is irritating, as there is no level above it.
INBOX is the root of my account. Also with other configured accounts "Posteingang" is always pointing to "INBOX" here (or at Strato etc.). Due to the Cyrus configuration, all users are on the same level, so matter of fact, whatever Thunderbird names "INBOX" is the user name on IMAP level. Yes I tried the new version. I used two different settings for the Archiv option, "one folder" and "one folder per year" and in neither case the assistant popped up. So it seems to work. Thank you for your quick action as always. |
well, the Pre18 version does not popup the assistant when archiving... however it does neither when sorting any other mail via Quickfolders... |
I can reproduce it, it's probably to do with the original treeview-drop routine. Will post a new version here ASAP. |
Leaving comment so I can be notified when there is a solution... :) |
Thanks, Axel!
Bob
…On 2/1/23 2:06 PM, RealRaven2000 wrote:
I can reproduce it, it's probably to do with the original
treeview-drop routine. Will post a new version here ASAP.
—
|
I am halfway there but getting some duplicate assistants now on some operations (archiving, moving to a QuickFolders tab). The difficult thing will be to fix it without necessitating a new version of QuickFolders as well. Will post a new version tomorrow. |
Hi |
I will look out for that today as well - could you edit your post and add the quickFilters version number please?
|
Alright here is a newer version. Still having some problems with intermittent failure when dropping emails to a QuickFolder submenu (in IMAP). Otherwise, seems to be stable for now: Tested:
To install this preview version:
|
Found another bug when I tested moving via Thunderbird context menu (Exception targetFolder not found), so here is with that bugfix: To install this preview version:
|
Congratulations, Axel!!! And thanks for your fine work. This morning I tried pre84, dragged some emails to the Trash and they went there and the filter create/merge dialogues all came up.
Thank you,
Bob
|
Thanks again, Axel. Pre85 works well when dragging mails to the trash.
I HAVE A QUESTION: When merging with an existing filter does Thunderbird/Quickfilters examine existing criteria and prevent duplicate criteria? For example, I'm creating filters that send certain senders to the Trash automatically. I still get some spam despite using an external spam filtering service! At this point I have at least 12 filters that send certain senders to the trash -- each filter has many senders in the list. I arbitrarily create a new filter whenever I feel there are a lot of senders in any existing filter, just because it feels like a good idea. I'm also wondering if Thunderbitd can get "overloaded" with so many names in filters. I am not using Thunderbird's built in junk utility as I don't want automatic Bayseian filtering, I just want a white and black list.
Oh by the way, I have finally kind of conquered spam. I examine a "hold" folder every morning and there aren't usually more than 5 or 10 to examine and sort through. Some of them I need to keep and some I need to trash. It's the last "human" intervention left in my system :-)
Bob
|
I might also add a routing for the delete button / Edit - Delete Message for those who want to use the keyboard. Would this be ok / potentially useful? |
Yes, it should do that (if you are filtering by sender, this will be based on the email address)
In my experience the answer is probably yes. It is not well tested for >100 search conditions and may lead to performance problems. Better to break it up once you reach 40 or 50 conditions. You can use the "Sort" button to check for duplicates!
Well done. If you want to do me a big favor, could you answer the github mail on the website (rather than sending a reply from Thunderbird) - it always creates a lot of extra stuff / information I need to delete in your posts otherwise. (Hence you see the note that your posts were "Edited by RealRaven"). Github has a great built in Markdown editor that even allows inserting of screenshots and necessary formatting. We always have to remember that whatever we reply here will be sent to everybody who is subscribed to the particular issue. |
Personally I don't use many keystrokes in Thunderbird. I'm sure someone wants to use the keyboard delete.
Bob
|
Just a technical note on supporting DEL key and menu item. If implemented, these could be using the action "Delete EMail" rather than "move to (particular) Trash" folder. This should probably also be used when a user drags mail to Trash on the same account / server. The big difference here would be that if you copied the filter across to a different account it would behave more along the expected line of deleting mail within the account (rather than sending the mail across to the Trash folder on another account! Because at the moment when you delete mail by dragging it to trash all copies of the filter will always try to move it to the same Trash box - regardless of on which account you used it) Thoughts? |
I guess you are speaking of creation of a NEW filter. I have a bunch of existing filters that I am merging with, each filter currently has the single action "Move Message to ---- Trash". So if I pick to merge with an existing filter the new filter items will also move to the trash. So basically I think you are saying that if I use the Delete Email action instead of "Move to ----- trash" the filter I create will be more universally applicable to a different email account, etc. |
Yes that's the idea. I could make "Drag to Trash" behave the same way, but merging might probably not suggest the existing filter based on that action (as it is a different action from the perspective from a filter). So it might be a good idea to do a merge check as well and offer that, but that's potentially adding some complication to the flow. When the filter process is started (let's say somebody hits DEL) I usually transmit the action (in this case not "move to folder trash" but "delete mail") and I would have to add some extra logic to still match that with existing filters that "move mail to (this particular) trash folder". If the user would choose to merge in this case, it would have to change the action from "delete" to "move to trash". Something to keep in mind. I am still investigating as there is no global function for delete message but it's a command handler so I would have to monkey wrap the global command handler that's in charge for this command:
... and restore the original function when quickFilters shuts down. Going to check with @jobisoft on the Dev call tonight whether that's feasible. |
Sounds like you're going through tremendous effort for potentially little benefit. In my case I might not like triggering filters with the DEL key, I probably would continue to drag to the trash. So, of course, please add DEL to the optional triggers in the QuickFilters Assistant setup box. Many thanks! |
@bobkatz24bit Just to comment on this: I do not mistreat animals if I do not have to, so I rather use the keyboard instead of forcing my mouse to run around the screen and move heavy mails... |
Cute. My mouse is a Wacom tablet. Dragging with the tablet is not a drag. I am very much a heavy keyboard/keystroke user. I just can't keep all the keystrokes for all my applications and computers in my head so sometimes I "mouse it". :-) |
Here is a new version that also supports creating a new filter / merging (using assistant) when deleting emails (via DEL button or context menu). Note that the action in this case is now "Delete Message" and not "Move to folder .../trash", which is the more correct way to implement this sort of filter action. To install preview version:
|
A nice observation: Pre101 seems faster in operation than previous Quickfilter versions. It successfully merges with an existing filter if I choose merge. It successfully recognizes when I drag files to the trash and that's the action created in a new filter if I drag. It successfully recognizes when I hit DEL and that's the action created when I delete files and create a new filter. And sigh of relief: the files do end up in the trash upon deleting. It's always better to have the trash until the user decides to empty the trash. Bottom line: All the actions that I've tested have been successful with Pre 101. |
Implemented in 5.8, released on 15/02/2023 |
Dear Axel: I have recently lost the ability to select all in Thunderbird. The hotkey (command-A) on mac no longer works. The edit menu shows select ---> all, but it doesn't do anything. Could this be related to the quickfilter changes? |
This was fixed in version 5.8.1, released on 18/02/2023 see issue #160 |
Since v5.7.1. moving mail to Junk or Trash will categorically not invoke the active filter assistant. I believe older versions were more nuanced and would do different things depending on whether mail was moved / dragged or marked as junk / trash can clicked.
We will reintroduce the ability for these 2 special folders (Trash / Junk) to trigger the assistant, based on a user preference (UI to be built later).
The text was updated successfully, but these errors were encountered: