No obvious way to issue an EXPUNGE when using IMAP folders with maildir.
Categories
(MailNews Core :: Backend, defect)
Tracking
(Not tracked)
People
(Reporter: World, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Updated•6 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
The current situation:
Usually, right clicking on an IMAP folder shows a "Compact" option in the context menu.
This will set off a folder compaction, and also a server-side EXPUNGE.
When using maildir storage, this option is not displayed, because maildir doesn't require compaction. However, this also means that there's no obvious way to tell the server to expunge deleted messages.
There is a workaround: The "File" menu has a "Compact Folders" option which compacts all the folders (well, all the folders on the same incomingserver as the currently-selected folder, anyway). There is/was an issue where "File -> Compact Folders" wasn't calling expunge (see Bug 1776727 - there's a fix pending there).
Comment 6•2 years ago
|
||
My analysis:
The connection between folder compaction and IMAP expunge is a little artificial... The pedantic programmer in wants to separate it out into separate operations :-)
But I think it probably makes more sense to keep them tied - both are related in the sense of the user wanting to express "please garbage-collect the deleted messages in this folder".
So maybe it'd make sense to keep sharing the context item, but be a bit more precise about the wording?
eg:
localfolder + mbox: "Compact"
localfolder + maildir: <hidden>
imap + mbox: "Compact and Expunge"
imap + maildir: "Expunge"
I dunno. We're well into UX territory here.
@aleca - any thoughts?
(and yes, we shouldn't have folder compaction as a manually-initiated operation at all - it should just be automagic :-)
Comment 7•2 years ago
|
||
Thanks for the ping on this.
I think offering different options based on the folder and storage type makes sense.
What we should consider is the wording and how we present these options.
Does "Expunge" makes sense for all our users? I don't think it does and the wording should be more explicit, something like "All the message in the Trash folder of your IMAP server will be permanently deleted".
We should stay away from terminology like "garbage collection" and similar.
Question, does it make sense having a scenario in which a user might want to "Compact" the MBOX but not "expunge" the IMAP?
Could you pleas highlight all the strings and code interacting with this with links on searchfox?
I'll take some time to visually prototype something and have a clear planned direction for this change.
Comment 8•2 years ago
|
||
I've been running a while with this change. It now allows the right-click context menu for imap maildir folders to show the "Compact" selection. It behaves very much like the existing "Compact" item for imap mbox: the imap expunge is sent removing messages "marked as deleted" from the server and it deletes the corresponding maildir message files from the "cur" directory.
With this change I don't see a reason to change the UI. Just let the "Compact" item appear where it's needed.
"Compact" will appear:
- Imap mbox folders (sends expunge and removes deleted msgs from mbox file)
- Imap maildir folders (sends expunge and removes deleted maildir msg files from "cur")
- Local/POP3 mbox folders (removes deleted msgs from mbox file)
"Compact" won't appear:
- Local/POP3 maildir folders (maildir file removed from "cur" at msg delete time)
- Top level server or a virtual folder
From comment 6:
we shouldn't have folder compaction as a manually-initiated operation at all - it should just be automagic
That wouldn't be good for user who select "just mark it as deleted". There's already a setting that allow automatic compact when it will save over X bytes, but there are "issues" sometimes with the calculation accuracy.
From comment 7:
Question, does it make sense having a scenario in which a user might want to "Compact" the MBOX but not "expunge" the IMAP?
I don't think so. We want to always keep the mbox (or maildir) in sync with the imap server content. So imap expunge of server and compact of mbox file or maildir msg file removal need to occur together.
The only UI change I might recommend is that for File | Compact Folders
it is unclear that this only applies to the folders in the currently selected account. A use may think this applies to all folders in all accounts (as I did). Possibly an additional dialog could pop up saying something like
Compact all folders for <currently selected account/server name>
[Cancel] [Ok]
Updated•2 years ago
|
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Following on from Bug1683714 comment #19:
Rough plan:
- In the C++ side, make sure the folder Expunge() and Compact() functionality is properly separated (I think they are mostly, but I've a suspicion there's a snippet of Expunge-related code lurking in the folder compaction... I'll need to check.)
- add a
nsIMsgFolder.canExpunge
attribute, to go along with the existing.canCompact
. This lets the GUI side see which operations are available and decide how to present it. - maybe add a ExpungeAndCompact() which coordinates running them both (Compaction shouldn't begin until after the Expunge has completed). But it might be simpler just to do this in the javascript - both ops have a listener to notify when the op completes, so in JS it'd just be a matter of waiting on a promise.
Comment 10•2 years ago
|
||
(In reply to Alessandro Castellani [:aleca] from comment #7)
Does "Expunge" makes sense for all our users? I don't think it does and the wording should be more explicit, something like "All the message in the Trash folder of your IMAP server will be permanently deleted".
That's a bit of a mouthful for a right-click context menu :-) (but I don't think that's what you meant)
Just for clarity:
It's not just the trash folder. Any IMAP folder can be set up to just mark messages as deleted rather than actually deleting them. And there's the view option to show such messages in lists, just with a strike-through line to show they've been deleted.
The Expunge then tells the server to actually delete those messages.
We should stay away from terminology like "garbage collection" and similar.
Yeah, "Expunge" might be a bit unintuitive... but I too am wary of introducing a non-precise third term like "garbage collection".
I kind of suspect the path of least resistance is just continuing to use "Compact" for both.... but the pedant in me wants to see "Compact" or "Expunge" or "Expunge and Compact" or none, depending on the type of folder and type of store.
I think the thing I want to get across is that Expunge actually deletes stuff on the server, while Compact is more of a housekeeping thing.
Question, does it make sense having a scenario in which a user might want to "Compact" the MBOX but not "expunge" the IMAP?
I don't think so. Technically they're separate things, but I probably wouldn't leave it up to the user to run them both manually.
Could you pleas highlight all the strings and code interacting with this with links on searchfox?
I'll take some time to visually prototype something and have a clear planned direction for this change.
I think there's only the one context menu item... ("Compact"):
https://searchfox.org/comm-central/search?q=folderContextCompact&path=&case=false®exp=false
And the file menu "Compact Folders" (which kicks off an operation to compact all the folders for the selected server):
https://searchfox.org/comm-central/search?q=Compact+Folders&path=&case=true®exp=false
More of a breadcrumb than anything... the nsIMsgFolder.canCompact
attribute is used to check if a folder can be compacted. I think it's likely we'd also add a .canExpunge
to go along with it. So together, the GUI would use those to decide what to present.
https://searchfox.org/comm-central/search?q=%5CbcanCompact%5Cb&path=&case=true®exp=true
Comment 11•2 years ago
|
||
It could make sense to always just use "Expunge" for IMAP (which would also do compact if needed). Expunge is needed for IMAP to really delete messages, and clean up, especially if one uses mark-as-deleted. But for imap, compact-only wouldn't appear useful, maybe even bad. How would messages marked-as-deleted then be handled, if one views them?
"Expunge" is an established term for IMAP clients and servers. I would not try to come up our own term for it. (It doesn't have anything to do with messages in Trash, it will just remove messages marked as deleted from whichever folder it's operating on.)
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•