unable to import Seamonkey data into Thunderbird
Categories
(MailNews Core :: Import, enhancement, P2)
Tracking
(thunderbird_esr78 fixed, thunderbird78 affected)
People
(Reporter: bugzilla, Assigned: rnons)
References
()
Details
Attachments
(4 files, 10 obsolete files)
28.81 KB,
patch
|
rnons
:
review+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
10.85 KB,
patch
|
rnons
:
review+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
20.97 KB,
patch
|
benc
:
review+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
25.80 KB,
patch
|
rnons
:
review+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
Comment 1•20 years ago
|
||
Reporter | ||
Comment 3•20 years ago
|
||
Comment 4•20 years ago
|
||
Reporter | ||
Updated•20 years ago
|
Updated•20 years ago
|
Reporter | ||
Updated•20 years ago
|
Comment 6•20 years ago
|
||
Reporter | ||
Comment 7•20 years ago
|
||
Comment 8•20 years ago
|
||
Comment 9•20 years ago
|
||
Comment 10•19 years ago
|
||
Comment 11•17 years ago
|
||
Comment 12•17 years ago
|
||
Comment 13•17 years ago
|
||
Updated•17 years ago
|
Comment 14•16 years ago
|
||
Comment 15•16 years ago
|
||
Comment 16•15 years ago
|
||
Updated•6 years ago
|
Comment 18•5 years ago
|
||
I can confirm that the import assistent still is broken in Thunderbird 68.4.1.
Use:
- Select Tools - Import - Import Everything and click on "Next"
- TB suggests "Seamonkey 2 or later"
- Click on "next"
TB will immediately show the Import Complete message without importing anything.
I'm not sure how long I've been using Seamonkey, maybe I startet with 1.x, but the current installed version is 2.49.4.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 21•5 years ago
|
||
In the Import Dialog, there are options to import everything or import mail/addressbook separately. So there are two parts of this bug:
- when "Import Everything" is selected, click the Next button, the Migration Dialog is shown listing "SeaMonkey 2 or later". However, by selecting SeaMonkey and clicking the Next button, migration finished immediately but nothing is imported.
- when "Import Mail" is selected, click the Next button, "No application or file to import data from was found." is shown.
This patch fixed the first part, the migration works, but will overwrite all existing mail accounts/settings. Not sure why, it requires a restart of TB to show imported mail accounts. I was a bit worried about this overwriting at first, but maybe it's expected?
For the second part, I think we need to implement a SeaMonkey importer similar to the existing Outlook/AppleMail importer.
Assignee | ||
Updated•5 years ago
|
Comment 22•5 years ago
|
||
Assignee | ||
Comment 23•5 years ago
|
||
This patch added support for importing mail and accounts from Seamonkey.
Steps: Import --> Import Everything --> Seamonkey --> Next --> Finish
.
Will submit followup patches to import addressbook/filters.
Comment 24•5 years ago
|
||
Assignee | ||
Comment 25•5 years ago
|
||
Fixed review comments.
Comment 26•5 years ago
|
||
Comment 27•5 years ago
|
||
Doh! Sorry, forgot to mention clang-format
. You'll want to run your patch through it before we land it:
to see the changes:
$ mach clang-format -s -p "comm/mail/components/migration/src/nsSeamonkeyProfileMigrator.h"
$ mach clang-format -s -p "comm/mail/components/migration/src/nsSeamonkeyProfileMigrator.cpp"
if you're happy with the changes, run again without the -s
to let clang-format
alter the files.
The javascript changes all seem to pass linting just fine.
Assignee | ||
Comment 28•5 years ago
|
||
Thanks for your detailed review. Strangely, I didn't find anything by running ../mach clang-format
, will wait for the Try run: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=444b48d22db623b8daee3720ac1162756c9caa14
Assignee | ||
Comment 29•5 years ago
|
||
Ran clang-format in m-c root. Thanks.
Found that ../mach clang-format
inside comm
folder doesn't work. Also found bug 1611580, that clang-format is not run on treeherder for c-c.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 30•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4422b4525c2f
Support importing accounts and mails from SeaMonkey. r=benc
Comment 31•5 years ago
•
|
||
(In reply to Ping Chen (:rnons) from comment #29)
Found that
../mach clang-format
insidecomm
folder doesn't work.
Ahh yes - I remember this. It /does/ work inside comm
, but you have to include comm/
in the path, eg
$ ../mach clang-format -s -p comm/mailnews/....
But if you forget the comm/
it doesn't complain about missing files. It just outputs nothing, which is very confusing.
(In the end, I just hacked up a shell script to run eslint and clang-format for me: https://github.com/bcampbell/tb-notes/blob/master/scripts/cclint)
Assignee | ||
Comment 32•5 years ago
|
||
Good to know, thanks for sharing. It's interesting I also have a tb-notes folder on my local, but mostly for bugs I'm working on.
Assignee | ||
Comment 33•5 years ago
|
||
Support importing addressbook from seamonkey. Steps: Import --> Import Everything --> Seamonkey --> Next --> Finish
Will work on importing things separately next.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 34•5 years ago
|
||
Assignee | ||
Comment 35•5 years ago
|
||
You're right, they are not needed. I haven't touched C++ for a few years and am picking it back. I saw a aPrefs.Clear()
in the WriteBranch
function and thought maybe I need to clear the key hash tables as well.
Assignee | ||
Updated•5 years ago
|
Comment 36•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/a857186a1054
Support importing addressbooks from SeaMonkey. r=benc
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 37•5 years ago
|
||
This patch added a SeamonkeyImport.jsm
module, so that when selecting address books or settings in the import dialog, Seamonkey is listed as an option. The actual importing is still done in nsSeamonkeyProfileMigrator.
Steps: Import --> Address Books (or Settings) --> SeaMonkey --> Next
Will work on Import --> Mail
next, haven't figured out how to do it. It's a bit confusing that import mail only imports emails but not mail accounts. Have to use import settings to import mail accounts.
Assignee | ||
Comment 38•5 years ago
|
||
This patch implements importing mail from SeaMonkey, it depends on 272292-import-separately.patch. I'm asking for some feedback not review, the current situation:
- When using
PR_CreateThread
,NS_DISPATCH_SYNC
fails to block the thread. TakeProxyGetChildNamed
as an example
RefPtr<GetChildNamedRunnable> getChildNamed = new GetChildNamedRunnable(aFolder, aName, aChild);
// log "before dispatch"
nsresult rv = NS_DispatchToMainThread(getChildNamed, NS_DISPATCH_SYNC); // log "Run" inside `Run`
// log "before dispatch"
return getChildNamed->mResult;
Expected result is
before dispatch | Run | after dispatch
Actual result is
before dispatch | after dispatch | Run
This problem is not related to the current patch. Importing mail from outlook doesn't work on trunk.
-
Strangely, using
nsIThreadManager->NewThread
doesn't have problem 1.NS_DISPATCH_SYNC
blocks the thread as expected and importing mail from outlook works (without error, but mails not really imported, separate issue). -
However there is another problem, I wrote the SeamonkeyImport module in js, and js xpcom can only be run in the main thread!
Jorg, I saw your work on bug 1176748, does it make sense to run the whole import code in the main thread? Considering we used so many NS_DispatchToMainThread
in not only nsImportMail.cpp
, but also nsOutlookMail.cpp
and nsBeckyMail.cpp
. Also considering the import dialog is a modal dialog, user can't do anything like checking/reading mail when import dialog is shown. What is the benefit of running import in a separate thread?
Comment 39•5 years ago
|
||
Comment 40•5 years ago
|
||
(In reply to Ping Chen (:rnons) from comment #38)
- When using
PR_CreateThread
,NS_DISPATCH_SYNC
fails to block the thread.
Raw PRThread
s don't have an event queue, so you can't dispatch to them anyway. They are just a cross-platform low level OS thread.
But the fancy nsThread
objects that nsIThreadManager creates do have an event queue. The underlying PRThread used by nsThread
is stored in nsIEventTarget::mThread
, which nsThread derives from (eventually).
From what I understand, NS_DISPATCH_SYNC
works by entering a loop which pumps the event queue of the local thread repeatedly, checking each time to see if the dispatched event has finished executing on the remote thread.
Since PRThread
don't have an event queue, I guess it just doesn't work... (a cursory reading of the code seems to indicate that the Dispatch() call will return NS_ERROR_NOT_AVAILABLE
. See https://searchfox.org/mozilla-central/source/xpcom/threads/ThreadEventTarget.cpp#72 )
I didn't know any of this 30 minutes ago, but now I do :-)
Assignee | ||
Comment 41•5 years ago
|
||
Thanks, no worries, I can wait till you're back.
Raw
PRThread
s don't have an event queue, so you can't dispatch to them anyway.
The dispatch was sent from PRThread
to main thread, because some xpcom can only be ran on the main thread. I guess it worked in bug 1176748, but some later changes in m-c broke it. Anyway, the problem for me right now is whether it's good to run the whole import module in the main thread. If not, I need to rewrite the code of importing mail from Seamonkey in c++. -_-
Assignee | ||
Updated•5 years ago
|
Comment 42•5 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/53b9cbabf6cb
Support importing addressbooks and settings from SeaMonkey separately. r=benc
Comment 43•5 years ago
|
||
Assignee | ||
Comment 44•5 years ago
|
||
Thanks, I will take a look at mailstoreConverter.jsm, but this change doesn't only affect seamonkey importer, outlook/applemail importer will run in the main thread as well.
if it takes a long time someone will think the application froze and force shut it down
This seems the same to me by running it in a worker thread. I mean user cannot close the import dialog and can only wait. Instead, the progress indicator or status message update may be more helpful.
Comment 45•5 years ago
|
||
E.g. a progress indicator isn't possible when running in the main thread, because the UI is completely blocked until the function returns.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 46•5 years ago
|
||
I tried to use worker in SeamonkeyImport.jsm, but the C++ code won't wait for the JS ImportMailbox
function. As a result, the ImportDialog will advance to the next step with a blank screen, no success message.
With this patch, I tried to import 44 mailboxes, 12.4GB in total from Seamonkey, it took about 31 seconds to finish.
On the other hand, with the current trunk code, success message is accumulated in the sub-thread, only when all importing finished, it gets shown in the import dialog. https://searchfox.org/comm-central/source/mailnews/import/src/nsImportMail.cpp#655. So I think from the user's perspective, it's the same as running in the main thread.
From reading https://searchfox.org/comm-central/source/mailnews/import/public/nsIImportGeneric.idl#65-72, there is BeginImport
and ContinueImport
, I guess the original idea is to use BeginImport
to kick start the importing, and use ContinueImport
to get the current progress and do the next importing. However, our current code does everything inside BeginImport
. So no matter using sub-thread or not, user only get the success/progress message after all import finished. I think if we want, we can improve this in another bug, since it will touch the code of other importers.
Comment 47•5 years ago
|
||
Looks fairly ok to me. I'll let Ben review
Comment 48•5 years ago
|
||
Assignee | ||
Comment 49•5 years ago
|
||
Turns out readonly attribute Array<AString> sourceProfiles;
is compiled to GetSourceProfiles(nsTArray<nsString >& aSourceProfiles)
in C++. I have dropped nsISupportsString
in both C++ and JS accordingly.
aResult.Clear();
aResult.AppendElements(mProfileNames);Could be
aResult = mProfileNames.Clone();
I saw this Clear
and AppendElements
in one of your earlier patch (perhaps https://bugzilla.mozilla.org/attachment.cgi?id=9137950&action=diff), I thought it was the way to go. Glad to know Clone
is enough, please take another look.
Assignee | ||
Comment 50•5 years ago
|
||
Just noticed bug 1652371. So ChromeUtils.generateQI([Ci.nsIImportMail])
became ChromeUtils.generateQI(["nsIImportMail"])
.
Comment 51•5 years ago
|
||
Comment 52•5 years ago
|
||
(In reply to Ping Chen (:rnons) from comment #49)
aResult.Clear();
aResult.AppendElements(mProfileNames);Could be
aResult = mProfileNames.Clone();
I saw this
Clear
andAppendElements
in one of your earlier patch (perhaps https://bugzilla.mozilla.org/attachment.cgi?id=9137950&action=diff), I thought it was the way to go. Glad to knowClone
is enough, please take another look.
Yep, there's probably a few places where I could have used Clone()
instead...
AppendElements()
works also when copying from various other collection types I think... and you can pass in on-the-fly arrays, eg
array.AppendElements({thing1, thing2, thing3});
which is kind of cool.
For copying a whole nsTArray<>
of the same type, there used to be an assignment operator, like so:
aResult = mProfileNames;
but that's been removed, so .Clone()
is now the way to go.
Assignee | ||
Updated•5 years ago
|
Comment 53•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ac6d55b907d3
Support importing mail from SeaMonkey. r=benc
Comment 54•5 years ago
|
||
Did this get a try run? Looks like it broken on windows: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=310827968&repo=comm-central&lineNumber=56430
lld-link: error: undefined symbol: public: virtual enum nsresult __cdecl nsOutlookProfileMigrator::GetSourceProfileLocations(class nsTArray<class RefPtr<class nsIFile>> &)
Comment 55•5 years ago
|
||
Assignee | ||
Comment 56•5 years ago
|
||
Not tested, I pushed to Try: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=1a2a766de9bcce7dd228ca324dc596fccf2082f8
Assignee | ||
Comment 57•5 years ago
|
||
This is the correct Try link: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=1b7ba003c31d15974d30920f6333a048f1f07c09, not finished yet.
Let me know if you want me to merge the two patches.
Comment 58•5 years ago
|
||
Thanks, yes please combine the two patches for landing.
Assignee | ||
Comment 59•5 years ago
|
||
Merge 272292-outlook-migrator.patch into 272292-import-mail.patch, to fix building on Windows.
Assignee | ||
Updated•5 years ago
|
Comment 60•5 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/6487f5a13d11
Support importing mail from SeaMonkey. r=benc
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 61•5 years ago
|
||
Assignee | ||
Comment 62•5 years ago
|
||
Assignee | ||
Comment 63•5 years ago
•
|
||
Assignee | ||
Comment 64•5 years ago
|
||
Comment 65•5 years ago
|
||
Comment 66•5 years ago
|
||
Comment 67•5 years ago
|
||
Comment 68•5 years ago
|
||
Comment 69•5 years ago
|
||
bugherder uplift |
Comment 70•4 years ago
|
||
I have a quite big Seamonkey database. Should I help testing if this works fine now? Is there any Windows build I could use for testing?
Comment 71•4 years ago
|
||
I did test this successfully with TB 78.3.1, however I had to close Seamonkey before, otherwise TB won't import the currently opened folder without leaving a failure message.
Comment 72•4 years ago
|
||
Import from SeaMonkey mixes up identities and accounts, see Bug 1696839
Description
•