Thunderbird

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

Mozilla Thunderbird is an email client available from Mozilla Messaging. It has the ability to install various extensions such as the Lightning calendar.

The release cycles of Thunderbird are very fast. For larger organizations, there is a Version of Thunderbird called Thunderbird Extended Support Release (ESR) available. In ESR the release cycle is 54 Weeks long and only security patches are offered. (see [1])

WPKG Installers[edit]

Latest Thunerbird installer location ftp://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/latest/win32/

Alternative installer location http://www.mozilla.org/en-US/thunderbird/all.html

Thunderbird 31.6.0 and higher[edit]

<!-- Thunderbird -->
<package id="thunderbird" name="Mozilla Thunderbird" revision="%version%" reboot="false" priority="8500">
	<variable name="version" value="38.7.0" />
	<variable name="32or64bit" value="x86" />
	<variable name="locale" value="de" />
	<check type="uninstall" condition="exists" path="Mozilla Thunderbird %version% (%32or64bit% %locale%)" />
			  
	<install cmd="taskkill /F /IM Thunderbird.exe"> <exit code="0" /> <exit code="-1073741515" /> <exit code="128" /></install>
	<install cmd='"%SOFTWARE%\thunderbird\Thunderbird Setup %version%.exe" -ms' />
<!-- Thunderbird als Standard - Email Programm setzen-->
	<install cmd='cscript %SOFTWARE%\thunderbird\setdefault-x86.js' architecture="x86"/>
	<install cmd='cscript %SOFTWARE%\thunderbird\setdefault-x64.js' architecture="x64"/>
		  
	<upgrade include="install" />
			  
	<remove cmd='taskkill /F /IM thunderbird.exe'> <exit code="0" /> <exit code="128" /> <exit code="-1073741515" /></remove>
        <!-- for 32bit and 64bit System -->
	<remove cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Mozilla Thunderbird\uninstall\helper.exe" "%PROGRAMFILES%\Mozilla Thunderbird\uninstall\helper.exe" -ms' architecture="x86" />
	<remove cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Mozilla Thunderbird\uninstall\helper.exe" "%PROGRAMFILES(x86)%\Mozilla Thunderbird\uninstall\helper.exe" -ms' architecture="x64" />
</package>

Configuration INI[edit]

Configuration ini file: <path to setup executable> [/INI=<full path to configuration ini file>]

You can specify some options for installing Thunderbird by using a configuration ini file. When specifying a configuration ini file the installer will always run silently. When specifying a Configuration ini file other command line switches should not be specified and may have unexpected results

Configuration ini file syntax and available settings:

[Install]
;
; Remove the semicolon (;) to un-comment a line.
;
; The name of the directory where the application will be installed in the
; system's program files directory. The security
; context the installer is running in must have write access to the
; installation directory. Also, the directory must not exist or if it exists
; it must be a directory and not a file. If any of these conditions are not met
; the installer will abort the installation with an error level of 2. If this
; value is specified then InstallDirectoryPath will be ignored.
; InstallDirectoryName=Mozilla Thunderbird

; The full path to the directory to install the application. The security
; context the installer is running in must have write access to the
; installation directory. Also, the directory must not exist or if it exists
; it must be a directory and not a file. If any of these conditions are not met
; the installer will abort the installation with an error level of 2.
; InstallDirectoryPath=c:\program files\mozilla thunderbird\

; By default all of the following shortcuts are created. To prevent the
; creation of a shortcut specify false for the shortcut you don't want created.

; Create a shortcut for the application in the current user's QuickLaunch
; directory.
; QuickLaunchShortcut=false

; Create a shortcut for the application on the desktop. This will create the
; shortcut in the All Users Desktop directory and if that fails this will
; attempt to create the shortcuts in the current user's Start Menu directory.
; DesktopShortcut=false

; Create shortcuts for the application in the Start Menu. This will create the
; shortcuts in the All Users Start Menu directory and if that fails this will
; attempt to create the shortcuts in the current user's Start Menu directory.
; StartMenuShortcuts=false

; The directory name to use for the StartMenu folder (not available with
; Firefox 4.0 and above - see note below).
; note: if StartMenuShortcuts=false is specified then this will be ignored.
; StartMenuDirectoryName=Mozilla Thunderbird

Making Thunderbird the default mail and news client[edit]

If you want to make Mozilla Thunderbird a default mail and news client, add these registry entries:

Note: Make sure to change the path MOZILL~2 to MOZILL~1 if you have installed Thunderbird before Firefox or any other Mozilla product. (check on the command line by typing "cd %programfiles%\MOZILL~2")

REGEDIT4

