Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Folder truncation fails when filtering on POP3 account



MailNews Core
11 years ago
9 years ago


(Reporter: Peter Weilbacher, Assigned: Peter Weilbacher)



1.8 Branch

Firefox Tracking Flags

(Not tracked)



(1 attachment)



11 years ago
As three people reported on the newsgroup, both SeaMonkey and Thunderbird from the 1.8 branch show the same problem with filtering. When a filter (especially the junk filter?) runs and moves a message away from the INBOX, the error message

   "There was an error truncating the Inbox after
    filtering a message to folder '<target folder>'.
    You may need to shutdown SeaMonkey and delete INBOX.msf."

is displayed.

I debugged this and the problem seems to be in nsFileSpec::Truncate() in xpcom\obsolete\nsFileSpecOS2.cpp. The DosOpen() there fails with an ERROR_SHARING_VIOLATION.

The problem seems to be that the Inbox file (this is the one involved, and not the INBOX.msf file as the error message suggests) is already opened (for reading) when SeaMonkey is started (checked using the psfiles OS/2 tool). When filtering, the file is truncated and so the code opened it using OPEN_SHARE_DENYREADWRITE. This always fails as it already is open (for reading). When changed to opening using OPEN_SHARE_DENYWRITE the problem is gone.

The questions are:
1. Why is the Inbox file already opened on startup and stays
   open afterwards?
2. What happens to the opened file when truncated and how with
   the open instance react to that?
3. How are other platforms handling this? From the non-response
   in the .seamonkey newsgroups, no problems exist there.

In my limited testing it didn't show a problem, but then I only made a POP3 account for testing and the problem doesn't show on my normal IMAP accounts.

Comment 1

11 years ago
Created attachment 247299 [details] [diff] [review]
suggested fix

Comment 2

11 years ago
Comment on attachment 247299 [details] [diff] [review]
suggested fix

OK, I got positive feedback on the test DLLs, requesting review.
Attachment #247299 - Flags: review?(mozilla)

Comment 3

11 years ago
Is one of you using SeaMonkey mail (or Thunderbird) from trunk and sees the same error there? If so, we probably have to make a similar change to xpcom/io/nsFileSpecOS2.cpp in addition to xpcom/obsolete/nsFileSpecOS2.cpp.

Comment 4

11 years ago
Using a couple of old Seamonkey trunk build and creating a test filter it seems to run with no problems, both on my inbox and for incoming mail.
All messages are moved and no errors of any kind
I have been using filters on Trunk Seamonkey builds without any problems, junk and regular filters.  My current build is 11/28/06 and I haven't seen any failures with it or previously.

Comment 6

11 years ago
Comment on attachment 247299 [details] [diff] [review]
suggested fix


We've had problems with file sharing in the past. Windows seems a lot moer lenient about opening files twice and things like that.
Attachment #247299 - Flags: review?(mozilla) → review+

Comment 7

11 years ago
OK, thanks for the review. Checked into branch. (Fix is fully contained in OS/2-only file, so NPOTB policy applies and I don't wait for extra approval.)
Last Resolved: 11 years ago
Keywords: fixed1.8.1.1
Resolution: --- → FIXED

Comment 8

11 years ago
Verifying some older bugs.

(The complaints about this problem have definitely stopped, although this is just a workaround. See bug 321371 for further cross-platform work on this.)
Keywords: fixed1.8.1.1 → verified1.8.1.1
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.