Last Comment Bug 746371 - keywords set by pop3 incoming filters aren't written into the berkeley mailbox
: keywords set by pop3 incoming filters aren't written into the berkeley mailbox
Status: VERIFIED FIXED
:
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: P1 major (vote)
: Thunderbird 14.0
Assigned To: David :Bienvenu
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-17 15:38 PDT by David :Bienvenu
Modified: 2012-04-20 02:04 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
+
fixed
+
fixed


Attachments
this uses an output stream for new messages that is also an input stream. (1.06 KB, patch)
2012-04-17 15:38 PDT, David :Bienvenu
no flags Details | Diff | Splinter Review
adds unit test, fixes mark read and flagged actions (10.83 KB, patch)
2012-04-17 16:35 PDT, David :Bienvenu
no flags Details | Diff | Splinter Review
remove commented out code (10.69 KB, patch)
2012-04-17 16:43 PDT, David :Bienvenu
standard8: review+
standard8: approval‑comm‑aurora+
standard8: approval‑comm‑beta+
Details | Diff | Splinter Review

Description David :Bienvenu 2012-04-17 15:38:53 PDT
Created attachment 615911 [details] [diff] [review]
this uses an output stream for new messages that is also an input stream.

pop3 filters on new incoming messages don't write the keywords into the mailbox, which means if the folder is reparsed, we'll lose the keywords. The issue is that the output stream that berkeley mailboxes use for new messages isn't also an input stream, which means that the change keywords code can't get an input stream to figure out where to write the keyword change.

I believe flag changes would also have this issue.

I have a relatively simple fix for this. I'll try to write a test for it as well. The fix will mean that you can change flags while download is going on, which didn't used to be the case. The pop3 download code always seeks to the end of the stream before writing data, so we shouldn't get issues of messages getting written into the middle of the folder, but I'd want to bang on it for a bit to make sure.
Comment 1 David :Bienvenu 2012-04-17 16:35:57 PDT
Created attachment 615944 [details] [diff] [review]
adds unit test, fixes mark read and flagged actions

I discovered mark read/unread and mark flagged pop3 filter actions weren't going through the folder.
Comment 2 David :Bienvenu 2012-04-17 16:43:52 PDT
Created attachment 615948 [details] [diff] [review]
remove commented out code
Comment 3 David :Bienvenu 2012-04-17 17:25:44 PDT
I've requested a try server build w/ this patch - http://ftp.mozilla.org/pub/mozilla.org/thunderbird/try-builds/bienvenu@nventure.com-82cc58b3f954
Comment 4 Mark Banner (:standard8) 2012-04-18 06:40:12 PDT
Comment on attachment 615948 [details] [diff] [review]
remove commented out code

Review of attachment 615948 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good. r+a=me.
Comment 6 WADA 2012-04-20 02:04:36 PDT
Checked Tb truk 4/19 build on Win-XP.
> Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120419 Thunderbird/14.0a1

Filter rule actions.
> type="1"
> action="AddTag"
> actionValue="zz"
> action="Mark read"
> action="Mark flagged"
> action="Move to folder"
> actionValue="mailbox:// ... "

After filter application upon download, following header was written in move target folder.
> X-Mozilla-Status: 0005
> X-Mozilla-Status2: 00000000
> X-Mozilla-Keys: xx

VERIFIED.

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