Difference between revisions of "Talk:Thunderbird"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
(Autoconfig with AD (does not work at the moment))
(No difference)

Revision as of 07:27, 18 January 2012

Some Thoughts on Autoconfig with AD

It should be possible to use the Active Directory from a Windows Server as LDAP source. Active Directory of Windows Server 2003 and above do not allow anonymous read access, so you have to allow this first. See http://technet.microsoft.com/de-de/library/cc816788(WS.10).aspx to be able to give Read Access to Anonymous. (or this german post)

I changed the thunderbird.cfg script according to below, but was unable to complete the task:

FIXME

//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 sAMAccountName = getLDAPValue(values ,"sAMAccountName");
    var cn = getLDAPValue(values ,"cn");
    var mail = getLDAPValue(values ,"mail");
 
// 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.server1.name", mail );
defaultPref("mail.identity.id1.fullName", cn );
    }
  }
// 4) Call Ldap servers to get Ldap Attributes (mail & cn) , this will finally call processLDAPValues , "3)" just above.
//  Example: getLDAPAttributes("ldap.url","ou=people,o=Comapny","uid=" + env_user,"uid,cn,mail,labeledURI");
getLDAPAttributes("192.168.1.200:389","dc=domain,dc=local","sAMAccountName=" + env_user,"sAMAccountName,cn,mail");


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

After starting thunderbird, the script gets started but does not get any attributs from LDAP. So unfortunatly this does not work! --Konus 08:27, 18 January 2012 (CET)