Closed Bug 1744107 Opened 4 years ago Closed 6 months ago

Account - Disk Space - Delete retention policy period values not available before they take effect

Categories

(Thunderbird :: Account Manager, defect, P2)

Thunderbird 91
defect

Tracking

(Not tracked)

RESOLVED FIXED
152 Branch

People

(Reporter: anjeyelf, Assigned: welpy-cw)

References

Details

(Keywords: dataloss)

Attachments

(2 files, 1 external file)

Windows 10
Thunderbird version 78.14.0 shows defect and also the latest version 91.3.2

Account Settings > Disc Space settings
OR Imap Synchronisation & Space > Disk Space

Default is 'Don't delete any messages'

If you want to select any other option, it is impossible to set the number of messages or the number of days.

You have to select the checkbox to enable access to set number of messages /days.

However, a pop up window immediately appears:
'This setting will permanently delete old messages from the remote server AND your local storage.
Are you sure you want to proceed. Ok Cancel buttons.

This pop up window has taken focus, so you cannot select the number of messages/days.
If you cancel the pop up message, then it auto deselects the option and selects the 'Don't delete any messages' option.

This means if you do not want to use whatever numbers are showing, you cannot use that function without risking deleting emails you do not want to delete.

User in Support Forum also mentions this problem.
https://support.mozilla.org/en-US/questions/1359653

For each folder - Properties > Retention Policy
You have to uncheck 'Use my account settings'
This offers access to selecting a delete option.
If you select radio button 'Delete messages more than x days old'
You get access to changing the number of days before you click on OK.
Same with 'Delete all but the most recent x messages.'

So that method offeres access to Retention Policy but only via one folder at a time.
So that method works ok.

So there is a workflow issue - which potentially causes dataloss.

Keywords: dataloss
Summary: Account - Disc Space - Delete options not accessible → Account - Disk Space - Delete retention period values not available before they take effect

I'm now using Thunderbird release 115.10.1

This serious bug has still not been fixed.

It is impossible to set the number of days you desire because Thunderbird immedately starts deleting email once you click on the 'OK' button.
You have to click on the OK button to get access to set number of days.
If you click on 'Cancel' then you cannot edit the number of days because it also deselects that option.
Users may believe they have to click on OK in order to set number of days.
This will mean loss of emails.

I've just tested this in 'Offline' mode and ended up needing to recover a load of emails.

I personally think the Priority on this needs to be set as High because users will lose emails if they click on OK because they think nothing will occur until they have set the days.

