Closed Bug 668952 Opened 13 years ago Closed 13 years ago

Inbox corruption/error message occurs with "move to folder" filters. "Error truncating the Inbox, you may need to delete INBOX.msf"

Categories

(MailNews Core :: Networking: POP, defect)

x86_64
Windows 7
defect
Not set
major

Tracking

(thunderbird7-, thunderbird8+ fixed)

RESOLVED FIXED
Thunderbird 9.0
Tracking Status
thunderbird7 - ---
thunderbird8 + fixed

People

(Reporter: rjhansen075, Assigned: rkent)

References

()

Details

(Keywords: regression, Whiteboard: [gs])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330

Steps to reproduce:

When migrating to Thunderbird 5.0 from Thunderbird 3.1.11, my filters to "move items to [folder]" stopped working properly. Now there is a new truncation error in the Inbox folder. These filters have been in use through Thunderbird 2 and 3, and have not failed in this way before.

Attempting to delete and recreate the filters, or attach them to local accounts rather than the Local Folders account yield the same result.

Windows 7 x64, Thunderbird 5 x86, always occurs, tested on an install without extensions


Actual results:

Error message "error truncating the Inbox, you may need to delete INBOX.msf" occurs with all "move to folder" filter rules. If Inbox folder is repaired, an additional message is reclaimed (a duplicate of the message sent to the folder appears in the Inbox folder). If compacted manually, the extra message disappears from the Inbox folder, until the "move to folder" filter is activated again. This only happens when the scope is "Checking mail and manual." If the scope is set to "Checking mail (after classification) and manual," the error no longer occurs, and the Inbox truncates properly.

Possibly harmless corruption, as the message has been moved and replicated in the target folder, but the constant error messages are annoying.

See Bug 321371, but I doubt this is the same issue, as the filters worked fine in my Thunderbird 2 and 3 installs, and this only started happening with a fresh upgrade to Thunderbird 5.


Expected results:

The Inbox folder should truncate properly, and remove the message that is moved. Filters set to "Checking mail" scope (without "after classification") should operate as they did in Thunderbird 3.1.11, without a truncation error. The problem with the scope change workaround is that a) the "after classification" option is unavailable on a per account basis, and so those per account filters always fail and b) When using the workaround, only the "Local Folders" item lights up blue and gets a star next to it indicating new mail, instead of the folder that actually received the item.

This functionality should be retained, not result in an error.
Severity: normal → major
OS: Other → Windows 7
Hardware: All → x86_64
I should add that this only occurs when receiving new mail. If I recover the lost message with a repair, and then manually activate the filter, the message is moved without incident.
Also: "Local Folders" account (global inbox) has been renamed to "The Hansens." Error _only_ occurs with the POP3 accounts that are set to store all new messages in the global folder.

I have a separate POP3 account that has its own local inbox in the same install, and "move to folder" filters work with this account without any issue.
> See Bug 321371, but I doubt this is the same issue, as the filters worked fine in my Thunderbird 2 and 3 installs, and this only started happening with a fresh upgrade to Thunderbird 5.
I have now also tried reverting to Thunderbird 3.1.11 again. The problem disappears. Looks like a regression.
More data. Bug only occurs when "Check for new messages at startup" is set for filtered accounts. Manually clicking "get mail" produces the expected result (no truncation error). So workaround #2: Do not automatically check mail at startup, check manually instead.
One final detail: Thunderbird 5 is being run from a Limited User context (standard account), not the usual (partial) administrative account that is the Windows 7 default. All of my mail folders are within my "home" folder, with "full control" ACL permissions granted for access from that context. All mail folders are also "owned" by the limited user. It shouldn't be a factor, but if it is, that may help in reproducing the issue.

