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 on attachment 247299 [details] [diff] [review] suggested fix OK, I got positive feedback on the test DLLs, requesting review.
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.
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 on attachment 247299 [details] [diff] [review] suggested fix r=mkaply We've had problems with file sharing in the past. Windows seems a lot moer lenient about opening files twice and things like that.
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.)
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.)