GNOME Bugzilla – Bug 206339
message marked deleted but not expunged in the source folder when moving between two IMAP folders
Last modified: 2001-10-03 13:56:29 UTC
Package: Evolution Priority: Normal Version: 0.12.99 Synopsis: message marked deleted but not expunged in the source folder when moving between two IMAP folders Bugzilla-Product: Evolution Bugzilla-Component: Mailer Description: When I move a message (using Move To Folder) to another folder in the same IMAP mailbox, the message is marked deleted but not expunged. This is a problem because now I have two copies of the msg in the mailbox, and the msg shows in the Trash. If I keep moving it around, it shows up that many times in Trash. Using Cyrus IMAP4 v1.5.19 server over a stunnel connection. Unknown reporter: ovy@iname.com, changed to bugbuddy-import@ximian.com.
Just checked - the above does not happen when moving msgs via filters.
Hrm. Maybe move should automatically expunge?
no, because that would mean that all messages marked for deletion would be removed and this is not the desired behavior because some people like to mark messages as deleted and keep them forever. This is their way of "archiving" mail. Don't ask, I have yet to figure out the logic in that myself. anyways, there's a bug about filters expunging folders being "wrong" but I just haven't fixed it yet (we can't figure out what the correct thing to do is, some people like this guy want it to expunge but many other people don't want it to expunge - feeling our pain and suffering yet?)
I know this doesn't seem to be the usual solution around these parts, but maybe we could offer a preference for this?
You really don't want to automatically expunge things -- the distinction between deleting and expunging saves your butt if you accidentally mark something as deleted, and automatically expunging things at seemingly random times messes up this butt-saving behavior. IMHO this is NOTABUG, because the multiple copies of the message in the trash are only vfolder copies, not actual copies.
I think the multiple copies ARE actual copies -- the message DOES reside in more mailboxes, albeit it has the deleted flag set in all but one. So this IS a problem, esp. if you guys eliminate expunging on filters as well. Some of us have IMAP quotas, and if most of your incoming mail gets filtered to different mboxes the quota is in effect halved. On the other hand, expunging a whole mailbox on moves is bad too. Maybe you guys should reconsider supporting a "true" Trash folder which will solve this problem. And yes, people do want deleted msgs to stick around for a while, just in case -- losing an important email by hitting Delete at the wrong time (like just before filtering) is really painful.
how would having a "real" trash folder solve this problem? it wouldn't.
With a Trash folder you get both benefits: 1) no multiple copies of the message, and 2) being able to move / filter mail without losing your deleted messages (now you can safely expunge after a move -- any deleted messages are in the Trash folder). I know it's slower, but that's why we have the nice multithreading in Evo for :) I'm really curious as to why the IMAP people chose not to allow expunging a single message.
mark crispin, the "imap guy" believes that mail clients should use virtual Trash folders. I read an archived thread on this a while back...
Jeff: Once again in your rush to belittle our users, you miss the point. I don't think anyone wants to keep their deleted mail forever, people just want the ability to recover recently-deleted messages without having Evo expunge the folder at random times. Having a real trash folder wouldn't help, because IMAP doesn't have a MOVE command: the only way to move a message is to COPY it and then mark the original deleted. And then potentially EXPUNGE. So you'd solve the problem with the message appearing multiple times in the trash, but you'd still have to either expunge at random, or have the message take up space as a deleted message in the source folder. There are a few things we can do here. First, if the server supports UIDPLUS (which current versions of Cyrus do), we *can* expunge individual messages, and so we should update the IMAP move code to do that. (This is very easy.) If the server doesn't support UIDPLUS, we can hack around it by un-deleting the messages we don't want to expunge, expunging, and then re-deleting the ought-to-be-deleted messages. The IMAP provider already has code to do this, so this is also easy, although it's potentially slow. But maybe this is the best solution? (Another possibility would be to store a "moved" flag on the moved messages, and have them not show up in the vtrash or when "Hide Deleted Messages" is off if they have that flag. But this would actually be really hard because there would no longer be a one-to-one mapping between IMAP sequence numbers and summary indexes.)
About the Trash folder: yes it *would* solve the problem, because now you don't keep your deleted messages in the folders, so if you expunge the folders at random times that's not a problem, there should be no messages with the delete flag anyways. Except, of course, the one(s) you've just moved. Netscape does that and I've had no problems with it. True, delete is slower, but it might be worth it. Of course, the ideal solution is the one Dan just mentioned, deleting one at a time. The UIDPLUS things is probably very fast, it would be interesting to see how the non-UIDPLUS hack compares (in terms of speed) to moving to another folder and expunging (i.e. Trash folder).
No, a physical trash folder wouldn't help... how are your messages going to get in there? With the IMAP COPY command. Which means you have to delete them from the source folder. Which puts us in the same problem as before. If IMAP supported some mode command like PUT_ALL_DELETED_MESSAGES_IN_THIS_FOLDER, that would be one thing, but I have yet to see this implemented. I assume Netscape does something like the delete-only-one hack or just hides duplicates.
It's true that you have to expunge, but you *don't care*, because your older deleted messages are in Trash, so they will not be affected by the expunge in, say, Inbox. Right now in Evo, because there's no Trash folder, older messages you delete in Inbox are still in Inbox, so you *do* care if Inbox gets expunged. I just checked with Netscape, and this is exactly what it does: COPY msg to Trash, EXPUNGE Inbox. If there are deleted messages in Inbox (like from Evo), tough luck, but the ones deleted from Netscape are safely in Trash. If you're *always* using a Trash folder, then expunges are OK, because all deleted messages have already been copied to Trash. I hope this sheds some light on the issue.
Ah. Indeed. So, I think having a real trash folder option is probably the right thing, but that will have to be post-1.0. For now we can at least do UID EXPUNGEs though.
*** bug 206394 has been marked as a duplicate of this bug. ***
Since the eventual consensus was "you should be able to choose to have a physical trash folder", I'm marking this bug a duplicate of that bug. There is also now another bug for the UID EXPUNGE behavior. *** This bug has been marked as a duplicate of 206061 ***