65
edits
Changes
→Methods Of Applying Prefs: heavy rewrite
====File in %PROGRAMFILES%\Mozilla thunderbird\defaults\pref\ directory====
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\. These preferences can be over-ridden by users. An example file is:
<source lang="xml">
</source>
A better way to deploy centralized settings consists of several steps:
</source>
<source lang="javascript">
</source>
Example thunderbird.js with automatically assigned values from ldap.
</source>
===== Autoconfig Method 2 (use for used with Active Directory) =====
Since method 1 did not work for me, even after I changed the attribute names, I found an other [http://blog.deanandadie.net/2010/04/ldap-queries-in-mission-control-desktop/ 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.
<source lang="javascript">
// ---------------|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//
//
//
userInfo.envHome = getenv("HOME"); // User home directory
var ldapHost = "example192.com168.10.10";// change it to your servervar ldapBase = "ou=mydomain,dc=companymytree,dc=local";// change it to your domain-tree
if( 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" ); // add more attributes here, if needed"streetAddress", "postalCode", "l", "telephoneNumber", "facsimileTelephoneNumber", "wWWHomePage", "department" );
// Define how to process LDAP results before we make the call
{ // 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" ); }
// see also http://blog.deanandadie.net/2010/06/easy-thunderbird-account-management-using-mcd/
// Identity
defaultPref("mail.identity.id1.smtpServer", "smtp1" );
// IMAP server settings
defaultPref("mail.server.server1.hostname", "myImapmyimapurl.server.comde" );defaultPref("mail.server.server1.name", userInfo.mail 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 Company Namemailserver" );defaultPref("mail.smtpserver.smtp1.hostname", "mySmtpmyimapurl.server.comde" );
defaultPref("mail.smtpserver.smtp1.port", 465 );
defaultPref("mail.smtpserver.smtp1.try_ssl", 3 );
defaultPref("mail.smtpservers", "smtp1" );
// Close Configure the tryUsers Directory as LDAP from ADdefaultPref("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 DirectorydefaultPref("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 call ThemeslockPref("extensions.update.enabled", false);lockPref("extensions.update.autoUpdateDefault", false); // Options -> Advanced -> Update -> Automatically check for updates to : Thunderbirdpref("app.update.enabled", false);// Options -> Advanced -> Update -> Automatically check for updates to : Search Enginespref("browser.search.update", false); // stops the catchrequest to send performance data from displayingpref("toolkit.telemetry.rejected", true);// stops the request to send performance data from displaying - old versionpref("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("lockedPrefglobal_settings.js", e);
}
</source>
--[[User:Konus|Konus]] 1609:1938, 19 January 1 February 2012 (CET)
== Prefs ==