Open Bug 454589 Opened 16 years ago Updated 3 months ago

if filter move target folder is deleted, messages go to trash (filter should get disabled)

Categories

(MailNews Core :: Filters, defect)

defect
Not set
critical

Tracking

(Not tracked)

People

(Reporter: barnes, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: dataloss, Whiteboard: [filter-mgmt] [filterfails])

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-GB; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1
Build Identifier: Thunderbird/2.0.0.16

Take a message filter moving mail to a folder.

The folder is deleted in such a way, that it ends up in the Trash.
Thunderbird promises to disable the filter, then changes its mind and redirects mail to Trash/folder.

Only hint for the user is a (2nd) message of "filter will be updated".

Mail matching the filter will now end up in the Trash, until the Trash is emptied and the original folder is gone.


Reproducible: Always

Steps to Reproduce:
1. Create Filter, moving message to (local) folder.
2. Delete Folder, so that it ends up in the Trash.
3. Take a look at the two messages Thunderbird gives.
4. Send Mail matching filter.
Actual Results:  
Mail ends up in Trash/folder

Expected Results:  
Filter should be disabled and mail ends up in Inbox.

(Or some kind of clearer explanation like
"Updated Filter: $FILTERNAME, Mail will no longer be moved to $FOLDER, mail will be moved to "Trash/$FOLDER" should be given, when deleting the folder, so the user can correct the situation.)
Version: unspecified → 2.0
Component: General → Filters
Product: Thunderbird → MailNews Core
QA Contact: general → filters
Summary: Message filter moves mail to deleted folder → if filter move target folder is deleted, messages go to trash (filter should get disabled)
Version: 2.0 → unspecified
I've gotten the exact same results.
When I try this in Thunderbird 8, I get the message: "Deleting the folder 'test2' will disable its associated filter(s). Are you sure you want to delete the folder?"

So that part seems fixed.

However, if I confirm that message, the filter is not disabled. Running the filter on inbox folder moves messages to that folder under Trash.

So confirming bug. The check for this situation is there, but fails to really disable the filter.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to aceman from comment #2)
> However, if I confirm that message, the filter is not disabled. Running the
> filter on inbox folder moves messages to that folder under Trash.

"Delete folder" of POP3 account/Local Folders is "move folder under Trash", and, for Tb's filter, it is similar to "rename of <parentfolder>/<foldername> to Trash/<foldername>".
Tb currently tracks the "renaming of folder" and changes path in msgFilerRules.dat automatically.

Following is msgFilterRules.dat of Tb 7.0.1 after rename local Inbox/X to Inbox/XXX and delete of local Inbox/Y.
> name="Subject contains: X"
> action="Move to folder"
> actionValue="mailbox://x@x.x.x/Inbox/XXX"
> condition="AND (subject,contains,X)"
> name="Subject contains: Y"
> action="Move to folder"
> actionValue="mailbox://x@x.x.x/Trash/Y"
This is reason why filter moves to Y under Trash after delete of Y under Inbox.

If IMAP folder, Tb currently doesn't update msgFilterRules.dat upon rename/delete.

Following is msgFilterRules.dat  of Tb 7.0.1 after rename IMAP Inbox/X to Inbox/XXX and delete of IMAP Inbox/Y.
> name="IMAP - Subject contains: X"
> action="Move to folder"
> actionValue="imap://yatter.one%40gmail.com@imap.gmail.com/Inbox/X"
> condition="AND (subject,contains,X)"
> name="IMAP - Subject contains: Y"
> action="Move to folder"
> actionValue="imap://yatter.one%40gmail.com@imap.gmail.com/Inbox/Y"
This is perhaps because rename/delete of IMAP folder involves unsubscribe process which forces "immediate and permanent delete of IMAP folder". For Tb's filter, rename of IMAP folder is similar to "deletion of old folder followed by creation of new folder".
As folder pointed in msgFilterRules.dat doesn't exist any more, copy/move target folder is shown as blank when message filter is edited after rename/delete.
Whiteboard: [filter-mgmt]
(In reply to WADA from comment #4)
> (In reply to aceman from comment #2)
> > However, if I confirm that message, the filter is not disabled. Running the
> > filter on inbox folder moves messages to that folder under Trash.
> 
> "Delete folder" of POP3 account/Local Folders is "move folder under Trash",
> and, for Tb's filter, it is similar to "rename of
> <parentfolder>/<foldername> to Trash/<foldername>".
> Tb currently tracks the "renaming of folder" and changes path in
> msgFilerRules.dat automatically.
> 

Yes, the folder path is updated (to Trash/folder). The bug here is that TB says the filter will be disabled, but it really isn't.
Blocks: 265021
At this spot http://mxr.mozilla.org/comm-central/source/mailnews/local/src/nsLocalMailFolder.cpp#1778 filter->SetEnable(false) should be set on the filter. But at this spot we do not know which one it is.
Should we extend the MatchOrChangeFilterDestination function and
also nsMsgFilterList::MatchOrChangeFilterTarget() (which is the one that knows which filter matches) or make some new functions for the disabling? But it will be very similar to it (instead of just matching or updating target folder it will disable the filter). David, do you have any hints here?
Version: unspecified → Trunk
FYI. For IMAP folder case.
In testing for bug 735940, it was found that rename/move of IMAP folder is also tracked by message filter in Tb 11, although bug 735940 occurs if Tb 11.0. So, if Tb 11 or later, this bug occurs on IMAP folder too when "Move to Trash" model is used as IMAP delete model(Serve Setting).
If IMAP, any folder of the IMAP account can be selected as trash folder. And, if other than "Move to trash" model is selected as IMAP delete model, attribute of "Trash" is removed from folder(icon is changed to ordinal one, rename/delete becomes possible).
So, if IMAP, name of "Trash" can no be used as indicatior of trash, and there is no "move target folder in folder delete, called trash" when "Just mark as it" model and "Remove it immediately" model.
(In reply to S. Barnes from comment #0)
> Mail matching the filter will now end up in the Trash

mail erroneously landing in trash ...
shouldn't this bug be marked as critical, given that data loss can occur ?
Blocks: 1150799
Severity: normal → critical
Keywords: dataloss
See Also: → 189877
See Also: → 1897662
See Also: → 1897679
Whiteboard: [filter-mgmt] → [filter-mgmt] [filterfails]
Duplicate of this bug: 1150799
You need to log in before you can comment on or make changes to this bug.