Closed Bug 505949 Opened 15 years ago Closed 15 years ago

Junk folder on Local Folders not created and possible data loss

Categories

(MailNews Core :: Account Manager, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0rc1

People

(Reporter: my_spam_basket, Assigned: rkent)

References

Details

(Keywords: dataloss, regression, Whiteboard: [no l10n impact])

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1pre) Gecko/20090717 SeaMonkey/2.0b1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1pre) Gecko/20090717 SeaMonkey/2.0b1

SM doesn't create a Junk folder under Local Folder Branch though the preferences have been set to do so.

Reproducible: Always

Steps to Reproduce:
1. on first launch after SM installation, create a new email account;
2. set everywhere in your junk mail preferences to "move new junk
messages to Junk folder on Local Folders";
3. manually mark whatever imported or arrived message as junk.
Actual Results:  
No junk folder is created under Local Folders as it was happening in previous SM versions.
Junk mail is moved to the trash folder and marked read without notice.
In addition to this, if I manually mark as "junk" a message already in
the trash folder, it disappears in nowhere land with possible data loss.

Expected Results:  
A "junk" folder is created under Local Folder branch and all junk mails are moved there according to junk preferences.

If I manually create a Junk folder under Local Folders, junk mails are correctly moved there afterward.
Confirming with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2pre) Gecko/20090721 SeaMonkey/2.0b2pre.

