HowTo.Gumph.Org

Step by step solutions to IT problems

Remove Local Folders from Thunderbird

If you use Thunderbird to access an IMAP mailbox then there really is no need for "Local Folders" in Thunderbird, as all your mail and drafts can be stored on the IMAP server. There is no setting for removing the "Local Folders", but they can be removed by just a few simple edits of thunderbirds prefs.js file.

The easiest time to remove the "local folders" is just after Thunderbird has been installed, and before it has connected to your IMAP server, as your prefs.js file will be simpler making it easier to edit.

The best way to achieve this, is when you run Thunderbird for the first time, fill in all your details correctly for connecting to your IMAP server, but when it prompts you for the password to access your IMAP account, click Cancel. That way, you will have a simplest prefs.js file to edit.

Editing prefs.js

From your users profile folder, your prefs.js file should be located in the subfolder "Application Data\Thunderbird\Profiles\random.default\". It's best to take a copy of the file, just in case you break something while editing it.

Your prefs file should look very similar to the one listed below. I've added line numbers to the listing to help with specifying the lines to edit.

1  # Mozilla User Preferences
2  
3  /* Do not edit this file.
4  *
5  * If you make changes to this file while the application is running,
6  * the changes will be overwritten when the application exits.
7  *
8  * To make a manual change to preferences, you can visit the URL about:config
9  * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
10 */
11 
12 user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1148383388);
13 user_pref("app.update.lastUpdateTime.background-update-timer", 1148383386);
14 user_pref("extensions.lastAppVersion", "1.5.0.2");
15 user_pref("mail.account.account1.server", "server1");
16 user_pref("mail.account.account2.identities", "id1");
17 user_pref("mail.account.account2.server", "server2");
18 user_pref("mail.accountmanager.accounts", "account1,account2");
19 user_pref("mail.accountmanager.defaultaccount", "account2");
20 user_pref("mail.accountmanager.localfoldersserver", "server1");
21 user_pref("mail.identity.id1.draft_folder", "imap://MyUsername@imap.mydomain.com/Drafts");
22 user_pref("mail.identity.id1.drafts_folder_picker_mode", "0");
23 user_pref("mail.identity.id1.fcc_folder", "imap://MyUsername@imap.mydomain.com/Sent");
24 user_pref("mail.identity.id1.fcc_folder_picker_mode", "0");
25 user_pref("mail.identity.id1.fullName", "MyName");
26 user_pref("mail.identity.id1.smtpServer", "smtp1");
27 user_pref("mail.identity.id1.stationery_folder", "imap://MyUsername@imap.mydomain.com/Templates");
28 user_pref("mail.identity.id1.tmpl_folder_picker_mode", "0");
29 user_pref("mail.identity.id1.useremail", "MyEmail@MyDomain");
30 user_pref("mail.identity.id1.valid", true);
31 user_pref("mail.root.imap", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail");
32 user_pref("mail.root.imap-rel", "[ProfD]ImapMail");
33 user_pref("mail.root.none", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\Mail");
34 user_pref("mail.root.none-rel", "[ProfD]Mail");
35 user_pref("mail.server.server1.directory", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\Mail\\Local Folders");
36 user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
37 user_pref("mail.server.server1.hostname", "Local Folders");
38 user_pref("mail.server.server1.name", "Local Folders");
39 user_pref("mail.server.server1.type", "none");
40 user_pref("mail.server.server1.userName", "nobody");
41 user_pref("mail.server.server2.directory", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail\\imap.mydomain.com");
42 user_pref("mail.server.server2.directory-rel", "[ProfD]ImapMail/imap.mydomain.com");
43 user_pref("mail.server.server2.download_on_biff", true);
44 user_pref("mail.server.server2.hostname", "imap.mydomain.com");
45 user_pref("mail.server.server2.login_at_startup", true);
46 user_pref("mail.server.server2.max_cached_connections", 5);
47 user_pref("mail.server.server2.name", "MyAccountName");
48 user_pref("mail.server.server2.type", "imap");
49 user_pref("mail.server.server2.userName", "MyUsername");
50 user_pref("mail.smtp.defaultserver", "smtp1");
51 user_pref("mail.smtpserver.smtp1.hostname", "smtp.mydomain.com");
52 user_pref("mail.smtpserver.smtp1.username", "MyUsername");
53 user_pref("mail.smtpservers", "smtp1");
54 user_pref("mail.startup.enabledMailCheckOnce", true);
55 user_pref("mailnews.quotingPrefs.version", 1);
56 user_pref("mailnews.ui.threadpane.version", 5);

Firstly I'll list the lines to edit, then we'll go through and delete lines we no longer need.

First up we need to edit lines 16 to 20 so they refer to server1, account1 and id1 only.

16 user_pref("mail.account.account1.server", "server1");
17 user_pref("mail.account.account1.identities", "id1");
18 user_pref("mail.accountmanager.accounts", "account1");
19 user_pref("mail.accountmanager.defaultaccount", "account1");
20 user_pref("mail.accountmanager.localfoldersserver", "server1");

next we need to edit lines 33 and 34 so the second parameters are the same as for lines 31 and 32. This is very important otherwise Thunderbird will just go and re-create the "local folders" when you run it.

31 user_pref("mail.root.imap", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail");
32 user_pref("mail.root.imap-rel", "[ProfD]ImapMail");
33 user_pref("mail.root.none", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail");
34 user_pref("mail.root.none-rel", "[ProfD]ImapMail");

Next we need to edit lines 41 to 49 so references to server2 are replaced with server1

41 user_pref("mail.server.server1.directory", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail\\imap.mydomain.com");
42 user_pref("mail.server.server1.directory-rel", "[ProfD]ImapMail/imap.mydomain.com");
43 user_pref("mail.server.server1.download_on_biff", true);
44 user_pref("mail.server.server1.hostname", "imap.mydomain.com);
45 user_pref("mail.server.server1.login_at_startup", true);
46 user_pref("mail.server.server1.max_cached_connections", 5);
47 user_pref("mail.server.server1.name", "MyAccountName");
48 user_pref("mail.server.server1.type", "imap");
49 user_pref("mail.server.server1.userName", "MyUsername");

Now all the editing is done, we need to delete some lines we no longer need. Firstly delete lines 35 to 40 that contained the original server1 entries

35 user_pref("mail.server.server1.directory", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\Mail\\Local Folders");
36 user_pref("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
37 user_pref("mail.server.server1.hostname", "Local Folders");
38 user_pref("mail.server.server1.name", "Local Folders");
39 user_pref("mail.server.server1.type", "none");
40 user_pref("mail.server.server1.userName", "nobody");

and next delete line 15, which contained the original server1 line

15 user_pref("mail.account.account1.server", "server1");

The final results

Now all the edits have been made your prefs.js file should look much like the one listed below. Obviously your username, email, server names and profile paths will be different.
# Mozilla User Preferences

/* Do not edit this file. * * If you make changes to this file while the application is running, * the changes will be overwritten when the application exits. * * To make a manual change to preferences, you can visit the URL about:config * For more information, see http://www.mozilla.org/unix/customizing.html#prefs */

user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1148383388); user_pref("app.update.lastUpdateTime.background-update-timer", 1148383386); user_pref("extensions.lastAppVersion", "1.5.0.2"); user_pref("mail.account.account1.server", "server1"); user_pref("mail.account.account1.identities", "id1"); user_pref("mail.accountmanager.accounts", "account1"); user_pref("mail.accountmanager.defaultaccount", "account1"); user_pref("mail.accountmanager.localfoldersserver", "server1"); user_pref("mail.identity.id1.draft_folder", "imap://MyUsername@imap.mydomain.com/Drafts"); user_pref("mail.identity.id1.drafts_folder_picker_mode", "0"); user_pref("mail.identity.id1.fcc_folder", "imap://MyUsername@imap.mydomain.com/Sent"); user_pref("mail.identity.id1.fcc_folder_picker_mode", "0"); user_pref("mail.identity.id1.fullName", "MyName"); user_pref("mail.identity.id1.smtpServer", "smtp1"); user_pref("mail.identity.id1.stationery_folder", "imap://MyUsername@imap.mydomain.com/Templates"); user_pref("mail.identity.id1.tmpl_folder_picker_mode", "0"); user_pref("mail.identity.id1.useremail", "MyEmail@MyDomain"); user_pref("mail.identity.id1.valid", true); user_pref("mail.root.imap", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail"); user_pref("mail.root.imap-rel", "[ProfD]ImapMail"); user_pref("mail.root.none", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail"); user_pref("mail.root.none-rel", "[ProfD]ImapMail"); user_pref("mail.server.server1.directory", "C:\\WINDOWS\\Application Data\\Thunderbird\\Profiles\\rgq8o97r.default\\ImapMail\\imap.mydomain.com"); user_pref("mail.server.server1.directory-rel", "[ProfD]ImapMail/imap.mydomain.com"); user_pref("mail.server.server1.download_on_biff", true); user_pref("mail.server.server1.hostname", "imap.mydomain.com); user_pref("mail.server.server1.login_at_startup", true); user_pref("mail.server.server1.max_cached_connections", 5); user_pref("mail.server.server1.name", "MyAccountName"); user_pref("mail.server.server1.type", "imap"); user_pref("mail.server.server1.userName", "MyUsername"); user_pref("mail.smtp.defaultserver", "smtp1"); user_pref("mail.smtpserver.smtp1.hostname", "smtp.mydomain.com"); user_pref("mail.smtpserver.smtp1.username", "MyUsername"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.startup.enabledMailCheckOnce", true); user_pref("mailnews.quotingPrefs.version", 1); user_pref("mailnews.ui.threadpane.version", 5);

Now when you run Thunderbird, you should no longer see any "Local Folders" listed, just your IMAP account.

Submit to     del.icio.us    digg    reddit    simpy