Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I script the installation of Thunderbird profiles and configuration of per-user account settings onto a number of network machines running OS X?

share|improve this question
up vote 1 down vote accepted


Thunderbird's account settings are part of the profile. Therefore, to create a new profile for each user, you need to copy over the Profile's folder and the profiles.ini file which thunderbird checks to know which profile to load. Finally, you need to edit a few files in the Profile folder so that they point to the correct paths in the new machine.

For example, lets say that your master (local) user is called LOCALUSER and use a profile called knw54wii.default. In the file /Users/LOCALUSER/Library/Thunderbird/Profiles/knw54wii.default/prefs.js, there will be lines specifying directory paths like:

(9A=/Users/LOCALUSER/.thunderbird/knw54wii.default/Mail/Local Folders)

You will need to change all instances of /Users/LOCALUSER/ to /Users/REMOTEUSER/ where REMOTEUSER is the username for each remote machine. You can automate all this using BASH, ssh/scp and sed:

while read name ip ;
    scp -r "~/Library/Thunderbird/Profiles/knw54wii.default/" $name@$ip:"/Users/$user/Library/Thunderbird/Profiles/"; 
    scp -r "~/Library/Application Support/Thunderbird/profile.ini" $name@$ip:"/Users/$user/Library/Application Support/Thunderbird/"; 
    ssh  $name@$ip sed -i s/LOCALUSER/"$name"/g /Users/$user/Library/Thunderbird/Profiles/knw54wii.default
done < $1

Make sure to change LOCALUSER to whatever username you have on your local, master machine. Also change knw54wii.default to the appropriate profile name. Then, save this script as, and run it on a list of users and their IP addresses:

bash IPlist.txt

Where IPlist.txt contains one local user and their ip per line, eg:


The script line above, runs two scp commands, one copying the profile folder and the second copying profile.ini. The third command runs sed to change all instances of LOCALUSER to whatever is currently in the $name variable, ie the remote user's name.

To avoid having to repeatedly enter the ssh password, you can try setting up passwordless ssh.

I do not currently have access to an OSX machine so I am extrapolating all this from my Linux set up. Make sure to test it first. Even if it does not work perfectly it should at least help you along.

share|improve this answer
Thanks! Upvoted. How about configuring user accounts too? I have starting passwords for all accounts (they can change the password later). – Robottinosino Oct 5 '12 at 14:12
@Robottinosino That depends on which aspect of the account you want to configure. If configuring involves editing simple text files or copying a directory then you can script it in a similar manner. Update your question, or even better, post a new one with what exactly you need to do. Depending on your needs, it may be best to make an image of your test machine and install that on each of your workstations. – terdon Oct 5 '12 at 15:34
I edited the question. I cannot copy entire machines when I could just generate a few text files with IMAP server address, etc... I am surprised there is not admin toolkit from Mozilla? Or, is there? – Robottinosino Oct 5 '12 at 15:58
@Robottinosino don't know about any admin toolkit. There may very well be one. My updated answer gives you (I hope) a command line way of doing this. – terdon Oct 5 '12 at 17:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .