Tuesday, 8 December 2009

Thunderbird: how to set order of email accounts

If you use the free open source email software Mozilla Thunderbird, which I do (e.g. for Gmail, mail via Google Apps and my college email), it isn't obvious how to get your different email accounts to show up in the order you want.

I've even added a new email account - and then found that on closing and restarting Thunderbird, the new account has vanished completely.

So here is how to change the order of email accounts in Thunderbird, and stop newly added accounts from disappearing.

How to change the account order - prefs.js

The MozillaZine site explains how to manually edit your prefs.js file which is to be found in your Thunderbird profile folder.

Make sure Thunderbird is closed before you try to edit the file, which you can do e.g. in Notepad. But before you close Thunderbird take a note of the order in which your email accounts folders appear in Thunderbird on the left e.g. college, Gmail, local folders.

As the MozillaZine thread mentions, find the 2 lines in that file which look something like this:

user_pref("mail.accountmanager.accounts", "account3,account5,account4,account2,account1,account6");
user_pref("mail.accountmanager.defaultaccount", "account3");

In the first user_pref brackets, the accounts are listed in the current order in which they appear in your Thunderbird - unfortunately it doesn't identify the accounts by name like college, Gmail, local folders etc, but from the note you took earlier, if college email appeared first then it's account3 in the example above, if work email appeared next in order then it's account5, and so on.

That's how you know which email account is given which ID number by Thunderbird.

Now that you know what stands for which email account, you can reorder the accounts the way you want just by changing the stuff in the first user_pref brackets to e.g. "account6,account3,account1,account2,account5" or whatever you prefer.

There is one thing to watch. In the second user_pref line above, you must make sure that the account listed in that line (account3 in the example above), which is the default account, is listed first in order in the first user_pref line. So if I changed it to:


in my first user_pref line, I'd have to make sure to change the second line to match i.e. account6 (which appears first now in the first line):

user_pref("mail.accountmanager.defaultaccount", "account6");

Vanishing new email account? - user.js

Now if you have the problem of a new account that you add disappearing each time you exit Thunderbird, here's one possible solution to the problem (and believe me it's a pain to have to keep adding it back only to see it go again!).

In my case it was to do with the user.js file, which I'd created to set some preferences (how to create user.js file).

I'd edited the user.js file so one line read:

user_pref("mail.accountmanager.accounts", "account3,account5,account4,account2,account1");

But when I added a new email account account6, it kept "deleting" itself - because I'd not included it in the user.js file.

All I had to do was change the user.js file to something like this, where I'd inserted the new account6 somewhere in that list, and then it was fine:

user_pref("mail.accountmanager.accounts", "account6,account3,account5,account4,account2,account1");

1 comment:

Michele said...

Changing order of the accounts as explained here doesn't work with my ThunderbirdPortable...

I modified the proper lines on pref.js, but the result is even more bother in how Thunderbird displays the accounts on the left column.

In fact I only wanted to change the order in which Thunderbird downloads e-mails from the different accounts.

View from the left column:
-Main Account (set as default);
-Secondary Account;
-University Account;
-My website Account;
-Local Folders.

"accounts" on prefs.js:

"defaultaccount" on prefs.js:

If I turn "account5" to "account2" in defaultaccount, the view from the left column changes and mixes the order of the accounts in an incomprehensible order.

And I found several prefs.js within the "Profile" directory: prefs.js, prefs-1.js, prefs-2.js ... prefs-4.js.

Any help?