Last Comment Bug 736539 - move/copying multiple local messages moved by incoming filters leads to corruption
: move/copying multiple local messages moved by incoming filters leads to corru...
Status: RESOLVED FIXED
: dataloss
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
: -- critical with 1 vote (vote)
: Thunderbird 14.0
Assigned To: David :Bienvenu
:
Mentors:
Depends on:
Blocks: 402392
  Show dependency treegraph
 
Reported: 2012-03-16 11:10 PDT by David :Bienvenu
Modified: 2012-05-24 09:09 PDT (History)
6 users (show)
mozilla: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
+
fixed
+
fixed


Attachments
proposed fix (13.76 KB, patch)
2012-03-16 11:10 PDT, David :Bienvenu
standard8: review+
standard8: approval‑comm‑aurora+
standard8: approval‑comm‑beta+
Details | Diff | Review

Description David :Bienvenu 2012-03-16 11:10:13 PDT
Created attachment 606642 [details] [diff] [review]
proposed fix

if a pop3 incoming mail filters moves messages to a folder, and then those same messages are move/copied to an other folder, the resulting messages will be corrupted. This is because the pop3 incoming msg filter move action auto-assigns the message key instead of using the offset into the folder. Then, the multiple message move copy code still thinks messages keys are the offset into the message folder.

The fix is to make the multiple message move/copy code use the message offset, the way the single message move code does. And I've extended a unit test to include a test for this bug.

We will want this fix for aurora and beta channels as soon as possible because it does cause data corruption.
Comment 1 Mark Banner (:standard8) 2012-03-19 06:36:39 PDT
Comment on attachment 606642 [details] [diff] [review]
proposed fix

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

::: mailnews/local/src/nsMailboxProtocol.cpp
@@ +185,1 @@
>          NS_ASSERTION(NS_SUCCEEDED(rv), "oops....i messed something up");

You can drop this line as well.
Comment 2 Mark Banner (:standard8) 2012-03-19 06:38:20 PDT
Comment on attachment 606642 [details] [diff] [review]
proposed fix

[Triage Comment]
I assume this is fallout from the pluggable stores change, if so a=me for both channels.
Comment 3 David :Bienvenu 2012-03-19 07:28:07 PDT
fixed on trunk - http://hg.mozilla.org/comm-central/rev/82ca6e424d5c

yes, this is fallout from pluggable stores. The other fix would be to make the berkeley mailbox store implement MoveNewlyDownloadedMessage and set the message key to the dest file size, which would maintain compatibility with prev versions of Thunderbird, but this still fix would still be required for folders > 4GB and for correctnesss in general. I'll transplant the patch to the other two branches this morning.
Comment 5 Tyler Schoenke 2012-05-24 09:00:01 PDT
I know this bug is listed as fixed in the release notes for Thunderbird12, but I am running 12.0 and still seeing emails get corrupted.  When messages are filtered into folders, occasionally two emails will get combined into one.  Do I need to upgrade to a later version of 12, or is this not really fixed in 12?
Comment 6 David :Bienvenu 2012-05-24 09:09:13 PDT
(In reply to Tyler Schoenke from comment #5)
> I know this bug is listed as fixed in the release notes for Thunderbird12,
> but I am running 12.0 and still seeing emails get corrupted.  When messages
> are filtered into folders, occasionally two emails will get combined into
> one.  Do I need to upgrade to a later version of 12, or is this not really
> fixed in 12?

We can't reproduce any remaining issues, so we would need your help to try to figure out what's happening. Are these pop3 mail filters? Have you turned on filter logging and seen what's in the log when this happens? You're strictly talking about messages that have been filtered to a folder, and appear corrupted in that folder, right? That's not this bug, which is about what happens when you move messages that have already been moved by incoming filters.

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