"Undo Move Message" loses message - after move from Gmail IMAP inbox to local folders
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(Not tracked)
People
(Reporter: adam.richard2020, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: dataloss, Whiteboard: [stuck on gmail bug 162008][has protocol log])
Attachments
(2 files)
18.30 KB,
text/plain
|
Details | |
2.33 KB,
patch
|
Details | Diff | Splinter Review |
Comment 1•17 years ago
|
||
Comment 3•17 years ago
|
||
Comment 4•17 years ago
|
||
Comment 5•17 years ago
|
||
Comment 6•17 years ago
|
||
Comment 7•17 years ago
|
||
Comment 8•17 years ago
|
||
Comment 9•17 years ago
|
||
Comment 10•17 years ago
|
||
Comment 11•17 years ago
|
||
Comment 12•17 years ago
|
||
Comment 13•17 years ago
|
||
Comment 14•17 years ago
|
||
Comment 15•17 years ago
|
||
Comment 16•17 years ago
|
||
Comment 18•15 years ago
|
||
Comment 19•14 years ago
|
||
Updated•13 years ago
|
Comment 20•12 years ago
|
||
Comment 21•12 years ago
|
||
Updated•8 years ago
|
Comment 23•8 years ago
|
||
Comment 24•6 years ago
|
||
I am also experiencing this problem. Why does the Edit > Undo Move Message command even exist for IMAP accounts if it results in messages disappearing? Losing messages is not a good "feature" for an email program.
Comment 25•5 years ago
|
||
I am also experiencing this problem, not with a Gmail-Imap, but with a university Imap-server.
Moving a message to a local folder works
ctrl-z or Edit -> Undo Move Message deletes the local copy, but does not place the original email back into the IMAP folder.
The emails do show up in the INBOX file in my .thunderbird directory (on Ubuntu), but they do not seem to be pushed back to the IMAP server. They hence aren't accessible from the IMAP anymore, and somehow are not shown in Thunderbird anymore, either.
Compacting INBOX then finally removes them from that file (so I guess they are never "undeleted", but have remained in the INBOX file only as artifacts).
In any case, my workaround for the moment is to close Thunderbird, copy the lost emails from the mbox file of the inbox (/ImapMail/.../INBOX) to the mbox file of the folder where I wanted them in the first place (Local\ Folders/.../<target>), delete the <target>.msf and restart Thunderbird to rebuild the msf file.
mbox files are a bit of a mess, suffice to say that emails start with a "From " (space included, at the start of a line - vim: "/^From ") string. Makes parsing a bit easier ;-)
I guess we could simply delete the INBOX.msf and rebuild it (I didn't try if this pushed the undeleted emails back to the IMAP server), but since this folder is much more active I would have to re-delete all the other emails (and my target folder is an archive where I don't delete or work, so the msf-file does not contain any useful information in any case)...
HTH, good luck!
-- t
Comment 26•4 years ago
|
||
Wow! A 13 year old critical bug. For what its worth, archived a message, then tried to undo the move, and the message was lost. Tried to compact folders and restart TB.
I'm using the latest TB version on the latest Window version.
Reporter | ||
Comment 27•4 years ago
|
||
Would the following work as a solution? Instead of relying on "undo delete", which seems to not be supported by all mail protocols, change the "Undo Move Message" operation to copy the message from the original destination back to the original source, then delete it from the original destination. Similarly change "Redo move message".
Comment 29•3 years ago
|
||
Do we really need this and bug 467841?
Updated•3 years ago
|
Comment 30•3 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #29)
Do we really need this and bug 467841?
gmail now appears to support UIDPLUS. I see it in the capabilities when I just now checked.
Comment 32•3 years ago
•
|
||
This bug prevented me of using Thunderbird 10 years ago. I gave another try some days ago, using obviously a different computer and a different OS, and the exact same bug is still here. The ability to UNDO is one of the most useful features of any software. Its a shame that a such persistent bug like this will keep preventing me of using one of the otherwise best email clients.
Look, theres another one, this one 13 years old: bug 467841
And yet another one, this 16 years old: bug 323875
And theres one opened by me 2 days ago: bug 1752569
And Im sure there are a ton more threads reporting this same bug.
Why do all email clients support UNDO and Thunderbird has had trouble with it for the last 16 years (at least)? Its time to solve this once and for all, don't you think? 16 years and you still have problems with this?
I see people here discussing if IMAP gmail implementation supports it or not, and stuff like this. Again I ask, why does it work with all email clients and not with Thunderbird?
Its not a problem of IMAP, gmail, ot whatever. Its a problem of Thunderbird. Stop complicating stuff. Its a simple move back operation.
And I will ask a final time: Why does it work with all email clients and not with Thunderbird?
Comment 33•3 years ago
|
||
Why does it work with all email clients and not with Thunderbird?
Because Thunderbird hasn't implemented UIDPLUS
(In reply to gene smith from comment #30)
(In reply to Wayne Mery (:wsmwk) from comment #29)
Do we really need this and bug 467841?
gmail now appears to support UIDPLUS. I see it in the capabilities when I just now checked.
It looks like imap-js will provide this, if I correctly understand the library description correctly https://github.com/emailjs/emailjs-imap-client. But imap-js might not come in the next esr. Magnus will have a grasp of this question.
Bugs which mention UIDPLUS or rfc4315 https://mzl.la/3ocFcHp I think the bugs with the most info are this and bug 467841.
Comment 34•3 years ago
|
||
I've never really looked into how undo works but just checked it with gmail when moving a message from Inbox to Local Folders. When "moving" the message, tb just copies it to Local Folders and then "marks" the source message as \deleted, so the message should still be present. But gmail, by default, expunges a message marked as \deleted immediately. Tb's "undo" is just to remove the \deleted flag from the moved message and delete the message from move destination (local folders in my case). But the message is already gone so the \deleted flag can't be removed so the message is gone from both folders (except it's still in gmails All Mail "folder" and can be recovered from there). Also, gmail's response to removing the \deleted flag does not indicate a problem even though the message is no long present in the the folder.
A workaround for this is to go into gmail's webmail setting and change "When I mark a messages in imap as deleted" from the default "Auto-expunge on" to "Auto-expunge off". This will make gmail behave more like a typical imap server.
Probably really tb should implement undo by copying (actually IMAP appending) the message back to the original folder and then not deleting the message from move destination until the message is successfully verified to be present again at the original folder. But the simple approach was taken in the undo design since gmail (with it's non-standard or at least non-typical) imap implementation didn't exist at the time.
I personally don't rely on undo functionality, especially when 3rd party remote servers are involved. I would just copy the message back where it belongs manually and then when I'm sure it's back, delete the unwanted message. (I realize that sometimes you don't know where you moved the message to and can't find it. So that might be a reason a reliable undo is really needed.)
Ok, it looked at some code and made one temporary change just as a test (attached). It appears that if tb thinks it is undoing back into an imap4 folder, it uses just the un-store of the \deleted flag to undo the move. If it doesn't detect that the folder to undo back into is imap4, it does a copyfolder() to undo the move. So when I change the code so it doesn't detect imap4, the copyfolder (imap append) back to gmail occurs and the moved message re-appears on undo, without changing gmail's default setup at webmail.
There is another undo case where the move destination folder is also imap (like gmail's trash) and not a local folder. I haven't looked at that or if there are problems there too.
Comment 35•3 years ago
|
||
Because Thunderbird hasn't implemented UIDPLUS
Actually, I added implementation for uidplus when I first started working on imap over 5 years ago. Specifically I implemented the "uid expunge" feature. Not sure what aspects of UIDPLUS are used with undo.
I just tried deleting and moving gmail messages and they come back after undo when moved to other gmail folders. The source folder didn't update immediately after undo (had to move off and then back onto folder so see the un-did message which may be due to some of my ongoing CONDSTORE changes, not sure).
It looks like imap-js will provide this, if I correctly understand the library description correctly https://github.com/emailjs/emailjs-imap-client. But imap-js might not come in the next esr. Magnus will have a grasp of this question.
This is big shock and surprise! Didn't know that what I've been working on for 5 years is slated for discard! I thought only the simpler pop and smtp were moving to JS.
Comment 36•3 years ago
|
||
Oops. I assumed because of those open bug reports that uid expunge hadn't been implemented. prior to Bug 1352859 ? - Messages unexpectedly expunged after move when using the mark-as-deleted
pop and smtp, and ldap, were done in js first to prove the concept. imap in js of course has yet to prove itself.
Comment 37•3 years ago
|
||
There is another undo case where the move destination folder is also imap (like gmail's trash) and not a local folder. I haven't looked at that or if there are problems there too.
I confirm that all my IMAP folders are concerned by the undo problem.
Comment 38•3 years ago
|
||
I also confirm its not only GMAIL, I am having the problem with an HOTMAIL account.
However, when I drag an email from the Inbox to the Trash, and than from Trash back to the Inbox, everything works fine. And the operation is also correclty synced to the server, whether it is GMAIL, HOTMAIL or anything else.
Theres a problem only when I use the UNDO operation. So why not implementing something like, if I delete an email and then UNDO, simply implement a "move back" operation as if I was drag and dropping the email back to the original folder. Maybe this is an ugly workaround, but should work fine and the users would be happy.
Comment 39•3 years ago
|
||
Correct, the plan is to also do IMAP in JavaScript - this is the plan for more-or-less all the c++ backend. Work on imap-js will start in February. It will be behind a pref, and I would say very unlikely to have proven itself before 102 - so the old imap code is would remain until sometime in 2023.
Can't say yet how much of the emailjs-imap-client code would be used, so hard to speculate on what bugs would get fixed by it or not.
Comment 40•3 years ago
|
||
(In reply to amorim.andre.89 from comment #38)
So why not implementing something like, if I delete an email and then UNDO, simply implement a "move back" operation as if I was drag and dropping the email back to the original folder. Maybe this is an ugly workaround, but should work fine and the users would be happy.
That's essentially what my attached diff demonstrates. The "undo" just copies the messages back where it was instead of relying on just removing the \deleted flag and hoping the message comes back. Of course, there are other issues that the diff doesn't take into account.
Description
•