[HKEY_CLASSES_ROOT\mailto]
@="URL:MailTo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\mailto\DefaultIcon]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE,0"
[HKEY_CLASSES_ROOT\mailto\shell\open\command]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE -compose %1"
[HKEY_CLASSES_ROOT\news]
@="URL:News Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\news\DefaultIcon]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE,0"
[HKEY_CLASSES_ROOT\news\shell\open\command]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE -mail %1"
[HKEY_CLASSES_ROOT\nntp]
@="URL:NNTP Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\nntp\DefaultIcon]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE,0"
[HKEY_CLASSES_ROOT\nntp\shell\open\command]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE -mail %1"
[HKEY_CLASSES_ROOT\snews]
@="URL:Snews Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\snews\DefaultIcon]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE,0"
[HKEY_CLASSES_ROOT\snews\shell\open\command]
@="@ShortProgFiles\\MOZILL~2\\THUNDE~1.EXE -mail %1"
[HKEY_CURRENT_USER\Software\Clients\Mail]
@="Mozilla Thunderbird"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail]
@="Mozilla Thunderbird"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\News]
@="Mozilla Thunderbird"

To register it with WPKG, save it as thunderbird.reg, and add these entries to your Thunderbird WPKG item:

  <install cmd='regedit /s %SOFTWARE%\Thunderbird\thunderbird.reg' />
  
  <upgrade cmd='regedit /s %SOFTWARE%\Thunderbird\thunderbird.reg' />

Alternatively, you can use this jscript file to use full path names, and now it works with 64 bits variable:

var WshShell = WScript.CreateObject("WScript.Shell");
var key;
var value;
var programfiles;
if (WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") == "AMD64") 
	programfiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%");
else
	programfiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles%")
 
key = "HKEY_CLASSES_ROOT\\mailto\\";
value = "URL:MailTo Protocol";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\mailto\\URL Protocol";
value = "";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\mailto\\defaultIcon\\";
value = programfiles + "\\Mozilla Thunderbird\Thunderbird.exe,0";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\mailto\\shell\\open\\command\\";
value = programfiles + "\\Mozilla Thunderbird\\Thunderbird.exe -compose %1";
WshShell.RegWrite(key, value, "REG_SZ");
 
 
key = "HKEY_CLASSES_ROOT\\news\\";
value = "URL:News Protocol";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\news\\URL Protocol";
value = "";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\news\\defaultIcon\\";
value = programfiles + "\\Mozilla Thunderbird\Thunderbird.exe,0";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\news\\shell\\open\\command\\";
value = programfiles + "\\Mozilla Thunderbird\\Thunderbird.exe -mail %1";
WshShell.RegWrite(key, value, "REG_SZ");
 
 
key = "HKEY_CLASSES_ROOT\\nntp\\";
value = "URL:NNTP Protocol";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\nntp\\URL Protocol";
value = "";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\nntp\\defaultIcon\\";
value = programfiles + "\\Mozilla Thunderbird\Thunderbird.exe,0";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\nntp\\shell\\open\\command\\";
value = programfiles + "\\Mozilla Thunderbird\\Thunderbird.exe -mail %1";
WshShell.RegWrite(key, value, "REG_SZ");
 
 
key = "HKEY_CLASSES_ROOT\\snews\\";
value = "URL:Snews Protocol";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\snews\\URL Protocol";
value = "";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\snews\\defaultIcon\\";
value = programfiles + "\\Mozilla Thunderbird\Thunderbird.exe,0";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_CLASSES_ROOT\\snews\\shell\\open\\command\\";
value = programfiles + "\\Mozilla Thunderbird\\Thunderbird.exe -mail %1";
WshShell.RegWrite(key, value, "REG_SZ");
 
 
key = "HKEY_CURRENT_USER\\Software\\Clients\\Mail\\";
value = "Mozilla Thunderbird";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Clients\\Mail\\";
value = "Mozilla Thunderbird";
WshShell.RegWrite(key, value, "REG_SZ");
 
key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Clients\\News\\";
value = "Mozilla Thunderbird";
WshShell.RegWrite(key, value, "REG_SZ");

//Added the following key to make it work from explorer-context menu
key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\mailto\\shell\\open\\command\\";
value = programfiles + "\\Mozilla Thunderbird\\thunderbird.exe -osint -compose %1";
WshShell.RegWrite(key, value, "REG_SZ");


Then add this to your WPKG installer:

  <install cmd='cscript %SOFTWARE%\Thunderbird\setdefault.js' />
  <upgrade cmd='cscript %SOFTWARE%\Thunderbird\setdefault.js' />

Silent installation of Thunderbird extensions[edit]

deploy with thunderbird[edit]

To deploy a extension with thunderbird for the first time (the user does not already have an profile) or if you have an updated version of thunderbird simply place the extensions in the in the application's distribution directory %PROGRAMFILES%\Mozilla Thunderbird\distribution\extensions (source). The extension will be activated after the first start of TB.

If you want to deploy an plugin during installation of TB, but did not like to have it activated automatically, put it into %PROGRAMFILES%\Mozilla Thunderbird\extensions instead. Users find this plugins as installed but deactivated in Thunderbird.

Note: (testing with Thunderbird 10) the filename apparently must be {extension-id}.xpi (to be found within the unzipped .xpi in install.rdf), not the usual filename it downloads as from addons.

Note2: during an installation, Thunderbird deletes all files in dir \distribution and put his own extensions there (i.e. tbtestpilot@labs.mozilla.com.xpi), so copy your files after the installation of TB (use a lower priority).

deploy later[edit]

Version 4 or later[edit]

To install extensions, you have to put them in the %PROGRAMFILES%\Mozilla Thunderbird\extensions directory. Unpacking the xpi is mostly not needed any more (there are some rare exceptions, like dictionaries)

  • To make sure, this is silent and to disable the warning request on startup to allow the installation, you have to set extensions.autoDisableScopes to 11 (see this post)
  • Set extensions.shownSelectionUI to true to disable the addon control wizard, that comes up once when deploy an upgrade an start with an existing profile. (see below on autoconfig how to set system wide user prefs)
<package
    id="lightning"
    name="Lightning extension for Mozilla Thunderbird"
    revision="%version%"
    reboot="false"
    priority="20">
    <variable name="version" value="1.2.1" />
    <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi" />
    <install cmd='cmd /C copy /Y "%SOFTWARE%\lightning\{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi" "%PROGRAMFILES%\Mozilla Thunderbird\extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi"' />
    <upgrade cmd='cmd /C copy /Y "%SOFTWARE%\lightning\{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi" "%PROGRAMFILES%\Mozilla Thunderbird\extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi"' />
    <remove cmd='cmd /C del /F /Q "%PROGRAMFILES\Mozilla Thunderbird\extensions\{e2fda1a4-762b-4020-b5ad-a41df1933103}.xpi"' />
</package>

Versions of Thunderbird before version 4:[edit]

  • Download the extension
  • The .xpi file is a zipped up set of files. Extract the files using any zip unarchiving program
  • Open the file install.rdf that you just extracted
  • In the section labeled 'Description about="urn:mozilla:install-manifest"', and within that the item labeled 'em:id', copy the long ID number, including the curly brackets, for example '{847b3a00-7ab1-11d4-8f02-006008948af5}'
    • Do not use 'em:id' found inside a "em:targetApplication""/em:targetApplication" block! This appears in the lightning.xpi
  • Create a directory using this ID number, including the curly brackets, for example '{847b3a00-7ab1-11d4-8f02-006008948af5}' and put all the extension's files in there
    • (Alternatively you can find the ID number by installing the extension into Thunderbird then looking for it in %PROGRAMFILES%\Mozilla Thunderbird\extensions\, but this is potentially more complicated because you have to look through the install.rdf file of each installed extension to find which extension each relates to)
  • Copy your extension directory to your server
  • The installer then needs to simply copy this directory to %PROGRAMFILES%\Mozilla Thunderbird\extensions. The WPKG installer will look like this:
<package
     id="thunderbird-quicktext"
     name="Quicktext extension"
     revision="1"
     reboot="false"
     priority="0">
    <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\extensions\{8845E3B3-E8FB-40E2-95E9-EC40294818C4}\install.rdf" />
    <install cmd='cmd /C xcopy /Q /I /E /Y "%SOFTWARE%\thunderbird\extensions\quicktext\{8845E3B3-E8FB-40E2-95E9-EC40294818C4}" "%PROGRAMFILES%\Mozilla Thunderbird\extensions\{8845E3B3-E8FB-40E2-95E9-EC40294818C4}"' />
    <upgrade cmd='cmd /C xcopy /Q /I /E /Y "%SOFTWARE%\thunderbird\extensions\quicktext\{8845E3B3-E8FB-40E2-95E9-EC40294818C4}" "%PROGRAMFILES%\Mozilla Thunderbird\extensions\{8845E3B3-E8FB-40E2-95E9-EC40294818C4}"' />
    <remove cmd='cmd /C rmdir /S /Q "%PROGRAMFILES%\Mozilla Thunderbird\extensions\{8845E3B3-E8FB-40E2-95E9-EC40294818C4}"' />
</package>

When Thunderbird is next started, the new extension is detected automatically - you can verify this in Thunderbird using Tools -> Extensions.

Silent installation of dictionaries (spell-checking)[edit]

Thunderbird 17 (32 & 64 bits OS)[edit]

Mozilla Thunderbird keeps its (MySpell) dictionaries in %PROGRAMFILES%\Mozilla Thunderbird\components\myspell\ or %PROGRAMFILES(x86)%\Mozilla Thunderbird\components\myspell\.

By default, it only has an English dictionary (for licensing reasons).

Installing a new dictionary is simple - just copy the dictionary files for a given language to that folder.

Installing a Spanish dictionary[edit]

  • Download a Spanish dictionary from https://addons.mozilla.org/en-US/thunderbird/addon/spanish-spain-dictionary/
  • The file is a .xpi file (a renamed .zip file). Uncompress it using any unzipping program. Inside you'll find .aff and .dic files - these are the core dictionary files. (There is also a .txt file (some info), and a .js file (the installer, used if you install the dictionary using Thunderbird))
  • For this to get work with 32 and 64 bits OS run the script below to opy the core dictionary files into %PROGRAMFILES%\Mozilla Thunderbird\components\myspell\ or %PROGRAMFILES(x86)%\Mozilla Thunderbird\components\myspell\.
  • The WPKG installer to install this dictionary into Thunderbird should look like this:
<package
     id="thunderbird-spanish-dic"
     name="Español para Thunderbird"
     revision="1"
     reboot="false"
     priority="0">
 
     <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.aff" />
     <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.dic" />
     <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.txt" />
 
     <install cmd='cscript "%SOFTWARE%\thunderbird\extensions\dictionaries\es-ES.js" install' />
 
     <upgrade cmd='cscript "%SOFTWARE%\thunderbird\extensions\dictionaries\es-ES.js" install' />
 
     <remove cmd='cscript "%SOFTWARE%\thunderbird\extensions\dictionaries\es-ES.js" remove' />
</package>


  • And the script to verifiy version of OS and copy the dictionaries should look like this:


var WshShell = WScript.CreateObject("WScript.Shell");
var programfiles;
var option;
var software;
software = WshShell.ExpandEnvironmentStrings("%SOFTWARE%")

if (WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%") == "AMD64") 
	programfiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%");
else
	programfiles = WshShell.ExpandEnvironmentStrings("%ProgramFiles%")

option = WScript.Arguments.Item(0)

switch (option)
{
	case "install": 
		WshShell.exec('xcopy /Q /I /E /Y "' + software + '\\thunderbird\\extensions\\dictionaries\\es-ES.aff" "' + programfiles + '\\Mozilla Thunderbird\\components\\myspell\\"');
		WshShell.exec('xcopy /Q /I /E /Y "' + software + '\\thunderbird\\extensions\\dictionaries\\es-ES.dic" "' + programfiles + '\\Mozilla Thunderbird\\components\\myspell\\"');
	break;
	case "remove": 
		WshShell.exec('cmd /C del /Q "' + programfiles + '\\Mozilla Thunderbird\\components\\myspell\\es-ES.aff"');
		WshShell.exec('cmd /C del /Q "' + programfiles + '\\Mozilla Thunderbird\\components\\myspell\\es-ES.dic"');
	break;
	default : 
	;
}

Thunderbird 1.5[edit]

Mozilla Thunderbird keeps its (MySpell) dictionaries in %PROGRAMFILES%\Mozilla Thunderbird\components\myspell\.

By default, it only has an English dictionary (for licensing reasons).

Installing a new dictionary is simple - just copy the dictionary files for a given language to that folder.

Installing a German dictionary[edit]

  • Download a German dictionary from http://www.thunderbird-mail.de/hilfe/dokumentation1.5/allg_rechtschreibung.php
  • The file is a .xpi file (a renamed .zip file). Uncompress it using any unzipping program. Inside you'll find .aff and .dic files - these are the core dictionary files. (There is also a .txt file (some info), and a .js file (the installer, used if you install the dictionary using Thunderbird))
  • Copy the core dictionary files into %PROGRAMFILES%\Mozilla Thunderbird\components\myspell\.
  • The WPKG installer to install this dictionary into Thunderbird should look like this:
<package
     id="thunderbird-woerterbuch"
     name="Woerterbuch fuer Thunderbird"
     revision="1"
     reboot="false"
     priority="0">
 
     <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.aff" />
     <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.dic" />
     <check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.txt" />
 
     <install cmd='cmd /C xcopy /Q /I /E /Y "%SOFTWARE%\thunderbird\extensions\woerterbuch\*" "%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\"' />
 
     <upgrade cmd='cmd /C xcopy /Q /I /E /Y "%SOFTWARE%\thunderbird\extensions\woerterbuch\*" "%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\"' />
 
     <remove cmd='cmd /C del "%PROGRAMFILES%\Mozilla Thunderbird\components\myspell\Deutsch - neue Rechtschreibung.*"' />
</package>

Thunderbird 2.0[edit]

Thunderbird 2.0 has its dictionaries in %PROGRAMFILES%\Mozilla Thunderbird\dictionaries

<package id="thunderbird-spellcheck-dictionary-en-gb" name="Thunderbird spellchecker dictionary English (GB)" revision="4" reboot="false" priority="3">
<depends package-id="thunderbird"/>
<check type="file" condition="exists" path="%PROGRAMFILES%\Mozilla Thunderbird\dictionaries\en-GB.dic"/>
<install cmd="cmd /c "IF NOT EXIST "%PROGRAMFILES%\Mozilla Thunderbird\dictionaries" mkdir "%PROGRAMFILES%\Mozilla Thunderbird\dictionaries"""/>
<install cmd="cmd /c "copy "%SOFTWARE%\thunderbird-dictionaries\*.*" "%PROGRAMFILES%\Mozilla Thunderbird\dictionaries\"""/>
<upgrade cmd="cmd /c "IF NOT EXIST "%PROGRAMFILES%\Mozilla Thunderbird\dictionaries" mkdir "%PROGRAMFILES%\Mozilla Thunderbird\dictionaries"""/>
<upgrade cmd="cmd /c "copy "%SOFTWARE%\thunderbird-dictionaries\*.*" "%PROGRAMFILES%\Mozilla Thunderbird\dictionaries\"""/>
</package>

Alternatively, download the Thunderbird dictionary (download the right one, i.e. the German dictionary from the official webpage won't work) and install it like this:

thunderbird.exe -install-global-extension "x:\software\deutsches_w_ouml_rterbuch-1.0.1-fx+zm+tb.xpi"

Thunderbird Configuration[edit]

Types Of Prefs[edit]

userpref("pref",<value>); - per-user preferences

pref("pref",<value>); - system-wide preferences that can be over-ridden by users

lockpref("pref",<value>); - system-wide preferences that cannot be over-ridden by users


Methods Of Applying Prefs[edit]

Per-person[edit]

Use a prefs file in the user's profile directory. You shouldn't edit prefs.js, as that can be overwritten by Thunderbird, instead create and use user.js as that will never be altered by Thunderbird itself. Use the syntax userpref("pref",<value>); here.

System-wide[edit]

File in %PROGRAMFILES%\Mozilla thunderbird\defaults\pref\ directory[edit]

Thunderbird processes the config files in this directory in reverse alphabetical order. Don't add your prefs to Thunderbird's own pref files as these will be lost on an upgrade of Thunderbird, instead create a file called, for example, all-thunderbird-custom.js, saved in %PROGRAMFILES%\Mozilla thunderbird\defaults\pref\. An example file is:

// Options -> Advanced -> Update -> Automatically check for updates to : Installed Extensions and Themes
pref("extensions.update.enabled", false);

A better way to deploy centralized settings consists of several steps:

1. create a file in %PROGRAMFILES%\Mozilla thunderbird\defaults\pref\ and call it for example custom.js

// ------------|custom.js|-----------------
//
// we could add settings here, but redirect to thunderbird.js in the thunderbird executable folder
//
pref("general.config.obscure_value", 0); //The file could optionally be byteshifted as an optional security feature
pref("general.config.filename", "thunderbird.js");

2. create a file in %PROGRAMFILES%\Mozilla thunderbird\ and call it for example thunderbird.js

// ------------|thunderbird.js|-----------------
//
// we could add settings here, but redirect thunderbird again to a file on the server
//
//put everything in a try/catch
try {

// in this example it is a windows file share. I is also possible to give a real url like http://myserver.net/global_settings.js
lockPref("autoadmin.global_config_url","file://///myserver/mypathto/global_settings.js");
lockPref("autoadmin.refresh_interval", 60); 

// Close the try, and call the catch()
} catch(e) {
  displayError("lockedPref", e);
}

3. create a the file on the server to make centralized settings and call it as example global_settings.js In this file you can change all settings in Thunderbird including autoconfiguration of a mail account. (see below) You can use:

pref to make settings which are set after each start and are changable by the user during runtime.

defaultPref to make settings which can be changed by the user permanently and

lockPref to make settings which can't be changed by the user at all.

Take care on upper and lower case in all pref commandes!

Autoconfig Method 1[edit]

See: http://mit.edu/~thunderbird/www/maintainers/autoconfig.html

Example thunderbird.js with automatically assigned values from ldap.

//put everything in a try/catch
try {
 
// 1) env variables
if(getenv("USER") != "") {
   // *NIX settings
   var env_user    = getenv("USER");
   var env_home    = getenv("HOME");
 } else {
   // Windows settings
   var env_user    = getenv("USERNAME");
   var env_home    = getenv("HOMEPATH");
 }
  var env_mozdebug= getenv("MOZILLA_DEBUG");
 
 
// 2) set default general preferences

//Account
defaultPref("mail.identity.id1.draft_folder", "imap://" + env_user + "@imap.url/Drafts");
defaultPref("mail.identity.id1.fcc_folder", "imap://" + env_user + "@imap.url/Sent");

//Junk
defaultPref("mail.server.server2.spamActionTargetAccount", "imap://" + env_user + "@imap.url");
defaultPref("mail.server.server2.spamActionTargetFolder", "mailbox://" + env_user + "@imap.url/Junk");

//SMTP
defaultPref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap.url/Templates");

 
//SMTP general
lockPref("mail.smtpserver.smtp1.hostname", "smtp.url");
lockPref("mail.smtpserver.smtp1.port", 25);

 
//General
defaultPref("network.proxy.autoconfig_url", "http://proxy.url/proxy.pac");
defaultPref("network.proxy.type", 2);

 
/* 3) define here (because if set after "4)" below it doesn't work !) processLDAPValues which is eventually called by getLDAPAttributes() just below,
 check getLDAPAttributes() code from $MOZILLA_HOME/defaults/autoconfig/prefcalls.js to see the inside call to "user defined" processLDAPValues
*/
function processLDAPValues (values) {
 if(values) {
      // set the global var with the values returned from the LDAP query
      ldap_values = values;
    var uid = getLDAPValue ( values ,"uid" );
    var cn = getLDAPValue ( values ,"cn" );
    var mail = getLDAPValue ( values ,"mail" );
    var URL =  getLDAPValue ( values ,"labeledURI" );
 
// Those ldap variables are only available is this processLDAPValues context !
// so we set the preferences that need them here .
defaultPref("mail.identity.id1.useremail", mail);
defaultPref("mail.server.server2.name", mail );
defaultPref("mail.identity.id1.fullName", cn );
//Debug with popup error messages doesn't work anymore :-( !!
var env_mozdebug= getenv("MOZILLA_DEBUG");
if (env_mozdebug) {displayError("NO ERROR , just a debug, cn =" + cn + " and mail = " + mail ); }
    }
  }
// 4) Call Ldap servers to get Ldap Attributes (mail & cn) , this will finally call processLDAPValues , "3)" just above.
  getLDAPAttributes("ldap.url","ou=people,o=Comapny","uid=" + env_user,"uid,cn,mail,labeledURI");
 
// Close the try, and call the catch()
} catch(e) {
  displayError("lockedPref", e);
}

Autoconfig Method 2 (used with Active Directory)[edit]

Since method 1 did not work for me, even after I changed the attribute names, I found an other example. I use SSL here, so if you don't remove the SSL-part. It is generally a good idea to configure a client manually and then look inside about:config for the settings.

// ---------------|global-settings.js|--------------------
//
// Note: for accessing the Active Directory of Windows Server later than 2000
// it is necessary to allow anonymous read access. Please see
// (German) http://interop.blog.de/2010/02/13/kapitel-1-ldap-anfragen-linux-ad-8001564/ 
// or search the net how to do it. If it is not possible to give access to anonymous,
// you have to enable this function first, please see
// http://technet.microsoft.com/de-de/library/cc816788(WS.10).aspx
//
//
//
//put everything in a try/catch
try {

var userInfo = new Object();  // This will hold LDAP results
 
userInfo.envUser = getenv("USERNAME");   // USERNAME
userInfo.envHome = getenv("HOME");       // User home directory
 
var ldapHost = "192.168.10.10"; // change it to your server
var ldapBase = "ou=mydomain,dc=mytree,dc=local"; // change it to your domain-tree
 
if( userInfo.envUser )
{  var ldapFilter = "sAMAccountName=" + userInfo.envUser;  }
else
{  throw("Couldn't get UID from the environment");  }

// I need the following function to use german umlauts in the AD, don't know why it does not work without it since AD should already send in utf8
function utf8_encode ( string ) {  
    // Encodes an ISO-8859-1 string to UTF-8    
    //   
    // version: 812.316  
    // discuss at: http://phpjs.org/functions/utf8_encode  
    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)  
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)  
    // +   improved by: sowberry  
    // +    tweaked by: Jack  
    // +   bugfixed by: Onno Marsman  
    // +   improved by: Yves Sucaet  
    // +   bugfixed by: Onno Marsman  
    // *     example 1: utf8_encode('Tom van Mikes');  
    // *     returns 1: 'Tom van Mikes'  
    string = (string+'').replace(/\r\n/g, "\n").replace(/\r/g, "\n");  
  
    var utftext = "";  
    var start, end;  
    var stringl = 0;  
  
    start = end = 0;  
    stringl = string.length;  
    for (var n = 0; n < stringl; n++) {  
        var c1 = string.charCodeAt(n);  
        var enc = null;  
  
        if (c1 < 128) {  
            end++;  
        } else if((c1 > 127) && (c1 < 2048)) {  
            enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128);  
        } else {  
            enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128);  
        }  
        if (enc != null) {  
            if (end > start) {  
                utftext += string.substring(start, end);  
            }  
            utftext += enc;  
            start = end = n+1;  
        }  
    }  
  
    if (end > start) {  
        utftext += string.substring(start, string.length);  
    }  
  
    return utftext;  
}  

// LDAP attributes to retrieve from the server
var ldapAttrs = new Array( "cn", "displayName", "mail", "sAMAccountName", "streetAddress", "postalCode", "l", "telephoneNumber", "facsimileTelephoneNumber", "wWWHomePage", "department" );

// Define how to process LDAP results before we make the call
function processLDAPValues(queryResults)
{  if( queryResults )
   {  // Build the userInfo object for later use
      for( var attr in ldapAttrs )
      {  userInfo[ ldapAttrs[attr] ] = utf8_encode(getLDAPValue( queryResults, ldapAttrs[attr] ));  } //Results from AD did not come as utf-8 so they have to get converted before use!
   } else
   {  throw( "No LDAP results" );  }
}

// Call upon LDAP for the values in ldapAttrs array, 
// Uses the previous processLDAPValues()
getLDAPAttributes( ldapHost, ldapBase, ldapFilter, ldapAttrs.join(",") );

// create account
// see also http://blog.deanandadie.net/2010/06/easy-thunderbird-account-management-using-mcd/
// Identity
lockPref("mail.identity.id1.fullName", userInfo.cn );
defaultPref("mail.identity.id1.smtpServer", "smtp1" );
lockPref("mail.identity.id1.useremail", userInfo.mail );
lockPref("mail.identity.id1.organization", "My organisation name" );
defaultPref("mail.identity.id1.stationery_folder", "imap://" + encodeURIComponent(userInfo.mail) + "@myimapurl.de/Templates");
defaultPref("mail.identity.id1.draft_folder", "imap://" + encodeURIComponent(userInfo.mail) + "@myimapurl.de/Drafts" );
defaultPref("mail.identity.id1.drafts_folder_picker_mode", "0" );
defaultPref("mail.identity.id1.archive_enabled", false );
defaultPref("mail.identity.id1.fcc_folder", "imap://" + encodeURIComponent(userInfo.mail) + "@myimapurl.de/Ausgangskopie" ); 
lockPref("mail.identity.id1.htmlSigText", "with regards, " + userInfo.cn + "\r\n\" + userInfo.displayName + "\r\nTelefon " + userInfo.telephoneNumber + "   Fax " + 
userInfo.facsimileTelephoneNumber + "\r\nMail: " + userInfo.mail + "\r\n\"  userInfo.department + "\r\n" + userInfo.streetAddress + "   " + userInfo.postalCode + 
" " + userInfo.l + "\r\n\" + userInfo.wWWHomePage );

// IMAP server settings
defaultPref("mail.server.server1.hostname", "myimapurl.de" );
defaultPref("mail.server.server1.name", userInfo.sAMAccountName );
defaultPref("mail.server.server1.port", 993 );
defaultPref("mail.server.server1.socketType", 3 );
defaultPref("mail.server.server1.type", "imap" );
defaultPref("mail.server.server1.userName", userInfo.mail );
defaultPref("mail.server.server1.using_subscription", false ); //show all folder not only subscribed ones 
defaultPref("mail.server.server1.spamActionTargetAccount", "imap://" + encodeURIComponent(userInfo.mail) + "@myimapurl.de" );
defaultPref("mail.server.server1.spamActionTargetFolder", "mailbox://" + encodeURIComponent(userInfo.mail) + "@myimapurl.de/Junk" );

// SMTP server settings
defaultPref("mail.smtpserver.smtp1.authMethod", 3 );
defaultPref("mail.smtpserver.smtp1.description", "my mailserver" );
defaultPref("mail.smtpserver.smtp1.hostname", "myimapurl.de" );
defaultPref("mail.smtpserver.smtp1.port", 465 );
defaultPref("mail.smtpserver.smtp1.try_ssl", 3 );
defaultPref("mail.smtpserver.smtp1.username", userInfo.mail );

// Glue it all together
defaultPref("mail.account.account1.identities", "id1" );
defaultPref("mail.account.account1.server", "server1" );
defaultPref("mail.accountmanager.accounts", "account1" );
defaultPref("mail.accountmanager.defaultaccount", "account1" );
defaultPref("mail.smtp.defaultserver", "smtp1" );
defaultPref("mail.smtpservers", "smtp1" );

// Configure the Users Directory as LDAP from AD
defaultPref("ldap_2.servers.intern.auth.dn", "");
defaultPref("ldap_2.servers.intern.description", "addresses" );
defaultPref("ldap_2.servers.intern.uri", "ldap://192.168.10.10/dc=mydomain,dc=local??sub?(mail=*)" );
// defaultPref("ldap_2.servers.intern.filename", "ldap.mab" );

// Set the default ldap auto completion to the Example Directory
defaultPref("ldap_2.autoComplete.directoryServer", "ldap_2.servers.intern");
defaultPref("ldap_2.autoComplete.useDirectory", true);

// Options -> Advanced -> Update -> Automatically check for updates to : Installed Extensions and Themes
lockPref("extensions.update.enabled", false);
lockPref("extensions.update.autoUpdateDefault", false);

// Options -> Advanced -> Update -> Automatically check for updates to : Thunderbird
pref("app.update.enabled", false);
// Options -> Advanced -> Update -> Automatically check for updates to : Search Engines
pref("browser.search.update", false);

// stops the request to send performance data from displaying
pref("toolkit.telemetry.rejected", true);
// stops the request to send performance data from displaying - old version
pref("toolkit.telemetry.prompted", true);

// To prevent the "Know Your Rights" info bar at the bottom of the application, use: 
pref("mail.rights.version", 1);

// To prevent the Migration Assistant and the What's New page from showing after upgrades, use: 
pref("mail.ui.show.migration.on.upgrade", false);
pref("app.update.showInstalledUI", false);
pref("browser.startup.homepage_override.mstone", "ignore");
pref("mailnews.start_page_override.mstone", "ignore");

pref("mail.fixed_width_messages", false);
pref("mailnews.display.html_as", 3);
lockPref("mailnews.start_page.url", ""); // enter an alternativ start url

//I was not able to enable extensions by default, so the below did not work
//defaultPref("extensions.enabledAddons", "de-DE@dictionaries.addons.mozilla.org:2.0.2" );

// but it is possible to make some settings for extensions once they are enabled manually by the user:
// defaultPref("foldersize.file_too_big.mb", 200 ); // this is an example

// these settings force Thunderbird to make an IMAP action immediately. This is interesting if there are several clients working on the same mailaccount. normally Thunderbird would make some actions during finishing.
// pref(“mail.imap.expunge_after_delete”, true);
// pref(“mail.imap.expunge_option”, 1);

//user_pref("mailnews.localizedRe", "AW,Aw,Antwort"); //http://www.thunderbird-mail.de/wiki/FAQ:Aw_statt_Re
} catch(e) {
  displayError("global_settings.js", e);
}

--Konus 09:38, 1 February 2012 (CET)

Prefs[edit]

Disable Auto Update[edit]

// Options -> Advanced -> Update -> Automatically check for updates to : Installed Extensions and Themes
pref("extensions.update.enabled", false);

// Options -> Advanced -> Update -> Automatically check for updates to : Thunderbird
pref("app.update.enabled", false);

// Options -> Advanced -> Update -> Automatically check for updates to : Search Engines
pref("browser.search.update", false);

See the whole "HowTO prevent Autoupdate on Firefox / Thunderbird" thread: http://lists.wpkg.org/pipermail/wpkg-users/2007-February/001207.html

See bug [2].


Disable Migration Assistant and What's New page[edit]

To prevent the Migration Assistant and the What's New page from showing after upgrades, use:

pref("mail.ui.show.migration.on.upgrade", false);
pref("app.update.showInstalledUI", false);
pref("browser.startup.homepage_override.mstone", "ignore");
pref("mailnews.start_page_override.mstone", "ignore");

Disable Know Your Rights[edit]

To prevent the "Know Your Rights" info bar at the bottom of the application, use:

pref("mail.rights.version", 1);

Disable 'Auto-sync' and 'Work Offline'[edit]

Tame Thunderbird 3.0.5 or 3.1.0 so that it doesn't automatically sync IMAP mail to a person's workstation in an organisation because they have roaming user profiles on Windows that would result in C: partitions filling up. There is the old 'work offline' and the new 'auto-sync'. We want neither. Thunderbird's IMAP sync feature gives minimal improvement for a lot of pain.

