archive_keep_folder_structure not effective when archiving messages from Inbox
Categories
(Thunderbird :: Account Manager, defect)
Tracking
(Not tracked)
People
(Reporter: ardovm, Assigned: welpy-cw)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Comment 1•13 years ago
|
||
Reporter | ||
Comment 2•13 years ago
|
||
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Comment 7•10 years ago
|
||
Comment 8•10 years ago
|
||
Comment 9•10 years ago
|
||
Comment 10•9 years ago
|
||
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
Comment 13•4 years ago
|
||
Have just installed Thunderbird 78.3.1 in new CentOS 8 installation these days - I can't believe this annoying "feature" is still present...
In particular, because I have some installations (Thunderbird installed between 2015 and 2019 in CentOS 7 and Fedora 29 / 30 / 31 / 32) where this is respected (so I get messages to Archives-2020-Inbox, as expected...). The last one at Fedora 32, installed last year (in Fedora 29 at that time), and regularly updated by now. No problem there.
Is there any (hidden?) setting to achieve this - by my opinion just normal - behavior? Or, any other workaround?
Comment 14•3 years ago
|
||
For version Thunderbird 91.3.2 (64-bit),
archive: omni.ja
file: modules\MessageArchiver.jsm
possible problem code location: line 252
while (folder != rootFolder && folder != inboxFolder) {
folderNames.unshift(folder.name);
folder = folder.parent;
}
INBOX folder removed archive from structure.
What the reason to process inboxFolder other than any folders?
This turns "keep original folder structure" to "keep original folder structure, EXCLUDE INBOX" :(
User don't get expected structure.
Comment 15•3 years ago
|
||
My proof of concept test i made on Thunderbird 91.3.2 (64-bit):
-
I created folder "zabbix" as "INBOX" subfolder on IMAP account.
-
Copied any message to "INBOX\zabbix" folder.
-
I created local folder "archive"
-
Configured archiving to "archive" folder, "one folder" option (no "by years", no "by monthes"), check "keep original folder structure".
-
Right mouse button on message in "INBOX\zabbix" - Archive action.
-
Thunderbird created "zabbix" folder as "archive" folder and place message to "archive\zabbix".
-
Extract file "modules\MessageArchiver.jsm" from "C:\Program Files\Mozilla Thunderbird\omni.ja".
-
Change line 252 from
while (folder != rootFolder && folder != inboxFolder) {
to
while (folder != rootFolder /*&& folder != inboxFolder*/) {
then repack file back to onmi.ja -
Repeate archive message action as (5) above.
-
Thunderbird created "INBOX\zabbix" folder as "archive" subfolder folder and place message to "archive\INBOX\zabbix".
Updated•2 years ago
|
Comment 16•2 years ago
|
||
Someone here said the year folder is the actual INBOX. Another one mentioned that the dialog box in the archive settings leads astray.
See this link from 2016: https://support.mozilla.org/en-US/questions/1103531
I can't think of any sensible reason for this behaviour. Or is there an explanation?
Comment 17•11 months ago
•
|
||
While working on bug 1880014 I noticed that when messages in Inbox were archived (with include directory option) that Inbox folder were never created. All other folders had their folder name created. I thought it was maybe related to bug 1880014 but found this.
Also, the examples in the archiving option dialog show, for maintaining folder structure, "Inbox" as the only example.
I tried the change suggest in comment 15 and comment 16 and it fixes the issue so a message archived from Inbox now appears in an Inbox folder created under archives.
diff --git a/mail/modules/MessageArchiver.sys.mjs b/mail/modules/MessageArchiver.sys.mjs
--- a/mail/modules/MessageArchiver.sys.mjs
+++ b/mail/modules/MessageArchiver.sys.mjs
@@ -285,25 +285,24 @@ MessageArchiver.prototype = {
}
}
}
// Create the folder structure in Archives.
// For imap folders, we need to create the sub-folders asynchronously,
// so we chain the actions using the listener called back from
// createSubfolder. For local, createSubfolder is synchronous.
if (archiveFolder.canCreateSubfolders && batch.keepFolderStructure) {
- // Collect in-order list of folders of source folder structure,
- // excluding top-level INBOX folder
+ // Collect in-order list of folders of source folder structure.
const folderNames = [];
const rootFolder = srcFolder.server.rootFolder;
const inboxFolder = lazy.MailUtils.getInboxFolder(srcFolder.server);
let folder = srcFolder;
- while (folder != rootFolder && folder != inboxFolder) {
+ while (folder != rootFolder) {
folderNames.unshift(folder.name);
folder = folder.parent;
}
// Determine Archive folder structure.
for (let i = 0; i < folderNames.length; ++i) {
const folderName = folderNames[i];
if (!dstFolder.containsChildNamed(folderName)) {
// Create Archive sub-folder (IMAP: async).
if (isAsync) {
I tried this with and without "INBOX." as the personal namespace and with and without INBOX. as the imap server directory. Also, tried it on POP3 account and seems OK there too. See comment 9 for theory as to why excluding Inbox is intentional.
If there really is a valid reason for keeping this the way it currently is, at least the archiving examples in the UI need to show a different folder than Inbox since, the way it works now, an Inbox folder is NEVER created under the archive folder.
Comment 18•11 months ago
|
||
I researched bug 1831494 and found this bug, and I agree with comment 9. Quite intentional.
The implementation of "Keep existing folder structure of archived messages" is via Bug 607295 - Provide UI for new archive granularity and folder structure options - on the heels of Bug 451995 - implement archive method for auto-saving mail.
In bugzilla I'm not finding a direct statement of how "Inbox" should be handled with Bug 607295 or later. Perhaps a reason to not create Archives/Inbox was to not stray from user's expectations from Bug 451995, that messages archived from Inbox go to the "Archives" folder.
Comment 20•11 months ago
|
||
If anyone finds examples of this at https://connect.mozilla.org/ please post them here - I didn't find any.
Comment 21•11 months ago
|
||
Wayne Mery encouraged me to point to bug 1831494. It was just marked as a duplicate of this one, but it adds value by describing in detail and with an example how to easily reproduce this issue.
BTW, how can I mention a user? Something like @wsmwk does not seem to be working.
Assignee | ||
Comment 22•10 months ago
•
|
||
- Implement the
mail.identity.default.archive_recreate_inbox
preference and the correspondingnsMsgIdentity
attributearchiveRecreateInbox
. This defines how the inbox folder is handled when archiving while preserving the folder structure. If the pref isfalse
, the inbox is treated like the root folder, iftrue
, it is recreated like any other folder. - Make this preference available in the account archive options. Update and fix the example shown there.
Updated•10 months ago
|
Assignee | ||
Comment 23•10 months ago
|
||
Assignee | ||
Updated•9 months ago
|
Comment 24•9 months ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/5f803b631b49
Migrate Archive Options strings to Fluent. r=john.bieling
https://hg.mozilla.org/comm-central/rev/445334850d02
Add preference to recreate inbox folder when archiving. r=babolivier,darktrojan,vineet
Description
•