This should be my last message on this, until it is reproduced or there is a solution logged. Good luck.
(In reply to comment #6)
> One final detail: Thunderbird 5 is being run from a Limited User context
> (standard account), not the usual (partial) administrative account that is
> the Windows 7 default.
I have the same issue with an administrative account.
I can confirm this bug. Also having Local Folders and three POP3 accounts that are downloading mails into one Inbox. Turning off checking mail on startup seems to help.
I've created filters in v3.something, and they worked happily with every upgrade of version 3. Since upgrade to v5, they don't work.
Just to add - Windows 7 32 bit, standard limited user account, not administrator.
I am experiencing the same problem with Thunderbird 5; windows 7 32 bit.
Changing to confirmed based on multiple reports.

For those of you seeing it, can you please report whether you have Tools/Security/Anti-virus/ "Allow antivirus clients to quarantine individual incoming messages" enabled, and also are you using an antivirus program that scans files, and if so which one.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Yes I have TB 5 quarantine messages enabled. I am using Avast! v6.0.1125. I took the step of disabling Avast!'s e-mail shield, and the same problem occurred. I did not try an uninstall of Avast.
If possible, please try with quarantine messages disabled, and see if the problem persists.
Behavior is resolved by unchecking "Allow AV clients to quarantine..." The issue appears to be with this feature and Avast! AV (I can't test other AV). I just upgraded Avast AV to version 6.0.1203, but it does not resolve the issue.

So the bug is either Avast's problem, or the Thunderbird quarantine feature. Please let me know if I should send a bug report off to the people at Avast.
I can confirm, that the behaviour is resolved by unchecking "Allow AV clients to quarantine..." but I use the Microsoft Security Suite (with Win7 64) and the behaviour is not affected by switching the virus scanner on or off. 
So it clearly seems to be a Thunderbird Bug. 
Also I only get the message, but the email is moved correctly and also deleted in the Inbox Folder. 
Thanks and best regards, 
Michael
I have the same problem, also since migrating to 5. Happens mostly on starting TB.  I only get the message, but the email is moved correctly and also deleted in the Inbox Folder. AV is checked, I will uncheck and monitor. (I use Norton Internet Security)
I am unable to duplicate this unfortunately, so any additional pointers of what it takes to make this happen would be appreciated.

This is likely a regression from Bug 582918.
Here's a specific filter that failed in this way from msgFilterRules.dat (personal stuff edited out with "_Personal_"):

name="Move _Personal_'s mail"
enabled="yes"
type="17"
action="Move to folder"
actionValue="mailbox://nobody@Local%20Folders/Inbox/_Personal_"
condition="OR (to or cc,contains,_personal_@isp.net)"

This would move any messages received from the _Personal_ POP3 account from the global inbox to the specific folder in the global inbox on Check Mail. This was how I handled multiple user accounts with Thunderbird 1, and has remained that way through every upgrade. 

Again, even though the destination folder for the filter is listed as "mailbox://nobody@Local%20Folders/Inbox/_Personal_," I have actually renamed "Local Folders" to "The Hansens," and that is the name that displays in the Folder pane. Renaming the global mailbox in this way may be part of the equation.

Also: My mail folders are not in the default location (i.e.: %appdata%\Thunderbird\Profiles\[profilename]\Mail). They are separate from the Profile folder. This made for easier backup access and network sharing (the path was quite cumbersome otherwise).

So I have a custom folder named "MozillaMail" in my home directory (C:\Users\[account]\MozillaMail) that contains all the mail inboxes. It is named "MozillaMail" because "mail" is a default share in *nix, and couldn't be shared over SAMBA.

Don't know if any of that detail will help reproduce the problem. That's all I can think of.
Note that my tree has expanded .mozmsgs folders populated for Windows Search.
from the description i.e. comment 0:
> If the scope is set to "Checking mail (after classification) and
> manual," the error no longer occurs, and the Inbox truncates properly.

"Checking mail (after classification) and manual," is wrong, right? 
You really meant the following:
"Checking mail (after classification) or Manually run" 
right?
I spent a little more time today trying to duplicate this, still without success. I'm also a little unclear about how repeatable this is. Comment 0 "Windows 7 x64, Thunderbird 5 x86, always occurs" implies it is completely reliable, but Comment 16 "Happens mostly on starting TB" implies it is intermittent. It would be good to clarify that, as I have been looking for a reliable failure.

I also looked over the code a little, and nothing stands out. So at this point what this bug really needs is for those who are seeing it to try to demonstrate the bug in a simpler environment, say with a new profile and a single new account which is what I have been trying without success.
(In reply to comment #22)
> I spent a little more time today trying to duplicate this, still without
> success. I'm also a little unclear about how repeatable this is. Comment 0
> "Windows 7 x64, Thunderbird 5 x86, always occurs" implies it is completely
> reliable, but Comment 16 "Happens mostly on starting TB" implies it is
> intermittent. It would be good to clarify that, as I have been looking for a
> reliable failure.
> 
> I also looked over the code a little, and nothing stands out. So at this
> point what this bug really needs is for those who are seeing it to try to
> demonstrate the bug in a simpler environment, say with a new profile and a
> single new account which is what I have been trying without success.

I also can't reproduce this on Windows 7 64 bit, Thunderbird 5,here's what I tried:
1. On my gmail account with IMAP, create a "Checking Mail or Manually Run" filter to move all messages with subject == "MOVETO" to a Local Folder
2. quit Thunderbird
3. send an email to my gmail account with "MOVETO" in the subject line
4. filter works i.e. email is moved to my local folder and my inbox isn't truncated, nor do I get an error message

*Speculation* Perhaps this error is due to R.Hansen's special setup as per comment 18? i.e.:
a) renaming "Local Folders" to "The Hansens" 
b) sharing his Local Folders via SAMBA so folders are not in the normal location, perhaps Thunderbird code can't handle this for filters?
(In reply to comment #23)

> 1. On my gmail account with IMAP, create a "Checking Mail or Manually Run"
> filter to move all messages with subject == "MOVETO" to a Local Folder
> 2. quit Thunderbird
> 3. send an email to my gmail account with "MOVETO" in the subject line
> 4. filter works i.e. email is moved to my local folder and my inbox isn't
> truncated, nor do I get an error message
> 
> *Speculation* Perhaps this error is due to R.Hansen's special setup as per
> comment 18? i.e.:
> a) renaming "Local Folders" to "The Hansens" 
> b) sharing his Local Folders via SAMBA so folders are not in the normal
> location, perhaps Thunderbird code can't handle this for filters?