References:


  • Don't 'keep messages for this account on this computer' (a 'work offline' setting)

GUI: 'Synchronisation & Storage -> Message Synchronising -> [] keep messages for this account on this computer'

Various prefs relevant to this: mail.server.default.offline_download (on by default, unless specifically turned off by the use of mail.server.serverX.offline_download)

Don't confuse this with 'auto-sync, this just allows them to be downloaded when go offline or close Thunderbird. Auto-sync bypasses this setting like one big version equivalent to this.

Controls whether or not newly created folders get flagged for downloading offline [TB 3.0.0 - 3.0.4]; additionally in TB 3.0.5+, setting to "false" prior to first run of TB 3 will prevent the IMAP folders from being set to offline download (which they would otherwise have been by default)

You need to turn this off _before_ the migration from Thunderbird 2 to 3.0.5+ else auto-sync will be enabled upon migration. In 3.0.0 - 3.0.4 auto-sync would be enabled anyway.

pref("mail.server.default.offline_download", false);


  • Don't 'Synchronize all messages locally regardless of age' (an 'auto-sync' setting)

GUI: 'Synchronisation & Storage -> Disk Space -> Synchronize all messages locally regardless of age - off'

Various prefs relevant to this: mail.server.default.autosync_offline_stores - false

mail.server.serverX.autosync_offline_stores - false

