Closed Bug 412690 Opened 13 years ago Closed 12 years ago

Drafts/Templates/Outbox should be excluded from the retention policy

Categories

(MailNews Core :: Backend, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: oxmosys, Assigned: mkmelin)

Details

(Keywords: dataloss)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11
Build Identifier: 2.0.0.6 and 3.0a1pre.en-US.linux-i686

when using the "delete message more than * days old" in the preference of an account through the account manager, all messages that are older than the used value are automatically deleted, including templates and drafts which should NEVER be deleted automatically since they are drafts and templates, not emails.

Reproducible: Always

Steps to Reproduce:
1. Create a new profile in Thunderbird and configure a fictive email account
2. Go to Edit / Account Settings
3. Select the Disk Space left tab.
4. Check the "delete messages more than * days old" option and set it for 5 days.
5. Write a new message and save it to templates
6. Close Thunderbird and change the date of your computer to be 6 days in the future
7. Re-Open Thunderbird.
Actual Results:  
Templates were deleted.

Expected Results:  
Templates should not have been deleted.

I would say that it's a critical bug since it can leads to lose data, it's what happened to me but since it doesn't look that this bug has been filed in the past, perhaps it didn't affect a lot of people and that the severity can be lower.
What option do you choose in Properties/Retention Policy of Drafts/Templates folder? "Use server defaults"=ON, isn't it?

When new profile/new account by Tb 2.0, default of "Retention Policy" of  Drafts/Templates looks to be "Use server defaults"=OFF & "Don't delete any message"=ON.
And, when folder of POP3 account created by "New Folder" of Tb2, default looks to be "Use server defaults"=ON & "Don't delete any message"=ON(grayed out, because "Use server defaults" is enabled). This seems to be applied to Inbox too.

Did you set "Use server defaults" for Drafts/Templates in the past by yourself?

Upgrade to Tb which started to support "Retention Policy" possibly set "Use server defaults"=ON for existing folders, including Drafts/Templates.
When(by which version of Tb) were mail folders created?
Check "Retention Policy" of all mail folders.
Is "Retention Policy" set appropriately?
Here's exactly what happens with Tb 2.0.0.6 :

After creating a new account, there's no templates folder, until I create a new message and save it as a template. 

Once the templates folder has been created, retention policy is "Use server defaults"=ON and "Don't delete any message" is grayed. 

After closing Thunderbird and opening it again, it changed. Templates folder retention policy is now : "Use server defaults"=OFF and "Don't delete any message"=ON.

After changing local folder account settings in edit / account settings / disk space left tab to "Delete message more than 5 days old", Templates folder retention policy is still "Use server defaults"=OFF and "Don't delete any message"=ON.

After closing and re-opening Thunderbird, Templates folder retention policy is now : "Use server defaults"=OFF and "Delete messages more than 5 days old"=ON
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Summary: Drafts and Templates are also deleted when using "delete messages more than * days old" → Drafts and Templates should be excluded from the retention policy
Keywords: dataloss
edge case?  if not, blocking v3 might be wanted
Flags: blocking-thunderbird3?
Keywords: qawanted
Flags: wanted-thunderbird3+
Flags: blocking-thunderbird3?
Flags: blocking-thunderbird3-
Will take this myself.
Assignee: nobody → mkmelin+mozilla
Priority: -- → P2
Target Milestone: --- → Thunderbird 3.0b2
Keywords: qawanted
Target Milestone: Thunderbird 3.0b1 → Thunderbird 3.0b2
Status: NEW → ASSIGNED
Component: Account Manager → Backend
Product: Thunderbird → MailNews Core
QA Contact: account-manager → backend
Target Milestone: Thunderbird 3.0b2 → Thunderbird 3.0b3
Summary: Drafts and Templates should be excluded from the retention policy → Drafts/Templates/Outbox should be excluded from the retention policy
Attached patch proposed fix (obsolete) — Splinter Review
This makes the backend ignore retention settings for drafts/templates/outbox and their descendants. 

Adding a isSpecialFolder method to nsIMsgFolder - the implementation matches the current IsSpecialFolder method we have in js. (Moving over callers in a followup bug.)
Attachment #363586 - Flags: superreview?(bienvenu)
Attachment #363586 - Flags: review?(bienvenu)
Ignore the "Templatest" comment type.
Attached patch proposed fix, v2Splinter Review
Unbitrot.
Attachment #363586 - Attachment is obsolete: true
Attachment #367859 - Flags: superreview?(bienvenu)
Attachment #367859 - Flags: review?(bienvenu)
Attachment #363586 - Flags: superreview?(bienvenu)
Attachment #363586 - Flags: review?(bienvenu)
Comment on attachment 367859 [details] [diff] [review]
proposed fix, v2

thx, Magnus
Attachment #367859 - Flags: superreview?(bienvenu)
Attachment #367859 - Flags: superreview+
Attachment #367859 - Flags: review?(bienvenu)
Attachment #367859 - Flags: review+
changeset:   2244:6709fd4601d4
http://hg.mozilla.org/comm-central/rev/6709fd4601d4

->FIXED
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Is the retention policy affecting the new Archive folders?
Yes, I don't see any reason why it wouldn't (assuming you set it to do so, of course). 

For the fixed cases, it's simply not useful, and might give quite un
expected results if you set the account wide policy.
You need to log in before you can comment on or make changes to this bug.