Closed Bug 190354 Opened 22 years ago Closed 21 years ago

[junk] - Junk folder can't be deleted even if you have selected another folder to be the Junk Control folder

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
All
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: esther, Assigned: cavin)

Details

(Whiteboard: [adt2])

Attachments

(2 files, 1 obsolete file)

Using trunk build 20030121 on winxp and linux, once a Junk folder is labled
Special within a profile you can't delete that folder even if you have
designated a different folder to be the Junk Mail Control folder.  

1. Launch app, launch mail with and IMAP account and log in.
2. If the IMAP account does not have a Special Junk folder or any folder called
Junk, enable the Junk Mail Control to create one.
3. Once you have a Junk folder that is marked as Special, disable Junk Mail Contol
Notice the Junk folder is still displayed as a Special folder and it can't be
deleted.
4. Enable Junk Controls and select another folder in your IMAP account or in
Local Folders as the designated folder. 
Notice the Junk folder is still displayed as a Special folder, the newly
designated folder is not listed as Special and you can't delete the Junk folder
Exiting and relanching app doesn't help.

Result: User can't delete a folder the Junk folder.
Expected: When disabling Junk Controls for an account or changing the designated
 Junk Control folder the Junk folder should become a regular folder again so it
can be deleted or renamed or whatever.
nominating
Keywords: nsbeta1
QA Contact: laurel → esther
Mail triage team: nsbeta1+/adt2
Keywords: nsbeta1nsbeta1+
Whiteboard: [adt2]
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3b) Gecko/20030210]

I got this problem with my POP3 account and found the following workaround:

1. Close Mozilla
2. Remove "panacea.dat" in Profile and the .msf File of the bad folder.
   (Removing only one of the files does not work)
3. Relaunch Mozilla

Now the Folder is no longer listed as special and can be removed.

Hope this helps.
still there in 1.3
Flags: blocking1.4a+
still there in 1.3 release
Patrik Spieß : do you have the privilege to apply blocking flags? Only Mozilla
drivers can do that. 

If you are NOT a driver you can only _request_ a flag. In that case you should
change the flag to "?" indicating you request a blocking flag.

mozilla@patrik-spiess.de, please don't set flags if you don't know how. thanks.
Flags: blocking1.4a+
Using trunk builds 20030326 on winxp, macosx and linux this is still a bug. 
Note: Any folder IMAP or POP that has ever been designated as the Special Junk
folder in a profile can NOT be deleted while in that profile, even after it's no
longer the designated Junk folder even if it is named something other than Junk.  
Delete is disabled when these folders are selected.  I currently have 6 folders
in my profile 3 in IMAP and 3 in Junk that have the Special icon and cannot be
deleted by ordinary means (Exit and Relaunch, clicking the Delete button,
clicking the Delete key, DnD to Trash folder).  For IMAP, if I add this account
to another profile, I can delete the folders because they are not special in
that profile. But for Local Folders you have to do what comment #3 states (not
an acceptable workaround).
over to cavin.

there's a problem with special folders / rdf that we haven't fixed yet, and I
think the right fix is going to be too risky for 1.4

but here's a hack I suggest for now.  

as with other special folders, you can't delete them.  
that is controlled here:
MOZILLA\mailnews\base\resources\content\mail3PaneWindowCommands.js
line 88, look for canDeleteThisFolder

so, the reason we can't delete the junk folder
is that we still think it's a special folder.

the reason we still think that is complicated, involving folder flags, the
folder datasource, rdf, etc, if I remember right.

add a new function to mail3PaneWindowCommands.js, to double check if the special
folder is indeed being used.
to check that, we'd have to enumerate all servers, get the junk settings, and
see if any are set to that folder.

if not, allow delete.

you need to get all the servers
and then for each server, get server.spamSettings
and then check server.spamSettings.spamFolderURI
Assignee: sspitzer → cavin
one thing, we might want to do this:

only check server.spamSettings.spamFolderURI if server.spamSettings.moveOnSpam
is true.

I'll let cavin sort that issue out.
Added code to check if the junk mail folder can be renamed or deleted.
With the above patch the junk mail folder can now be renamed/removed. So I turn
"Junk Mail Control" off and rename (imap) folder "Junk" to "Junk1". Then I try
to turn on "Junk Mail Control" but I get an error indicating that an imap cmd is
not valid. The reason is that we think "Junk" still exists so we only issue
"subscribe Junk" cmd to the imap server (instead of the create cmd) and since
"Junk" was renamed, meaning it does not exist on the server, the server issues
an error msg. I have a patch for this problem but I'm not 100% sure if this is
the best way to address the issue so I need David to review it.
Attached patch Proposed patch for imap, v1 (obsolete) — Splinter Review
If the path for the folder does not exist then assume it's not online.
Attachment #122679 - Flags: superreview?(sspitzer)
Attachment #122681 - Flags: superreview?(bienvenu)
Cavin, would it work to clear the verified online flag when the folder was
deleted in the first place? That seems cleaner...
Incorporated comment - reset the flag in RenameClient() instead. Works for both
rename and delete.
Attachment #122681 - Attachment is obsolete: true
Comment on attachment 122697 [details] [diff] [review]
Proposed patch for imap, v2

sr=bienvenu
Attachment #122697 - Flags: superreview+
Comment on attachment 122679 [details] [diff] [review]
Proposed patch, v1

r/sr/a=sspitzer

but wait until the tree opens for 1.4 *final* before landing this.
Attachment #122679 - Flags: superreview?(sspitzer)
Attachment #122679 - Flags: superreview+
Attachment #122679 - Flags: review+
Attachment #122679 - Flags: approval1.4+
Comment on attachment 122681 [details] [diff] [review]
Proposed patch for imap, v1

clearing review request, obsolete patch
Attachment #122681 - Flags: superreview?(bienvenu)
fyi for adt: There is no easy workaround for this issue. For IMAP accounts you
could create a new profile, delete the folder, go back to the original profile
and it is removed, which is a poor workaround. For POP accounts, there is no
workaround. 
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Using trunk build 20030516 on winxp, macosx and linux this is fixed.  Tested
with new profiles and in IMAP, POP and Local Folders by creating several
folders, selecting them as Junk and then later making the Junk folder the
default for these accounts.  I was then able to delete all the folders that were
previously designated as junk.  However, I think those folders should have lost
their junk icon so the user isn't confused.  I will log a new bug for that. 
This one is verified.
Status: RESOLVED → VERIFIED
Comment on attachment 122679 [details] [diff] [review]
Proposed patch, v1

>+  canRename = canRename || !isSpecialFolder;
This caused bug 207861.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: