Closed Bug 228949 Opened 18 years ago Closed 10 years ago

marking as junk with "delete mail marked as junk" set will undelete deleted mail

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 12.0

People

(Reporter: cross, Assigned: rkent)

References

Details

Attachments

(2 files)

I have my options (on my IMAP mail folders/accounts) set such that deleted
messages are "marked as deleted", and when I manually mark a message as junk, it
should delete that message.
However, if a message is already marked for deletion, marking it as junk will
UNdelete it.  It appears that the "delete" is applied, and acts as a toggle.

This bug has been present for a long time, in both Mozilla Mail and Thunderbird.

Recreate:
1) Set the two prefs mentioned above as mentioned
2) Delete a non-pre-junked message
3) Mark said message as junk.

Results:
Message gets undeleted

Expected results:
Message gets marked as junk, but stays deleted.
Dupe of bug 208950?
I don't think so.  It's hard to tell what problem bug #208950 is describing, but
I think it's talking about:
 - User selects Tools->Delete Mail Marked As Junk; and it will undelete any junk
mail that's already marked as deleted.

  Interestingly, I *don't* have that problem.  I don't think so at least.  I
have occasionally gone through and marked mail messages as junk, which cases
them to be deleted, and when I select "Delete Mail Marked As Junk..." it deletes
the other junk mail, and leaves the mail I manually marked as junk as deleted.

  My problem is when junking something, not when deleteing something.  Unlikely
a dup of bug #208950.
This bug does, indeed, seem to have been present for a long time.  From what I
can tell, any action that causes a message to be marked as "junk" will toggle
the delete status of that message.

This is annoying, since I have several different browsers up on different
machines (one at home, one at work, one on my laptop).  Sometimes more than one
of them will declare something junk -- as a result, I seem to have a bunch of
messages marked as junk but undeleted... 
(In reply to comment #2)
>   My problem is when junking something, not when deleteing something.  

Well, that would be true if you did not have the Junk Controls "delete when 
marked as junk" setting turned on.  As it is, you actually *are* deleting 
something when you junk it.  

If you type the <del> key on a deleted message, it undeletes.

See also Thunderbird bug 243586.
Summary: marking as junk when "delete mail marked as junk" will undelete deleted mail → marking as junk with "delete mail marked as junk" set will undelete deleted mail
Product: Browser → Seamonkey
Assignee: sspitzer → mail
Assignee: mail → nobody
Component: MailNews: Main Mail Window → MailNews: Backend
Product: Mozilla Application Suite → Core
QA Contact: esther
*** Bug 208950 has been marked as a duplicate of this bug. ***
*** Bug 243586 has been marked as a duplicate of this bug. ***
Can this please be picked up?  I don't immagine it would be that hard to have
the "delete" action taken as a result of marking a message as junk, when the
"delete mail marked as junk" pref is set, to actually check the message state to
make sure it's not deleted before performing the "delete" action (which really
just toggles the deleted state).
As otherwise noted, changing the way that action (the "delete" action) works
would be undesireable, so I think a check should just be put in for this one
code path.  I can't immagine anyone wants marking mail as junk to toggle the
messages deleted state.
Am I correct that it's basically this easy to fix?
(In reply to comment #7)
>Can this please be picked up?  I don't immagine it would be that hard to have
>the "delete" action taken as a result of marking a message as junk, when the
>"delete mail marked as junk" pref is set, to actually check the message state
>to make sure it's not deleted before performing the "delete" action (which
>really just toggles the deleted state).
Unfortunately the junk mail code doesn't know what the delete action is, or even
if there is a delete action. Of course, if people decided that it was safe to
apply a deleteNoTrash command to junk mail instead, as that never undeletes...
version 3.0a2pre (2008071003) - WFM
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Nikolay, this is the second bug I've encountered that you've WFM'd apparently without testing, or not testing correctly.  This symptom still manifests.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Retested reproduced, seems I misunderstand steeps to reproduce for first time.
Status: REOPENED → NEW
QA Contact: backend
Product: Core → MailNews Core
Kent, this is very close related to recently fixed bug 515927, maybe you interested to look into this.
I'm going to assign this to myself just so that it shows up on my radar screen, but if the fix is difficult I will probably punt.
Assignee: nobody → kent
Status: NEW → ASSIGNED
oddly similar to bug 578412
Thought I'd toss off a try at this. Seems to me though that the decision to interpret "DeleteMessages" as "toggle delete" in the case of nsMsgImapDeleteModels::IMAPDelete was not the right one originally.
Attachment #581970 - Flags: review?(dbienvenu)
(In reply to Kent James (:rkent) from comment #15)
> Created attachment 581970 [details] [diff] [review]
> Only ask to delete undeleted messages
> 
> Thought I'd toss off a try at this. Seems to me though that the decision to
> interpret "DeleteMessages" as "toggle delete" in the case of
> nsMsgImapDeleteModels::IMAPDelete was not the right one originally.

From the UI, for toggling the delete state, it's a reasonable choice, I think (if anything about the IMAP delete model can be called reasonable), but yeah, not for the backend code.
Comment on attachment 581970 [details] [diff] [review]
Only ask to delete undeleted messages

thx, looks ok (though it's bit-rotted so you'll need to de-bit-rot before landing).
Attachment #581970 - Flags: review?(dbienvenu) → review+
(In reply to David :Bienvenu from comment #17)
> Comment on attachment 581970 [details] [diff] [review]
> Only ask to delete undeleted messages
> 
> thx, looks ok (though it's bit-rotted so you'll need to de-bit-rot before
> landing).

ping :-)
Yeah sorry, I keep getting distracted by other things. I'll try very hard to get to this tomorrow.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 12.0
You need to log in before you can comment on or make changes to this bug.