? Also there should be no mail.server.serverX.autosync_offline_stores=true ?

If the above setting is made, folder property of offline-use=on/off becomes irrelevant to auto-sync because auto-sync is disabled, and the offline-use=on/off is used for download at "Work Offline" only.

This ignores whether the folder is configured as an offline folder or not.

See http://kb.mozillazine.org/Offline_folders#AutoSync

pref("mail.server.default.autosync_offline_stores", false);


  • 'Synchronise the most recent [1] [Days]' (a 'work offline' setting)

GUI: 'Synchronisation & Storage -> Disk Space -> (*) Synchronise the most recent [1] [Days]'

pref("mail.server.default.autosync_max_age_days", 1);


  • 'Don't download messages larger than 50KB' (a 'work offline' setting)

GUI: Synchronisation & Storage -> Disk Space -> [*] Don't download messages larger than 50KB

Various prefs relevant to this:

mail.server.default.limit_offline_message_size - true (defaults to 50KB)

mail.server.serverX.limit_offline_message_size - true (defaults to 50KB)

mail.server.default.max_size - XXX

mail.server.serverX.max_size - XXX

pref("mail.server.default.limit_offline_message_size", true);


  • Disable the Migration Assistant

Prevents users being asked if they want to enable auto-sync. Available in Thunderbird 3.1 and onwards. We could lock this pref using lockpref, which is an option that should be considered, but that would prevent the option from _ever_ being used and there might be an occasional sane situation in which to use it, for example roaming users with laptops.

pref("mail.ui.show.migration.on.upgrade", false);