GNOME Bugzilla – Bug 301388
RFE: "Delete this" means "Expunge this" if already in Trash
Last modified: 2021-05-19 11:46:10 UTC
If a user tries to delete one or more items from the Trash folder, then they should be expunged. This helps the user clean up a large assortment of trash quickly. For example, spam-filters may be deleting many messages, but the user may want to weed out a number of obvious spam so that any false-positive "ham" messages can be found and recovered. Being able to eradicate some of the obvious spam before "Expunge (all) Trash" would be useful. (Sorry if this feature is already available after 2.0.4; not everyone runs the bleeding edge.)
not possible with our mail abstraction
I'd like to know how it's "not possible," since the user interface is already aware of the difference between messages in the trash, and messages not in the trash. Right-click a message and you get the opportunity to "undelete" those messages. If you're saying you can't eradicate a single message from the database, again, why is this impossible?
*** Bug 316375 has been marked as a duplicate of this bug. ***
*** Bug 324463 has been marked as a duplicate of this bug. ***
Removing mails physically that are "deleted" in the Trash folder really would be a great feature.
*** Bug 337198 has been marked as a duplicate of this bug. ***
updating version number.
*** Bug 350920 has been marked as a duplicate of this bug. ***
*** Bug 353249 has been marked as a duplicate of this bug. ***
In fact, trash folder is a virtual folder which means there's no a real physical folder called "Trash". All messages that have been marked "Deleted" will be put into "Trash" folder. For IMAP protocol, there's no command that we can only remove only one message that marked as "Deleted", hence we have no way to do that.
As NotZed and Jeff Cai have hinted at, the IMAP4rev1 protocol does not have a way to expunge specific messages, rather the EXPUNGE command purges all messages in the folder with the \Deleted flag. There does, however, exist an extension called UIDPLUS which adds functionality to the EXPUNGE command allowing one to specify which message uids to purge. Adding this feature for IMAP providers which support this extension could be done, just need to have some way of letting the user know why the feature doesn't work for some IMAP servers. My thinking is that camel_folder_expunge() could be modified to take a GPtrArray *uids argument, and, if non-NULL, issue a UID EXPUNGE <uid-set> command if the server supports it... otherwise it should maybe throw an exception saying that the server doesn't support this feature. Note: it is important not to try and simulate this functionality by removing the \Deleted flag from messages not in the uid list, calling EXPUNGE, and then re-setting the \Deleted flag because this approach is not atomic and could lead to messages being lost.
Does Community have the plan to support UIDPLUS extension when expunging mails?
Jeffery, how about local mail box or pop3 mail server? The trashes in local is a virtual folder as well, how to implement this feature for them?
Jeff, On local storage the mail can simply be rm'ed from the MailDir and the summary updated. Using POP 3, from the spec (RFC 1939) DELE msg Arguments: a message-number (required) which may NOT refer to a message marked as deleted Restrictions: may only be given in the TRANSACTION state Discussion: The POP3 server marks the message as deleted. Any future reference to the message-number associated with the message in a POP3 command generates an error. The POP3 server does not actually delete the message until the POP3 session enters the UPDATE state. Possible Responses: +OK message deleted -ERR no such message Examples: C: DELE 1 S: +OK message 1 deleted ... C: DELE 2 S: -ERR message 2 already deleted It seems that it should be possible to have expunge as a per-message operation rather than the current per-folder operation. This would mean tweaking each Camel.Provider.
Created attachment 105688 [details] [review] Adds a method to Camel.Folder to allow a selected set of uids to be expunged.
The above patch is a start of adding the required method to the Camel API. It's an e-d-s change. Is this the correct way of approaching the issue?
Jeff Cai, The UIDPLUS extn is sort of there in the current provider itself. if (store->capabilities & IMAP_CAPABILITY_UIDPLUS) { response = camel_imap_command (store, folder, ex, "UID EXPUNGE %s", set); } else Just the provisions/UI need to be implemented and base classes has to be implemented. Adian, First of all this patch wasn't right and it isn't OO to add function overloading :) it is plain C programming. You need to write a new function and also a store flag whether if it supports UID_EXPUNGE. And only if it supports the impl needs to be called and UI should be enabled.
*** Bug 528687 has been marked as a duplicate of this bug. ***
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines and create a new enhancement request ticket at https://gitlab.gnome.org/GNOME/evolution/-/issues/ Thank you for your understanding and your help.