Beware: Choosing "Other: [Junk on Local Folders]" will create the Junk folder after pressing OK, thus changing the conditions needed to reproduce this bug.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows Vista → All
Hardware: x86 → All
Version: unspecified → Trunk
(In reply to comment #0)
> Steps to Reproduce:
>(snip)
> 2. set everywhere in your junk mail preferences to "move new junk messages to Junk folder on Local Folders";

Junk settings exists in Preferences too.
(Preference/Mail&Newgroups/Junk Mail)
> [ ] When I mark messages as junk:
>     (  ) Move them to the account's Junk folder
>     (  ) Delete them
>(snip)
> [ ] Enable Junk filter logging
(corresponding prefs.js entries)
> mail.spam.manualMark     : true = "When I mark messages as junk" is On
> mail.spam.manualMarkMode : 0 = Move them to the account's Junk folder
>                            1 = Delete them
> mail.spam.logging.enabled : true/false
And each account's setting is held in next entries.
> mail.server.serverN.moveOnSpam
> mail.server.serverN.spamActionTargetAccount
> mail.server.serverN.spamActionTargetFolder

What is set in above entries of your prefs.js? (check via about:config at URLBar)

> Steps to Reproduce:
>(snip)
> 2. set everywhere in your junk mail preferences to "move new junk messages to Junk folder on Local Folders";

According to comment #1, "Junk folder of Local Folders" is created upon your setting of "move new junk messages to Junk folder on Local Folders".
What operation at which panel do you mean by step 2?
(In reply to comment #2)

> > mail.server.serverN.moveOnSpam
> > mail.server.serverN.spamActionTargetAccount
> > mail.server.serverN.spamActionTargetFolder
> 
> What is set in above entries of your prefs.js? (check via about:config at
> URLBar)

I see:

mail.server.server.moveOnSpam set to "True"

mail.server.serverN.spamActionTargetAccount set to "mailbox://nobody@Local%20Folders"

mail.server.serverN.spamActionTargetFolder set to "mailbox://nobody@Local%20Folders/Junk"

for each of my accounts.

> According to comment #1, "Junk folder of Local Folders" is created upon your
> setting of "move new junk messages to Junk folder on Local Folders".
> What operation at which panel do you mean by step 2?

With "everywhere" I meant including:

a) specific account junk preferences;
b) Local Folders account junk preferences;
c) General junk preferences (Edit->Preferences->Mail &NewsGroup->Junk Mail")

I am not sure when the junk folder was created under Local Folders in previous  builds (after a, b or c?) but it was surely and automatically created by SM.

Now, it doesn't happen.
(In reply to comment #3)
> I am not sure when the junk folder was created under Local Folders in previous builds (after a, b or c?)

My guess is Bug 484348 Comment #10.

> but it was surely and automatically created by SM.
> Now, it doesn't happen.

With which SeaMonkey 2 build? Does it mean this bug is already WORKSFORME for you?
Does it mean "automatically created by SM upon account creation"?
Or upon your setting change(including "OK" at UI without change, keeping "Junk of this account" or "Junk of other account" or "any folder of any account" at UI)?
Blocks: 484348
(In reply to comment #4)

[...]

> With which SeaMonkey 2 build? Does it mean this bug is already WORKSFORME for
> you?

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1pre) Gecko/20090717 SeaMonkey/2.0b1

And no, it doesn't works for me. :-)

Yes, If I manually create the junk folder, junk mails are correctly otherwise everithing happens as in Bug 484348.

> Or upon your setting change(including "OK" at UI without change, keeping "Junk
> of this account" or "Junk of other account" or "any folder of any account" at
> UI)?

After having created a first account, I've set junk preferences in Mail & Newsgroup Settings and pressed OK in that dialog window. If I'm not wrong SM doesn't move junk mails by default. They're marked as such and stay where they are.

To be clear as much as possible, in "Mail & Newsgroup Settings", I've simply ticked these options in addition to the default ones:

"Trust junk mail headers set by:" [SpamAssassin]
"Move new junk messages to:" [Junk folders on Local Folder]
"Automatically delete junk mail older than" [3 days]

I *never* changed any folder to which move junk mails, I've simply chosen the default folders ("Junk folder on Local Folders]

Usually, I create all my accounts (4 emails and 2 newsgroups) via "Mail & Newsgroup Settings" at once, setting the needed junk preferences, and then I click on OK and that's all.
I could reproduce all phenomena by simply define POP3 account with Global Inbox=Local Folders, with new profile.
Once Junk is created by hand or by Choosing "Other: [Junk on Local Folders]", Junk was re-created by "Mark As Junk", even after manual deletion of Junk and Junk.msf.      

As I wrote in Bug 484348 Comment #10, I think there is mismatch between account definition and Junk filter/move.
 - Account definition stopped to create Junk folder.
   (change based on users request not to create unwanted/unused folder)
 - UI of "Move new junk messages to: [Junk folders on Local Folder]"
   doesn't create Junk folder. ("Others:" creates Junk folder)
 - Junk filter/move doesn't newly create Junk folder as before.
   Junk filter/move recreates only when Junk folder is already known.
I reproduced problem with Tb trunk.
> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2pre) Gecko/20090728 Shredder/3.0b4pre
Changing to MailNews Core based on Bug 484348 Comment #3 and Bug 484348 Comment #4.
Component: MailNews: General → Account Manager
Product: SeaMonkey → MailNews Core
QA Contact: mail → account-manager
Setting Component=Account Manager, because I think regression by changes around Account Manager. Please correct it if it's wrong.
OK, here is - more detailed - what I reported in #484348:

This is with:

"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3pre) Gecko/20090731 SeaMonkey/2.0b2pre"

Prepare:
- create fresh profile
- create new POP3 email account following the wizard and leaving everything default (not (!) using "Local Folders" as global inbox)
- checkbox to download messages right now is checked by default, so enter password and choose to save password
- account has 2 folders: "Inbox" and "Trash"
- in "Account Settings" --> "Junk Settings": enable "Move new junk messages to", leave '"Junk" folder on: aaa@bbb.com' on as it is
- account still has 2 folders, no "Junk" folder
- in "Preferences" --> "Mail & Newsgroups" --> "Junk Mail", enable "When I mark messages as junk", leave 'Move them to account's "Junk" folder' on as it is 
- account still has 2 folders, no "Junk" folder
- wait for incoming emails

Test case (1):
- mark a non-junk message as junk
- mail is moved to "Trash" folder (no "Junk" folder exists)
- change to "Trash" an mark email as non-junk and then as junk again
- email disappears

Test case (2):
- incoming emails automatically marked as junk stay in "Inbox"

Now
- create a folder called "Junk" manually
- notice the folder has a normal subfolder-icon, not the junk-icon

Repeat (1):
- emails marked as junk manually now go to "Junk" folder as they should
- marking emails in "Junk" folder as non-junk an then as junk again doesn't do anything, they just stay in "Junk"

Repeat (2):
- emails marked as junk automatically now go to "Junk" folder as they should

Now
- close all windows and restart SeaMonkey
- open Mail & News
- notice the "Junk" folder now has the junk-icon
- notice the behaviour when marking junk-emails in "Junk" as non-junk again has changed after restart:
- they now go back to "Inbox" instead of staying in "Junk"
(In reply to comment #9)
> - create a folder called "Junk" manually
> - notice the folder has a normal subfolder-icon, not the junk-icon

It's Bug 497288. See also Bug 467527.  

> - notice the behaviour when marking junk-emails in "Junk" as non-junk again has changed after restart:
> - they now go back to "Inbox" instead of staying in "Junk"

See (B) of Bug 487610 Comment #3.
FYI.

"Move to Trash, if Junk doesn't exists, and if mail.server.serverN.moveTargetMode is not set" doesn't occur on ordinal POP3 account(no Global Inbox use). When ordinal POP3 account, mail marked as Junk was kept in the local mail folder when Junk folder doesn't exist. "Move to Trash" looks to occur only on "Local Folders".

If spamActionTargetFolder of an IMAP account points to non existent local mail folder of a local account(POP3, Local Folders), IMAP code creates root-level Junk folder at the pointed local account. IMAP code looks to have "fall back to root-level Junk" feature, instead of "Move to Trash", in case of "specified junk folder doesn't exist". See Bug 503735 for IMAP case.
if this really is dataloss, shouldn't keyword and sev change?
I agree on that. This should block 2.0 in my opinion.
Flags: blocking-seamonkey2.0?
Flags: blocking-thunderbird3?
on what aspect of this do you suggest this wants to block?  it wouldn't be the dataloss of marking junk in trash - that's surely an uncommon usage.

also, can you determine the regression range?
Severity: normal → critical
Keywords: dataloss
Not holding off a 2.0 release on this, but a fix would probably be nice.
Flags: blocking-seamonkey2.0? → blocking-seamonkey2.0-
Doesn't sound like it would block TB3.
Flags: blocking-thunderbird3? → blocking-thunderbird3-
I guess I'm going to have to try to fix this.
Assignee: nobody → kent
Status: NEW → ASSIGNED
This should fix a number of related bugs as well. I suspect this is the root cause of bug 503735 as well, but that bug's patch may still make sense as the damage the messed up preference causes there is more severe than the cases here.

Requesting blocking so we can get it landed, and because it really causes problems with POP. a+ would be enough though.
Attachment #402450 - Flags: superreview?(bienvenu)
Attachment #402450 - Flags: review?(bienvenu)
Whiteboard: [needs r/sr bienvenu]
Severity: critical → major
Flags: blocking-thunderbird3- → blocking-thunderbird3?
Whiteboard: [needs r/sr bienvenu] → [no l10n impact] [needs r/sr bienvenu]
Target Milestone: --- → Thunderbird 3.0rc1
so, in testing the new account wizard last weekend, I discovered that it can fail if a user tries to configure global inbox. This will happen if it's a new profile, or if for some other reason, local account has not been created.

STR
1. At end of wizard
2. click manual setup
3. click advanced in account server settings
4. set global inbox
5. click OK

fails
Severity: major → critical
Flags: blocking-thunderbird3?
Target Milestone: Thunderbird 3.0rc1 → ---
bleh, sorry. midair shit. bugzilla!
Severity: critical → major
Flags: blocking-thunderbird3?
Target Milestone: --- → Thunderbird 3.0rc1
Comment on attachment 402450 [details] [diff] [review]
Create local folders, don't set parent as URI when junk folder missing

thx for the patch - the original STR's work with this patch. 

I guess you're being overly defensive, but you don't need to initialize localMailServer to null here:

+  let localMailServer = null;

and in the catch - one or the other would be sufficient.

And I'm not sure what good nulling out localMailServer here does:

+        dump("error!  we should have found the local mail server after we created it.\n");
+        localMailServer = null;

since we're just going to return and it's a local variable.

Other than that, looks good.
Attachment #402450 - Flags: superreview?(bienvenu)
Attachment #402450 - Flags: superreview+
Attachment #402450 - Flags: review?(bienvenu)
Attachment #402450 - Flags: review+
(In reply to comment #22)
> (From update of attachment 402450 [details] [diff] [review])
> thx for the patch - the original STR's work with this patch. 
> 
> I guess you're being overly defensive

Actually I just copied this code, as noted in the comments, but I'll do the cleanups you suggest.
Whiteboard: [no l10n impact] [needs r/sr bienvenu] → [no l10n impact]
Carrying over reviews, asking for tb3 approval.
Attachment #402450 - Attachment is obsolete: true
Attachment #402650 - Flags: superreview+
Attachment #402650 - Flags: review+
Attachment #402650 - Flags: approval-thunderbird3?
Finally some action here. :)

Scenario:

User...
- installs fresh 2.0 and creates new profile and new POP3 account
- enables junk stuff, then receives new mails
- finds junk stuff not working as expected (not knowing he has to create the junk folder himself)
- marks some mails as junk
- happens to find them in trash
- clicks the junk label a few times trying to find out what the problem might be
- tada: DATA LOSS

This scenario does not look very unrealistic to me at all. In fact, anybody who will start from scratch with 2.0 using a complete new profile will run into this by a high chance.
Flags: blocking-thunderbird3? → blocking-thunderbird3+
Whiteboard: [no l10n impact] → [no l10n impact][needs a-tb3]
Never mind the needs a-tb3+, I did not notice the blocker-tb3+
Whiteboard: [no l10n impact][needs a-tb3] → [no l10n impact]
Attachment #402650 - Flags: approval-thunderbird3?
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: