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



MailNews: Message Display
15 years ago
13 years ago


(Reporter: esther, Assigned: Cavin Song)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [adt2])


(2 attachments, 1 obsolete attachment)

4.62 KB, patch
(not reading, please use seth@sspitzer.org instead)
: review+
(not reading, please use seth@sspitzer.org instead)
: superreview+
(not reading, please use seth@sspitzer.org instead)
: approval1.4+
Details | Diff | Splinter Review
928 bytes, patch
: superreview+
Details | Diff | Splinter Review


15 years ago
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
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.

Comment 1

15 years ago
Keywords: nsbeta1
QA Contact: laurel → esther

Comment 2

15 years ago
Mail triage team: nsbeta1+/adt2
Keywords: nsbeta1 → nsbeta1+
Whiteboard: [adt2]

Comment 3

15 years ago
[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.

Comment 4

15 years ago
still there in 1.3
Flags: blocking1.4a+

Comment 5

15 years ago
still there in 1.3 release

Comment 6

15 years ago
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.

Comment 7

15 years ago
mozilla@patrik-spiess.de, please don't set flags if you don't know how. thanks.
Flags: blocking1.4a+

Comment 8

15 years ago
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:
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.

Comment 11

15 years ago
Created attachment 122679 [details] [diff] [review]
Proposed patch, v1

Added code to check if the junk mail folder can be renamed or deleted.

Comment 12

15 years ago
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.

Comment 13

15 years ago
Created attachment 122681 [details] [diff] [review]
Proposed patch for imap, v1

If the path for the folder does not exist then assume it's not online.


15 years ago
Attachment #122679 - Flags: superreview?(sspitzer)


15 years ago
Attachment #122681 - Flags: superreview?(bienvenu)

Comment 14

15 years ago
Cavin, would it work to clear the verified online flag when the folder was
deleted in the first place? That seems cleaner...

Comment 15

15 years ago
Created attachment 122697 [details] [diff] [review]
Proposed patch for imap, v2

Incorporated comment - reset the flag in RenameClient() instead. Works for both
rename and delete.
Attachment #122681 - Attachment is obsolete: true

Comment 16

15 years ago
Comment on attachment 122697 [details] [diff] [review]
Proposed patch for imap, v2

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


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)

Comment 19

15 years ago
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

Comment 20

15 years ago
Fix checked in.
Last Resolved: 15 years ago
Resolution: --- → FIXED

Comment 21

15 years ago
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.

Comment 22

14 years ago
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.