Last Comment Bug 315069 - mail imported from outlook return to unread status after rebuilding folder msf file
: mail imported from outlook return to unread status after rebuilding folder ms...
[fixed by 207156]
: dataloss
Product: Thunderbird
Classification: Client Software
Component: Migration (show other bugs)
: unspecified
: x86 Windows XP
: -- critical with 2 votes (vote)
: ---
Assigned To: David :Bienvenu
: 388776 (view as bug list)
Depends on:
Blocks: 219269 475607
  Show dependency treegraph
Reported: 2005-11-04 03:28 PST by Giacomo Fonderico
Modified: 2012-09-10 01:08 PDT (History)
11 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

possible fix for problem at import time (4.41 KB, patch)
2005-11-04 16:02 PST, David :Bienvenu
no flags Details | Diff | Splinter Review
unbit-rotted patch (3.92 KB, patch)
2009-02-16 13:49 PST, David :Bienvenu
no flags Details | Diff | Splinter Review

Description Giacomo Fonderico 2005-11-04 03:28:16 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.12) Gecko/20050919 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.12) Gecko/20050919 Firefox/1.0.7

Mail imported from outlook don't have thunderbird headers (X-Mozilla-Status,...).
So if you mark these mails as read, they come back as unread after reconstruction of msf file.

Reproducible: Always

Steps to Reproduce:
1.import outlook pst profile
2.mark mail imported as read
3.delete msf file for its folder

Actual Results:  
Mail are in unread status

Expected Results:  
Mail are in read status

Have marked mail as new
Comment 1 Giacomo Fonderico 2005-11-04 03:32:49 PST
If possible, it would appreciate a rebuild functionality that can add thunderbird headers after importation.
In our case we have migrated about 40 Pc from Outlook to Thunderbird, and after 6 months we have imported mails in inconsistent status (X-... headers are not in the mails header).
Comment 2 Giacomo Fonderico 2005-11-04 03:36:42 PST
Sorry, I omitted version of Thunderbird.
The problem exist for version 1.0.3, the latest test was made with version 1.0.6 (20050716)
Comment 3 David :Bienvenu 2005-11-04 07:20:28 PST
if you delete a message, and do a context menu compact this folder, the x-mozilla-status headers will be added as part of the compact process.
Comment 4 David :Bienvenu 2005-11-04 07:21:23 PST
what version did you use to do the importing? I thought that bug was fixed a while ago, that import didn't added x-mozilla-status.
Comment 5 Giacomo Fonderico 2005-11-04 07:24:57 PST
The last import was made with thunderbird 1.0.6 (20050716)
Comment 6 David :Bienvenu 2005-11-04 07:29:10 PST
darn, it was fixed for Outlook Express but never Outlook. 

Compacting folders is the only way to get those x-mozilla-status lines into the messages. And compacting won't do anything unless at least one message is deleted.
Comment 7 Giacomo Fonderico 2005-11-04 08:55:20 PST
I've tried to delete a message from folder and compacting it after deletion, this add TB headers to mail imported and resolve the problem.
Do you think is a good idea to submit a bug for "compact folder" utility?
Comment 8 David :Bienvenu 2005-11-04 09:03:53 PST
We've already got a command File | compact folders that will compact all the folders in a given account. The auto-compact feature will compact folders in all accounts (tools | options | advanced | offline and disk space - automatically compact folders when it will save xx KB. So we're unlikely to add a separate utility. We'd rather spend resources making compaction more automatic, and/or support mail formats that don't require compaction.
Comment 9 David :Bienvenu 2005-11-04 16:02:01 PST
Created attachment 201889 [details] [diff] [review]
possible fix for problem at import time

I haven't tested this, since Outlook refuses to register itself as the mapi client on this machine, but I'll try it on a different machine.
Comment 10 Giacomo Fonderico 2005-11-05 00:51:46 PST
I,am sorry for my bad english, in comment nr 7 I don't ask you to develop a new utility for compacting folders correctly.
My question is: Is a bug of actual "compact folder" functionality adding missing headers only if I delete a message from the folder?
If the functionality exist, through context menu or option setting is the same, I think it must work correctly.
I hope to not abuse of your patience.
Comment 11 ovidiu 2008-06-05 04:32:54 PDT
similar?  Bug 160027 (less active, old?)

related? bug 219269
Comment 12 Przemyslaw Bialik 2009-02-14 14:24:50 PST
(In reply to comment #9)
> Created an attachment (id=201889) [details]
> possible fix for problem at import time
> I haven't tested this, since Outlook refuses to register itself as the mapi
> client on this machine, but I'll try it on a different machine.
@David: what were your results ? (if you remember ;)
Maybe we could try it out ?
Comment 13 David :Bienvenu 2009-02-14 15:39:03 PST
Wow, I really don't remember - if you have a setup where you can try it out, that would be great (I don't know if the patch even applies anymore)
Comment 14 Przemyslaw Bialik 2009-02-15 04:42:14 PST
I've applied the patch manually so hopefully the build would be a success and I will let you know about the results.
Comment 15 Przemyslaw Bialik 2009-02-16 05:28:58 PST
Unfortunately compilation fails:

../../../../mozilla/dist/include/xpcom\nsCRT.h(295) : warning C4005: 'FILE_ILLEG
AL_CHARACTERS' : macro redefinition
        ../../../../mozilla/dist/include/msgbase\msgCore.h(216) : see previous d

d:/mozilla/source/mailnews/import/outlook/src/nsOutlookMail.cpp(595) : error C20
65: 'MSG_FLAG_READ' : undeclared identifier
d:/mozilla/source/mailnews/import/outlook/src/nsOutlookMail.cpp(597) : error C20
65: 'MSG_FLAG_ATTACHMENT' : undeclared identifier
d:/mozilla/source/mailnews/import/outlook/src/nsOutlookMail.cpp(609) : error C38
61: 'EscapeFromSpaceLine': identifier not found
d:/mozilla/source/mailnews/import/outlook/src/nsOutlookMail.cpp(611) : error C38
61: 'EscapeFromSpaceLine': identifier not found
d:/mozilla/source/mailnews/import/outlook/src/nsOutlookMail.cpp(663) : error C38
61: 'EscapeFromSpaceLine': identifier not found
d:/mozilla/source/mailnews/import/outlook/src/nsOutlookMail.cpp(1061) : warning
C4018: '<' : signed/unsigned mismatch
Comment 16 David :Bienvenu 2009-02-16 13:23:45 PST
ah, yes, life has moved on quite a bit since that patch. I'll see if I can't quickly get you an updated patch.
Comment 17 Przemyslaw Bialik 2009-02-16 13:32:03 PST
(In reply to comment #16)
OK, great, the other option could be to fix bug 219269 ;)
Comment 18 David :Bienvenu 2009-02-16 13:49:06 PST
Created attachment 362624 [details] [diff] [review]
unbit-rotted patch

this needs to be fixed no matter what...
Comment 19 Przemyslaw Bialik 2009-02-16 23:32:51 PST
> 'EscapeFromSpaceLine': identifier not found
these errors are preventing successful build, though they are not related to the patch hmm ?
Comment 20 David :Bienvenu 2009-02-17 08:01:05 PST
Are you building on the comm-central trunk? Those errors are not related to the patch. Does the patch apply cleanly?
Comment 21 Magnus Melin 2009-02-27 05:33:19 PST
Przemyslaw: tried to build again?
Comment 22 Przemyslaw Bialik 2009-02-27 06:12:31 PST
I've had some conversation with David, here is my last comment:
(didn't get reply yet)

patched build didn't changed anything for me
imported mail from outlook does not have X-Mozilla-Status headers,
after marking message as read they also do not show up and so after
rebuilding index messages are reset to unread state
I've tested with outlook 2003 and 2007
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b3pre) Gecko/20090217 Shredder/3.0b2pre
Comment 23 David :Bienvenu 2009-02-27 08:57:27 PST
Can you use the debugger to see if the lines that the patch added are executed?
Comment 24 Przemyslaw Bialik 2009-03-14 13:55:07 PDT
"status update":
I've added printfs to the modified functions.
There are no printfs from the nsOutlookMail.cpp so this means that the
patched function was not executed.
(waiting for other patch / patched file to play with).
Comment 25 WADA 2009-07-15 22:40:13 PDT
*** Bug 388776 has been marked as a duplicate of this bug. ***
Comment 26 Wayne Mery (:wsmwk, NI for questions) 2009-08-25 13:04:17 PDT
Przemyslaw, are you waiting on bienvenu?
Comment 27 David :Bienvenu 2009-08-25 13:09:16 PDT
I think we don't have a patch that fixes the issue, is my recollection, and I'm more or less just guessing about what to patch, since I can't recreate the problem.
Comment 28 Wayne Mery (:wsmwk, NI for questions) 2012-01-31 20:56:44 PST
Przemyslaw do you still have a testcase?

Giacomo aka the reporter seems to be gone.
Comment 29 Mike Kaganski 2012-09-09 15:07:47 PDT
This bug has been fixed by fixing Bug 207156 comment 93 (attachment 490452 [details] [diff] [review]), that fix was based on this bug's patch made by David. It is included into TB since v7 (IIRC).
Comment 30 :aceman 2012-09-10 00:29:55 PDT
David Bienvenu, as you have produced a patch here, can you confirm comment 29?
Comment 31 Ludovic Hirlimann [:Usul] 2012-09-10 01:08:35 PDT
(In reply to :aceman from comment #30)
> David Bienvenu, as you have produced a patch here, can you confirm comment
> 29?

I'll trust mike on this one.

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