Changes

Jump to: navigation, search

Thunderbird

7,015 bytes added, 08:38, 1 February 2012
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:
==== Autoconfig ====1. create a file in %PROGRAMFILES%\Mozilla thunderbird\defaults\pref\ and call it for example '''custom.js'''
See: http:<source lang="javascript">//mit------------|custom.edujs|-----------------/~thunderbird/www/maintainers/autoconfig.html Create a customized text file named we could add settings here, but redirect to thunderbird.js and put it in the thunderbird executable folder://<source lang=pref("dosgeneral.config.obscure_value">, 0); //The file could optionally be byteshifted as an optional security feature'%programfiles%\mozilla thunderbird\pref("general.config.filename", "thunderbird.js'");
</source>
Edit 2. create a file in %programfilesPROGRAMFILES%\mozilla Mozilla thunderbird\greprefs\alland call it for example '''thunderbird.js addding the following values:''' 
<source lang="javascript">
pref// ------------|thunderbird.js|-----------------//// we could add settings here, but redirect thunderbird again to a file on the server////put everything in a try/catchtry { // in this example it is a windows file share. I is also possible to give a real url like http://myserver.net/global_settings.jslockPref("generalautoadmin.config.obscure_valueglobal_config_url", 0"file://///myserver/mypathto/global_settings.js");preflockPref("generalautoadmin.config.filenamerefresh_interval", 60);  // Close the try, and call the catch()} catch(e) { displayError("thunderbird.jslockedPref", e);}
</source>
The 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 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 optionally be byteshifted an optional security feature, using generalchanged by the user permanently and '''lockPref''' to make settings which can't be changed by the user at all.config.obscure_valueIn this file you can change all settings in Thunderbird including autoconfiguration of a mail account.
You can add functionality to the prefs by including javascript within the file==== Autoconfig Method 1 ==== See: http://mit.edu/~thunderbird/www/maintainers/autoconfig.html
===== Method 1 =====
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
defaultPreflockPref("mail.identity.id1.fullName", userInfo.cn );
defaultPref("mail.identity.id1.smtpServer", "smtp1" );
defaultPreflockPref("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", "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 ==
65
edits

Navigation menu