(In reply to Anje from comment #3)

I'm now using Thunderbird release 115.10.1

This serious bug has still not been fixed.

It is impossible to set the number of days you desire because Thunderbird immedately starts deleting email once you click on the 'OK' button.
You have to click on the OK button to get access to set number of days.

You can also go into Config Editor and set mail.server.server4.daysToKeepBodies and mail.server.server4.daysToKeepHdrs manually to whatever days. You have to restart TB immediately after changing these. Of course you also have to determine the appropriate server key, e.g., server4, by looking at other items in Config Editor, so not user a friendly method.

But, for me, if I just go ahead and click OK, I don't immediately see TB iterate through all the folders and start deleting older stuff. What I see is I can then set the days to whatever and nothing immediately happens. Nothing happens to delete message until I compact the individual folders.

If you click on 'Cancel' then you cannot edit the number of days because it also deselects that option.
Users may believe they have to click on OK in order to set number of days.

True.

This will mean loss of emails.

Maybe it is just my setup in that I don't typically use offline store or allow any auto-compacting. So maybe if all your messages are in offline store, it does auto-interate through all the folders and delete the older emails? But I'm only seeing deletes and expunges occur when I manually compact each individual imap folder.

I see the same effect when I go into a folder property and set the retention in the same way. That folder is only purged of old messages when I compact the folder.

I've just tested this in 'Offline' mode and ended up needing to recover a load of emails.

So you set TB to offline and it deleted all your old emails from offline store? Then when you went online, it deleted all your old emails in all folders from the server? Yes, that would be bad.

I personally think the Priority on this needs to be set as High because users will lose emails if they click on OK because they think nothing will occur until they have set the days.

Probably does need more research to determine how this really works. It's not something I've ever used and don't think I've been asked about this before.

(In reply to Wayne Mery (:wsmwk) from comment #4)

Bug 1803349 is a duplicate?

It seems like it is. Also, the support link mentions (by Anje) that you have to compact the folder for the old messages to be deleted.

Did some user-level experiments to see how this works. Haven't looked at code.

Imap:
Nothing gets expunged or deleted until you do a compact on the folder. So I haven't seen an immediate effect from clicking OK and then changing the days setting from 30 to whatever. (Note: my comment 5 was imap-centric, I was thinking this setting only applied to imap.)

Pop3/Local Folders:
If I click OK and then change the days setting, again nothing immediately happens. I have to move to another Pop3/Local Folder before the purge of older stuff occurs and just for the newly selected folder. So, for Pop3/Local Folders, compact is NOT needed to delete the older messages. As soon as you select on the folder the purge occurs.
Just to be clear, if you are parked on local folder A, then make the change to day setting, it won't affect folder A until you move off of folder A and then back to folder A. Only then will folder A be purged of older messages.

Blogs & News Feeds:
Basically the same behavior as Pop3/LF. It defaults to always deleting messages older than 30 days. If I set it to 15, there is no warning popup but only a new folder selection removes the message older than 15 days.

NNTP:
Also basically the same as Pop3/LF. It defaults never deleting but when you select to delete by days, there is no warning.

Others?:

Checking again IMAP with delete mode set to "Just mark as deleted" with a test account (don't care if messages get deleted), I sometimes do see older messages get deleted (crossed out), but not always in all folders. So it can happen but seems a bit random as to when and which folders get their messages deleted.

Looking back at older TB versions (I still have 68.10.0 running on an old machine that probably won't run newer TB), a big difference is the page to configure the setting has a [Cancel] [Ok] buttons at the bottom. On TB 68, clicking the "Delete messages more than X days old" radio button still brings up the same warning messages and if you click Ok on it, you can then set the "X days old" value (un-grays it). However, any change you make to X doesn't take effect until you click the [Ok] at the bottom and this and other changes made on the config page are reverted if you click the [Cancel] at the bottom.

Newer TB versions (maybe starting at 91, not sure) now take the "modern" approach and no longer show the [Cancel][Ok] at the bottom of the config page so any change takes place immediately and sometimes immediately deletes messages using the 30 day X parameter before you can change it to something larger. (This confirms the bug.)

So a fix to the UI is needed to work around this issue. Maybe the pop-up warning dialog could include the ability to set the "X days old" value so it only takes effect when the pop-up warning dialog's [Ok] is clicked.

Basically I was guessing this problem had not been fixed, so the reason I was in 'Offline' mode was to prevent anything getting removed off the server during the test.
I have both Pop and Imap and emails are fully downloaded.

Emails started being deleted as soon as I clicked on the OK.
So by the time I'm altering the days, deletion is already occuring. I see the action info occuring in the Status Bar.
Fortunately it only effected one pop folder before I was able to increase the number radically.

I was able to recover emails because I had not compacted anything, so it was a simple case of altering the mbox file X-Mozilla-Status number and resaving the file.

This is not a process I generally use, but I was testing for bugs and this is a serious one.
The purpose of the test was to see if it was possible to alter the number of days before clicking on OK. It is not.
So if the default is a low 30 then you stand a good chance of serious loss.
People may use this method for mass deleting of old emails when it would be inefficient to do it in any other way. EG emails older than 3 years, so 30 days is significantly different from eg: 1000

So a fix to the UI is needed to work around this issue. Maybe the pop-up warning dialog could include the ability to set the "X days old" value so it only takes effect when the pop-up warning dialog's [Ok] is clicked.

Agree.

This issue also effects
'Disk Space' - 'Delete all but the most recent xx messages'

I'm still seeing the deletion of old messages as a seemingly random process. I enabled the time to 1000 days on an imap account with mostly messages older than that and all with offline store. I didn't see anything happen at first or after a few hours. Then the next morning all the old messages in all the folders were crossed out (using just mark as deleted, also computer was hibernated overnight with TB not shutdown). So it took a while for anything to happen.
I think it might be done on an 8 hour time base: mail.purge.min_delay = 480 minute default -- but just a guess.

I was able to recover emails because I had not compacted anything, so it was a simple case of altering the mbox file X-Mozilla-Status number and resaving the file.

Off topic but curious what the value you set for X-Mozilla-Status to bring back deleted emails? I was working on a pop3 bug and did something so all the messages disappeared. But all the mbox and .msf files were still there. I had to restore them from backup to bring them back since I didn't want to re-download over 30K messages. So maybe I just needed to modify the X-Mozilla-Status?

Here's a simple possible fix for imap. (I think pop and others may need a similar fix.)
This just lets you set the number of days or the number of messages to keep, independent of the current radio button selection. But the user setting of number of message or days doesn't take effect until OK is clicked in the warning pop-up.

It also adds some text to the warning pop-up that the deletion WILL be immediate and to make sure the correct value is set before clicking OK.

This doesn't change how the UI works in the retention setting of folder properties. It is still correct there because it has the final [Cancel][Ok] buttons, which no longer exist for the Sync & Storage settings page.

(In reply to gene smith from comment #9)

Off topic but curious what the value you set for X-Mozilla-Status to bring back deleted emails? I was working on a pop3 bug and did something so all the messages disappeared. But all the mbox and .msf files were still there. I had to restore them from backup to bring them back since I didn't want to re-download over 30K messages. So maybe I just needed to modify the X-Mozilla-Status?

Opened mbox file in Notepad.
Used 'Edit' > 'Find'
Search for X-Mozilla-Status:
eg: X-Mozilla-Status: 1009 or 1015 - Whatever the last digit - eg: 9 or 5 - change to 1
Work down through file modifying as required.
Save file
Delete the relevant *.msf file
Start Thunderbird. Emails reappear.

(In reply to Anje from comment #11)

Thanks for info on fixing mbox files when messages get deleted!

Here's an "improved" WIP version of the previous patch.

Duplicate of this bug: 1803349

Alex, what do you think of this approach?

Flags: needinfo?(arschmitz)
Summary: Account - Disk Space - Delete retention period values not available before they take effect → Account - Disk Space - Delete retention policy period values not available before they take effect
Duplicate of this bug: 1774769

This continues to be a problem in 140.7.0esr and beta 148.0b2

Only safe ways to alter them is either

  1. Via Config Editor for each server number and then enable the option in Account Settings.
  2. Exit Thunderbird and edit the 'prefs.js' file for each server number. Restart TB and then enable the desired option.

eg: delete all but most recent X messages
mail.server.server1.numHdrsToKeep - alter to a safer number

eg: number of days for delete messages more than x days
mail.server.server1.daysToKeepHdrs - alter to a safer number

Duplicate of this bug: 2012471
Severity: -- → S2
Priority: -- → P2

(In reply to Magnus Melin [:mkmelin] from bug 2012471 comment #1)

Indeed, this is one case where instant apply doesn't really work out.
(The whole feature is nonsense IMHO, and would be better allowing filters running periodically on folders, deleting what's specified.)

Not sure what to do about it. Maybe those fields should be blank from start, forcing the user to enter something. And making sure the policy is not applied unless there's a value.

What about adding pause and resume methods to nsIMsgPurgeService, similar to those in nsIAutoSyncManager?

Although the simplest fix would probably be putting the 'Delete messages' selectbox and 'Keep starred messages' checkbox into a subdialog that can be opened by a 'Retention Policy' button, similar to the 'Advanced…' one directly above.

Having all those settings in an advanced dialog would probably be best yeah, IMHO.

Putting the settings in the dialog is probably the best i think as well.

Flags: needinfo?(arschmitz)

Removing the 'Remove bodies from messages more than' NNTP option that has never been functional could be the first step.

Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Depends on: 499301
  • Moves shared retention logic to RetentionSettingsUI.sys.mjs.
  • Implements a new sub-dialog for Account Settings retention.
  • Harmonizes IDs across Folder Properties and Account Settings.
  • Migrates retention strings from DTD to Fluent.
  • Updates accessibility attributes for numeric inputs.
Target Milestone: --- → 152 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/2320a441101b
Modernize Message Retention UI and migrate to Fluent. r=aleca,coreycb,mkmelin

Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: