Closed Bug 1412779 Opened 8 years ago Closed 5 years ago

Pressing Repair folder twice on IMAP inbox deletes all INBOX messages

Categories

(Thunderbird :: Folder and Message Lists, defect)

52 Branch
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: liviu, Unassigned)

References

Details

(Keywords: dataloss)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36 Steps to reproduce: 1. Install an IMAP account in thunderbird 52.4.0 with a few messages on inbox 2. Open the folder properties 3. Click on repair folder 4. Click on repair folder again soon after or while the repair is ongoing (this bug replicates even if you pressed repair, closed the dialog and reopened the dialog after 20-30 seconds and pressed repair again) Actual results: 1. All messages in inbox have been deleted 2. All messages from the server are marked for deletion and are deleted on the application exit Expected results: 1. The folder index should have been repaired, no message should be deleted.
Severity: normal → critical
Keywords: dataloss
Yeah, sure we should prevent another repair or compact while a previous one is in progress (there is/should be some lock on the folder). But I am surprised it deletes the folders on the server. What in the repair process would send the "mark message as deleted" for each message to the server? Wayne, have you been able to confirm this locally?
I have not tested. I'm not sure I have an account where I would want to :) Let's see if anyone else has a setup they can test.
Tested with my AOL IMAP account in Thunderbird 52.4.0 on Windows and Linux. Repaired the Inbox twice and all 26 messages still remain. Did multiple tests. Quit and restarted Thunderbird multiple times and messages still remain. There is a warning message if you try and do a second repair too quickly. "The operation failed because another operation is using the folder. Please wait for that operation to finish and try again." I don't see where the Reporter mentions the folders on the server being deleted.
I have reproduced the bug multiple times, if required I can make a video. OS - windows 10 - client, server IMAP - dovecot 1.2.9, ubuntu 10.04
I fortunately can't reproduce this on Windows.
(In reply to Liviu Olos from comment #4) > I have reproduced the bug multiple times, if required I can make a video. > OS - windows 10 - client, server IMAP - dovecot 1.2.9, ubuntu 10.04 Liviu, a video would be great
Flags: needinfo?(liviu)
I was looking for another bug with repair folder, and found this. My report: Could not reproduce on Linux x64, TB 52.7.0 (64-bit) I did click many times, even closing and reopening the window, as suggested. Nothing happens on click. After finishing current repair, it starts ANOTHER (unnecessary?) repair. But no message lost. Tested folder is my INBOX, 4211 messages, 85MB folder size, maildirs mode. Isn't this some bug in the IMAP server? My imap server is a dovecot with maildirs.

We have the same bug in our environment.
Thunderbird 60.3.1 and 52.8.0
hMailServer 5.6.7 - Build 2425

I can reproduce it with the same steps on different Clients.

I had 4 read mails in my Inbox.
Excerpt from hMailServer-Logfile:

"SENT: 21 OK IDLE terminated"
"RECEIVED: 22 noop"
"SENT: 22 OK NOOP completed"
"RECEIVED: 23 getquotaroot "INBOX""
"SENT: * QUOTAROOT "INBOX" ""[nl]* QUOTA "" ()[nl]23 OK GETQUOTAROOT completed"
"RECEIVED: 24 UID fetch 1:* (FLAGS)"
"SENT: * 1 FETCH (UID 16089 FLAGS (\Deleted \Seen))"
"SENT: * 2 FETCH (UID 16090 FLAGS (\Deleted \Seen))"
"SENT: * 3 FETCH (UID 16091 FLAGS (\Deleted \Seen))"
"SENT: * 4 FETCH (UID 16092 FLAGS (\Deleted \Seen))"
"SENT: 24 OK UID completed"
"RECEIVED: 25 IDLE"
"SENT: + idling"

Is there a way to hide or disable the repair button?

Gene, is imap involvement within the realm of possibility?

I've never been able to reproduce.

bug 1528911 would seem to be a duplicate

Flags: needinfo?(gds)

(In reply to p.buchholz from comment #8)

We have the same bug in our environment.
Thunderbird 60.3.1 and 52.8.0
hMailServer 5.6.7 - Build 2425

I can reproduce it with the same steps on different Clients.

Do you mean different not-TB clients? Pretty sure you mean different TB clients. Just want to make sure.

I had 4 read mails in my Inbox.
Excerpt from hMailServer-Logfile:

"SENT: 21 OK IDLE terminated"
"RECEIVED: 22 noop"
"SENT: 22 OK NOOP completed"
"RECEIVED: 23 getquotaroot "INBOX""
"SENT: * QUOTAROOT "INBOX" ""[nl]* QUOTA "" ()[nl]23 OK GETQUOTAROOT completed"
"RECEIVED: 24 UID fetch 1:* (FLAGS)"
"SENT: * 1 FETCH (UID 16089 FLAGS (\Deleted \Seen))"
"SENT: * 2 FETCH (UID 16090 FLAGS (\Deleted \Seen))"
"SENT: * 3 FETCH (UID 16091 FLAGS (\Deleted \Seen))"
"SENT: * 4 FETCH (UID 16092 FLAGS (\Deleted \Seen))"
"SENT: 24 OK UID completed"
"RECEIVED: 25 IDLE"
"SENT: + idling"

Yes, this shows the messages marked with \Deleted. What would be most helpful is to see the log while the repairs are in progress. Then we could see if tb is really setting the \deleted flag on all your messages. Tb would have to be sending something like "store flag /deleted on uid 16089" for every message in the mailbox (I don't remember the exact syntax of the imap store command.)

In the cloned bug 1528911 and at comment 0 of this bug it says the messages are completely deleted (expunged) on tb close. When I mark messages as deleted they are not expunged on exit so this is a bit surprising. If you change your delete method to "just mark as deleted" do you not see the "deleted" messages with a red X and a line through them? If you do, you can always un-delete them.

Is there a way to hide or disable the repair button?

Not that I can find.

Also, if a server log is not available, please record the IMAP:5 log while doing repairs and attach it with the "Attach File" link above. See https://wiki.mozilla.org/MailNews:Logging#Generating_a_Protocol_Log

Flags: needinfo?(gds)

I've tried this on 2 non-Inbox folders on two different servers and don't see a problem.

I haven't tried Inbox. For reporters that see this, does it occur also on non-Inbox folders?

Also, for reporters that see this, do you have any possible non-default setting like no offline store or using maildir for offline store?

There's a remote possibility that the expunged messages are occurring because of auto-compacting. Do you see a prompt to compact all your folders and answer yes right before you notice the messages are gone? This may also happen automatically with no prompt if you told it not to ask in the past. This can be reset by setting mail.purge.ask back to true in config editor.

You can also completely disable compacting at Prefs/Options|Advanced|Network & Disk Space|Compact all folders...checkbox.

Of course, this doesn't explain why the messages are getting marked \deleted in the first place.

Is there any chance that the messages marked \deleted actually got moved to another folder? This may occur due to junk detection or possibly a filter. (Probably unlikely if every message in Inbox got moved and there are 1000's of them.)

Folder repair should not affect the server mailbox state at all. So unless a reporter can provide a tb IMAP:5 log or a server log showing tb marking messages as \deleted, this bug should be classified as INVALID.

p.buchholz, are you able to offer insight to comment 12 and comment 13? And if so can you provide a log as detailed at the end of comment 10.

Flags: needinfo?(liviu) → needinfo?(p.buchholz)
Whiteboard: [closeme 2020-06-10]

Resolved per whiteboard

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(p.buchholz)
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2020-06-10]
You need to log in before you can comment on or make changes to this bug.