John, Geoff
I have made some progress diagnosing something changed with
createIncomingServer
presumably with 60.* The extension I took over LocalFolders creates
additional
local folders using the type "none". The basic code for this is below
which has been working
for many years. 60.* to the normal thing of creating both special
folder Trash and Outgoing
Mail. Besides the expected .msf files, now actual local file system
folders are also created.
These are not .sbd folders, just the straight names and both are empty.
At this point
it is not possible to place any messages into the trash folder. If I
delete the empty folders
(either within Thunderbird or externally) then reboot , it becomes
possible to place messages
into Trash or any newly created subfolders within the server root.
I have traced through the code and cannot identify where the empty
folders are created.
I presume there is something like an update function to update folder
status,
something not necessary before.
So I think my questions are:
What methods are required to create a valid "LocalFolder" with
appropriate status.
What is required to update the folder structure without a reboot.
Thanks to all for help so far
Christopher
eu.philoux.localfolder.creeDossierLocal = function (nom, chemin) {
try {
var accountmanager =
Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
var srv = accountmanager.createIncomingServer("nobody", nom,
"none");
var filespec =
Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);
filespec.initWithPath(chemin);
srv.prettyName = nom;
srv.localPath = filespec;
// console.debug('before create account');
eu.philoux.localfolder.LocalFolderTrace("before create account");
var account = accountmanager.createAccount();
account.incomingServer = srv;
return account;
}
catch (ex) {
eu.philoux.localfolder.LocalFolderAfficheMsgId2("ErreurCreationDossier",
ex);
return false;
}
return false;
}
Hi.
Dňa 3. 6. 2019 o 5:26 Christopher Leidigh napísal(a):
John, Geoff
I have made some progress diagnosing something changed with
createIncomingServer
presumably with 60.* The extension I took over LocalFolders creates
additional
local folders using the type "none". The basic code for this is below
which has been working
for many years. 60.* to the normal thing of creating both special
folder Trash and Outgoing
Mail.
You may want to review whether that code does the same as
https://searchfox.org/comm-central/source/mailnews/base/src/nsMsgAccountManager.cpp#2100,
which creates the built-in Local Folders account (apart of setting the
account as the main Local folders account in the pref).
Besides the expected .msf files, now actual local file system
folders are also created.
These are not .sbd folders, just the straight names and both are empty.
Are those actual folders, not just files?
The Inbox folder should be represented by the file Inbox and it's
Inbox.msf. There should be no Inbox or Inbox.sbd folder until you create
a subfolder inside the Inbox via Thunderbird.
We have touched the .sbd suffix handling e.g. at
https://hg.mozilla.org/comm-central/rev/d7d59e4c13d72e96641c5bcebe5e18bb8d4f46eb
, you may try to check it for errors. The intent of those patches wasn't
to change the behaviour in any way.
At this point
it is not possible to place any messages into the trash folder. If I
delete the empty folders
(either within Thunderbird or externally) then reboot , it becomes
possible to place messages
into Trash or any newly created subfolders within the server root.
It seems those default folders are created here:
https://searchfox.org/comm-central/source/mailnews/local/src/nsNoIncomingServer.cpp#127
You can try to trace what it does there.
I have traced through the code and cannot identify where the empty
folders are created.
I presume there is something like an update function to update folder
status,
something not necessary before.
So I think my questions are:
What methods are required to create a valid "LocalFolder" with
appropriate status.
What is required to update the folder structure without a reboot.
Thanks to all for help so far
Christopher
eu.philoux.localfolder.creeDossierLocal = function (nom, chemin) {
try {
var accountmanager =
Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
var srv = accountmanager.createIncomingServer("nobody", nom,
"none");
var filespec =
Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);
filespec.initWithPath(chemin);
srv.prettyName = nom;
srv.localPath = filespec;
// console.debug('before create account');
eu.philoux.localfolder.LocalFolderTrace("before create account");
var account = accountmanager.createAccount();
account.incomingServer = srv;
return account;
}
catch (ex) {
eu.philoux.localfolder.LocalFolderAfficheMsgId2("ErreurCreationDossier",
ex);
return false;
}
return false;
}