I don't have any peculiarity in configuration, nothing renamed or something like that. Just 3 POP3 accounts into one global inbox. Try it like that, POP3 instead IMAP.
(In reply to comment #24)
> 
> I don't have any peculiarity in configuration, nothing renamed or something
> like that. Just 3 POP3 accounts into one global inbox. Try it like that,
> POP3 instead IMAP.

What I did was setup 2 POP3 accounts, each going to the global inbox ("Local FOlders"). Enabled message quarantine. Setup a couple of filters that moved incoming messages to a subfolder of Local Folders. Could not get the failure.
(In reply to comment #25)
> (In reply to comment #24)
> > 
> > I don't have any peculiarity in configuration, nothing renamed or something
> > like that. Just 3 POP3 accounts into one global inbox. Try it like that,
> > POP3 instead IMAP.
> 
> What I did was setup 2 POP3 accounts, each going to the global inbox ("Local
> FOlders"). Enabled message quarantine. Setup a couple of filters that moved
> incoming messages to a subfolder of Local Folders. Could not get the failure.

Repeated with POP instead of IMAP i.e. I did the same thing as :rkent
1. Created two test POP accounts
2. Set those POP accounts to use the Global Inbox in Local Folders
3. Created a filter to move from the test POP inbox to Local Folders & quit Thunderbird 5 on Windows 7 64 bit
4. Sent some email that triggered the filters
5.Restarted Thunderbird 5

Results: email was successfully filtered and there was no inbox corruption

Perhaps this only occurs when upgrading a profile with these kinds of POP accounts and filters from Thunderbird 3.1.11 to TB 5?
(In reply to comment #20)
> from the description i.e. comment 0:
> > If the scope is set to "Checking mail (after classification) and
> > manual," the error no longer occurs, and the Inbox truncates properly.
> 
> "Checking mail (after classification) and manual," is wrong, right? 
> You really meant the following:
> "Checking mail (after classification) or Manually run" 
> right?

Yes. "or" Manually run is the correct text. Sorry.
(In reply to comment #22)
> I spent a little more time today trying to duplicate this, still without
> success. I'm also a little unclear about how repeatable this is. Comment 0
> "Windows 7 x64, Thunderbird 5 x86, always occurs" implies it is completely
> reliable, but Comment 16 "Happens mostly on starting TB" implies it is
> intermittent. It would be good to clarify that, as I have been looking for a
> reliable failure.
> 
> I also looked over the code a little, and nothing stands out. So at this
> point what this bug really needs is for those who are seeing it to try to
> demonstrate the bug in a simpler environment, say with a new profile and a
> single new account which is what I have been trying without success.

For my setup, it is 100% reliable, on startup, whenever one of the "move to folder" filters is activated by new messages on a POP3 account. Always happens.

Going to try some more tests tonight to see if I can figure out exactly what is causing this problem, as it seems to be peculiar certain configurations. I don't have the ability to do a clean setup/profile test without disrupting my work environment, unfortunately.
(In reply to comment #23)
> (In reply to comment #22)
> > I spent a little more time today trying to duplicate this, still without
> > success. I'm also a little unclear about how repeatable this is. Comment 0
> > "Windows 7 x64, Thunderbird 5 x86, always occurs" implies it is completely
> > reliable, but Comment 16 "Happens mostly on starting TB" implies it is
> > intermittent. It would be good to clarify that, as I have been looking for a
> > reliable failure.
> > 
> > I also looked over the code a little, and nothing stands out. So at this
> > point what this bug really needs is for those who are seeing it to try to
> > demonstrate the bug in a simpler environment, say with a new profile and a
> > single new account which is what I have been trying without success.
> 
> I also can't reproduce this on Windows 7 64 bit, Thunderbird 5,here's what I
> tried:
> 1. On my gmail account with IMAP, create a "Checking Mail or Manually Run"
> filter to move all messages with subject == "MOVETO" to a Local Folder
> 2. quit Thunderbird
> 3. send an email to my gmail account with "MOVETO" in the subject line
> 4. filter works i.e. email is moved to my local folder and my inbox isn't
> truncated, nor do I get an error message
> 
> *Speculation* Perhaps this error is due to R.Hansen's special setup as per
> comment 18? i.e.:
> a) renaming "Local Folders" to "The Hansens" 
> b) sharing his Local Folders via SAMBA so folders are not in the normal
> location, perhaps Thunderbird code can't handle this for filters?

a) Only the local folders account name is renamed. The folder in the mail tree is still named "Local Folders." The Mail tree folder is C:\Users\Home\MozillaMail.
b) I am not currently using Samba shares, though the folder is SMB shared over Windows 7 (an NT4-style workgroup share, not homegroups). I had moved the folder (and renamed it to MozillaMail) to make it easier for Samba, however. It was just never changed back. I don't do a lot of "fresh" installations. ;)
Okay, I spent a couple of hours with "Thunderbird.exe -P" rebuilding my profile from the ground up, in various ways. Here are my results.

It appears to be an intermittent problem, caused by having numerous accounts feed into the Local Folders, through a stack of filters. In my setup, I have four ISP POP3 accounts, and three webmail accounts over POP3, all feeding into the "Local Folders." Excepting the default family account, all of them are immediately moved to user specific folders in a grand total of 6 move to folder filters, and 1 tagging filter.

I took this setup, and rebuilt it step-by-step in a new profile. With one account, and one move filter to the local folders, it works fine. I even linked in the local folders from the old profile (by changing the folder in account settings, restarting). It continues to work.

As I continue to build, however, somewhere along the line, after adding four or five accounts, and requiring all the move filters to work, some of the move filters invariably start to fail. Which ones seem to be based on the order in which I added the accounts. So in the new setup, the account I was having the most trouble with was the one I added first, and it has no problems with its move filter in the new account, because it is pulled first. Other accounts, later on down the line, started to fail.

So it seems that the problem is caused by having lots of accounts feed into the same inbox, and match move filters, at startup. It seems Thunderbird 5 is somewhat less robust in handling this sort of scenario than previous versions.

Unchecking "allow AV to quarantine" fixes it entirely, probably by reducing the load somewhere. This seems to me to be an adequate workaround.

To reproduce the error in a fresh profile required me to setup _several_ accounts, each matching filter criteria.
I confirm that I have the same issue on a win7 x64.
Multiple pop accounts to the local folder inbox, multiple filters to move to other subfolders.
I haven't renamed the local folder, none of them are networked shared.

after the error message, if I do a compact to the inbox, the faulty email reappears in the inbox, despite having been already copied to the correct subfolder.

I do have the "allow AV to quarantine" and Avast. The issues appeared since I've upgraded to TB5 and persisted even after the latest Avast upgrade.
(In reply to comment #31)
... stuff deleted
> I do have the "allow AV to quarantine" and Avast. The issues appeared since
> I've upgraded to TB5 and persisted even after the latest Avast upgrade.
Hi Patrick:
So does the  "unchecking workaround" aka unchecking "allow AV to quarantine" workaround fix the problem for you or not? Glad that the "unchecking workaround" works for R.Hansen
I've tagged a couple more with http://getsatisfaction.com/mozilla_messaging/tags/bug_668952 (but unsure if they all are this bug)
Whiteboard: [gs]
Summary: Inbox corruption/error message occurs with "move to folder" filters → Inbox corruption/error message occurs with "move to folder" filters. "Error truncating the Inbox, you may need to delete INBOX.msf"
(In reply to comment #32)
> Glad that the "unchecking workaround" works for R.Hansen

Yes. This seems to be the best workaround for my problem. I've found it gives the desired behavior of having new mail indicators occur at the target folders, rather than only on the "Local Inbox" heading.

Am I losing anything by unchecking "allow AV quarantine?" My mail AV works as a proxy mail server, and would quarantine an infected message before it ever reached Thunderbird in the first place. As it is, I have it set to inject a notification in the subject header. In fact, most mail AV's I have seen work like that. Is it ever necessary to have that particular option checked? (i.e.: Which AV programs require that option?)

I ask this because it may be possible to consider a discussion of dropping that feature entirely, especially if it fixes a problem for a large portion of the user base.
some virus checkers look at file writes, and delete any file that has what looks like a virus written to them. If that file happens to be your Inbox, you lose all your mail. Quarantining tests that the file write succeeded without interference from the virus checker before writing to the actual inbox.
(In reply to comment #32)
> (In reply to comment #31)
> ... stuff deleted
> > I do have the "allow AV to quarantine" and Avast. The issues appeared since
> > I've upgraded to TB5 and persisted even after the latest Avast upgrade.
> Hi Patrick:
> So does the  "unchecking workaround" aka unchecking "allow AV to quarantine"
> workaround fix the problem for you or not? Glad that the "unchecking
> workaround" works for R.Hansen

Yes it does
I can confirm this bug. I have 3 subfolders in my Inbox, 3 pop-accounts, and about 6 filters which move the incoming mails to one of the subfolders. Most of those filters only check the sender or the subject, but some of those filters check the contents of the message for some text.
A daily newsletter with a large pdf-file seems to trigger this bug more often than other mails.
I can confirm this bug as well. My situation is similar as Patr's (above). I also have 3 subfolders in my Inbox with 3 pop-accounts and each account a filter to direct the incoming mail to the folders.
My other filter is to mark mails (star and red color) with a high priority.
I also confirm this bug; I have this truncation error message, and I think I seem to be able to recreate the error.
  
I'm new to Thunderbird 5.0 on Windows7.  After installation; I used mozbackup to migrate my extensive e-mail folders & subfolders from Outlook Express on Windows XP. I followed the advice to install Thunderbird on my old machine, move the files into TB then migrate to the new machine.  The move had a few minor problems that I was able to fix.  At one point, I could not download any mail.  The problem turned out to be that something in the migration process reset my firewall program (McAfee Suite) to allow only outbound access.  That is no longer a problem.  I'm just providing background info.

My e-mail has 6 accounts funneling through my one inbox.  All are from the same ISP (COX).  I do not have any newsgroups; but when I migrated, I did have one obsolete news group.  I deleted it from the accounts list.  I was not able to restore my migrated message filters, so have created them all manually.  I have at least 50 filters, probably more.  All look only at header info.  Some look at from: and some combine from: with a subject.  The problem seems to appear mostly with the messages filtered by two fields, and where I have another filter scanning the same fields.

I think I am able to recreate the problem.  [Note: I just now saw the advise about switching off virus quarantine - that does seem to work for me with McAfee; but I'd like to post my analysis of the problem in case it provides a clue] 

To recreate the problem:
Use two incoming mail accounts.
Have a folder and a subfolder of the folder.
Have a message rule(1): if message is from sender A move message to folder.
Have another rule(2): if message is both from sender A and subject contains "phrase", move message to subfolder.  Neither rule has the box checked to stop filtering.

The problem recreates for me when I have rule(2) executing before rule(1), and I have 2 messages coming into two mail addresses on the same download [and yes, it seems to be only on start up], and the first incoming message contains the filter phrase,   It's not as predictable when only one message comes in, I think it might sometimes happen with one message, but nearly always for me with two messages in.

[so to test - receive 4 mails in this order]
1) from mail account1; subject = filter phrase  (filter moves to subfolder)
2) from mail-account1; any other subject        (filter moves to folder)
3) from mail account2; subject = filter phrase  (filter moves to subfolder)
4) from mail-account2; any other subject        (filter moves to folder)

I think it is #4 invoking the trunc message (but I'm not sure)
addition to post #39.
I forgot to say:

1) I now have a 64 bit AMD chip; old machine was not (I think 32bit intel).

2) In case it matters:  On start-up, I hand enter a password for one of my mail accounts, while the others are saved (auto entered).  I'm mentioning because during migration I had problems with the password box not appearing (and mail not downloading).  It was related to my firewall settings (McAfee).
I've tried setting this up with 10 accounts, each downloading 2 big messages and 2 small messages, which are copied, tagged, marked read, and moved. Still cannot reproduce. From my experience with similar bugs, the underlying issue is frequently obscure, and not what you would guess. So I don't know how I can make any progress on this.

The relevant code in nsParseMailbox.cpp is:

2568   m_inboxFileStream->Close();
2569 
2570   nsresult truncRet = m_inboxFile->SetFileSize(m_curHdrOffset);
2571   NS_ASSERTION(NS_SUCCEEDED(truncRet), "unable to truncate file");
2572   if (NS_FAILED(truncRet))
2573    destIFolder->ThrowAlertMsg("filterFolderTruncateFailed", msgWindow);
2574   else
2575     // tell parser that we've truncated the Inbox
2576     nsParseMailMessageState::Init(m_curHdrOffset);
2577 
2578   MsgReopenFileStream(m_inboxFile, m_inboxFileStream);

If I had to guess, I would say that something in the affected user's file systems is causing either the close or truncate to fail.
(In reply to comment #8)
> I can confirm this bug. Also having Local Folders and three POP3 accounts
> that are downloading mails into one Inbox. Turning off checking mail on
> startup seems to help.
> I've created filters in v3.something, and they worked happily with every
> upgrade of version 3. Since upgrade to v5, they don't work.

I also have this bug. Hits when starting TBird. Does not hit if allow AV quarantine is not checked (McAfee). 

Win7-64 AMD quad, 8G. I run my quad at 100% CPU with background tasks (Boinc grid).

I also have a number of POP accounts that are received into one inbox then filtered and moved to folders and subfolders by many filters. All the same and working before the upgrade to 5.

The inbox after the error is empty, as it should be if the filters worked correctly. If I repair the inbox after the error some messages will appear but these seem to be copies of messages that now also exist in other folders. It is as if the messages were copied to the other folders but not completely deleted from the inbox. I have not checked 100% to see if they are all copies but it seems that way.

Jerry
I checked the Inbox.msf file and I have a number of them in subdirectories of Mail. All of them are 0 bytes. Only the one in Local Folders has today's date.
I have Win7 64-bit na Win7 32-bit with running AV ESET NOD32.
I have 3 POP3 accounts all goes to one global local folders. From local folder goes by filters to separate folders. When I open TB ( Does not hit if allow AV quarantine is not checked) error always occurs. I tried with active AV program and uninstalled AV program. Error always occurs. BUT WHAT IS MORE IMPORTANT problem only occours with account nr 2 & 3. When email arrives to account nr 1 there is no problem at all....
Configuration of all 3 accounts is identical (except login and password).
Am running 10 POP3 accounts and have this error fairly frequently, but it strikes on certain subfolders of inbox and not others. I.E. my Facebook directory will have it whereas directories that only receive an occasional e-mail will not have any problems.

Also, while I have not been looking, I have not explicitly noticed it having trouble with new folders and filters created in Thunderbird 5. Replicating this bug might require creating folders and filters in Thunderbird 3 and importing them into 5.
Attached patch Close the inboxSplinter Review
Sort of accidentally my test account started showing this error when I loaded it for another purpose, so I was able to track down the issues and prepare the proposed fix.

AFAICT what is going on is that an open stream to the actual mailbox file is passed to nsParseNewMailState, but that stream only gets closed in destructors. For some reason the various objects do not get destroyed when multiple accounts are being read until after several accounts are read. The patch adds a specific close command for that stream in nsPop3Sink. I put it there because that is the object that originally opened the stream.

I have not tried this, but I based on my code analysis and experience here is what would be needed for a reliable STR:

1) create two POP3 accounts, downloading to the global mailbox, and enabled to read messages on startup.

2) create a single filter on one of the accounts (NOT on local folders), moving a message to another local folder if, for example, the subject contains test. The account with the active filter must be the SECOND account that is actually downloaded at startup, that is no filters should fire on the first account. No idea what determines that, but I always get the same order of accounts.

Send a message matching the filter from another TB instance. Startup the test instance, and the error should occur.

I might try to add a unit test for this if it possible to start two different POP3 fake servers. I'll ask for review after I decide whether to do that or not.
Assignee: nobody → kent
Status: NEW → ASSIGNED
rkent to the rescue!

any speculation as to what has caused/induced the regressive behavior?
I assume this is a regression from Bug 582918, which is why I was motivated to try to find a fix.
Assignee: kent → nobody
Blocks: 582918
Component: General → Networking: POP
Product: Thunderbird → MailNews Core
QA Contact: general → networking.pop
Comment on attachment 551941 [details] [diff] [review]
Close the inbox

Unfortunately I was unable to develop either a unit test, or a reliable way to get this bug to appear from a fresh profile. In fact, even on my trunk build I can now no longer get the bug to appear without this patch - though I am still able to see it on Tb 6.0 (That's why I dropped everything yesterday to track down the bug when it started to appear).

So I am putting bienvenu in the unfortunate position of having to review a patch for an elusive issue without a clear test. Sorry about that. But the file closing seems both needed and low risk.
Attachment #551941 - Flags: review?(dbienvenu)
Comment on attachment 551941 [details] [diff] [review]
Close the inbox

OK, let's give this a try. If you land it tomorrow, we'll have maximum baking time before TB 9.
Attachment #551941 - Flags: review?(dbienvenu) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 9.0
Assignee: nobody → kent
I successfully tested the profile that was causing trouble in Thunderbird 6 on the nightly Shredder. The issue is resolved on my setup.
Attachment #551941 - Flags: approval-comm-aurora+
For me, the issue is NOT RESOLVED NOT FIXED.
The exact same issue as described above started on my machines with migration to Thunderbird 5.
I use Thunderbird 7.0.1 (NL = Dutch version) on two machines,
- one Vista Ultimate
- one Windows 2000 SP5.
On both machines I use Norman Security Suite.

Thunderbird is configured similar on both machines.
- "allow AV quarantine?" is checked.
- The profile folder resides on a separate partition with my data (moved there using profilemanager)
- I use Thunderbird to retrieve mail from 11 (eleven) POP3 accounts from three different providers
- I have two news accounts
- I use 68 folders inside Local folders, outside my INBOX. These folders contain a lot of sub-folders and sub-sub-folders.
- I store a lot of messages
- I use compress folders very often
- I have 45 filters on Local Folders.
- I have the usual filter 'act on SpamAssassinYes" on every pop-account
- some pop-accounts have separate additional filters
- deleting .msf files does not prevent the problem next time I start Thunderbird.

Please reopen the issue until it is really fixed?

Eveline
(In reply to ebernard@denkster.nl from comment #54)
> For me, the issue is NOT RESOLVED NOT FIXED.
...
> I use Thunderbird 7.0.1 (NL = Dutch version) on two machines,

This particular bug is only fixed in Thunderbird 8 and later. Thunderbird 8 is due to be released on the 8th November. If you want to try out the fix before then you can try our beta of Thunderbird 8 available from here:

http://www.mozilla.org/en-US/thunderbird/channel/

> Please reopen the issue until it is really fixed?

If you still have a problem after switching to Thunderbird 8, please file a new bug - it is entirely possible that your issue is slightly different from the one fixed here, even with similar symptoms.
WOW!
That answer came fast!
Thanks a lot.
And please excuse me for my mistake.
I will check Thunderbird 8 !

Thanks again
EVeline
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: