Last Comment Bug 302096 - Thunderbird does not have AutoConfig LDAP support enabled
: Thunderbird does not have AutoConfig LDAP support enabled
Status: VERIFIED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: Build Config (show other bugs)
: unspecified
: All All
: -- major with 1 vote (vote)
: Thunderbird1.1
Assigned To: Scott MacGregor
: Chase Phillips
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-25 14:30 PDT by Gregg Berkholtz
Modified: 2007-03-21 06:53 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
[checked in]make CLID different from IID for nsILdapSyncQuery (774 bytes, patch)
2005-07-25 18:45 PDT, Scott MacGregor
mozilla: superreview+
Details | Diff | Splinter Review
Error Dialog Box (23.00 KB, image/jpeg)
2005-07-27 14:04 PDT, Gregg Berkholtz
no flags Details
the fix (559 bytes, patch)
2005-07-27 14:50 PDT, Scott MacGregor
no flags Details | Diff | Splinter Review

Description Gregg Berkholtz 2005-07-25 14:30:57 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050517 Firefox/1.0.4 (Debian package 1.0.4-2)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050517 Firefox/1.0.4 (Debian package 1.0.4-2)

Thunderbird does not have AutoConfig (Mission Control) LDAP support compiled
into the standard builds. This is a critical feature necessary for large-scale
centrally managed Thunderbird deployments. As it allows us to preconfigure and
deploy Thunderbird settings for thousands of users, while utilizing their
existing LDAP values.

In FireFox, to enable LDAP AutoConfig it's necessary to remove --disable-ldap
from .mozconfig. I dont know what the equivalent setting is for Thunderbird -
still researching this...

Is it at all possible to see this support in Thunderbird 1.1? As there are a
number of large-scale deployemnts taking place in educational and corporate
enviroments which would greatly benefit for such a addition. If LDAP AutoConfig
support is not in TB1.1 then some educational enviroments, already preping their
system builds for the coming school year, appear be holding back TB1.1 deployments.

See the discussion in Bug 225288 for further information.


Reproducible: Always

Steps to Reproduce:
Comment 1 Scott MacGregor 2005-07-25 14:50:47 PDT
1.1 builds with ldap by default and autoconfig. So if it works in firefox it
should work here too. I'm not sure what files are specific to ldap auto config
as opposed to regular auto config. Maybe we just aren't packaging up a file for
that. 
Comment 2 Gregg Berkholtz 2005-07-25 14:57:04 PDT
Maybe you can help point out what we're doing wrong then.

From bug 225288 comment #19:
 I also confirm that latest nightly build doesn't support ldap
TB 1.0+ (20050721) -> yesterday build .
I also get the error while calling getLdapAttributes() from prefcall.js, error :

Netscape.cfg/AutoConfig failed. Please contact your System Administator
 Error: getLDAPAttibutes failed: [Exception... "Component returned failure code:
0x80570018 (NS_ERROR_XPC_BAD_IID)[nsIJSCID.createInstance]" nsresult:
"0x80570018 (NS_ERROR_XPC_BAD_IID)" Location: "JS frame :: file:///c:\Program
Files\Mozilla Thunderbird\defaults\autoconfig\prefcalls.js :: getLDAPAttributes
:: line 176" data:no]

however, other autoconf settings do work , but we cannot set pref from ldap
values which is very anoying for autoconfiguring email preferences ... :-( 

I also tested the latest stable TB 1.0.6 (20050716), I was positively surprised
to see the presence of the autoconfig sub-directory, which mean that is is now
ship with --enable-extensions=pref , good !, unfortunatly, I don't know why but
TB 1.0.6 complety ingore autoconfig, although I did put in pref/all.js :
//autoconfig
pref("general.config.obscure_value", 0); // for MCD .cfg files
pref('general.config.filename', 'thunderbird.cfg'); // for MCD .cfg files
and put thunderbird.cfg in the root directory of TB, nothing is read :-( .

I'am afraid to be forced to use again mozilla (probably 1.7.10 for which
everything works fine) instead of firefox/thinderbird for our next september
academic year .
Thanks to let me know if there's a possible solution before .
Comment 3 Scott MacGregor 2005-07-25 14:59:04 PDT
as I said before, 1.0.x does not support auto config by default. 1.0.x releases
are security releases only and do not contain our new feature work at all This
is a new feature in the upcoming 1.1 release....See the bug you are cc'ed on
which was marked FIXED for 1.1 to enable this.
Comment 4 Gregg Berkholtz 2005-07-25 15:22:18 PDT
My apologies, maybe I'm misunderstanding something, but I'm testing with TB
1.1alpha2 (1.0+ V20050712:  
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/1.1a2/win32/en-US/Thunderbird%20Setup%201.1a2.exe)
and am still encountering the LDAP AutoConfig error noted in 225288 and in
comment #2 here. I thought 1.1a2 would closely reflect what to expect in
1.1final, is that not the case and/or should I be testing LDAP AutoConfig
support elsewhere?
Comment 5 Scott MacGregor 2005-07-25 15:24:08 PDT
You said:

"I also tested the latest stable TB 1.0.6 (20050716), ... unfortunatly, I don't
know why but
TB 1.0.6 complety ingore autoconfig, although I did put in pref/all.js :
//autoconfig
pref("general.config

This is not on in 1.0.6, it is on in 1.1 builds.
Comment 6 Gregg Berkholtz 2005-07-25 15:38:57 PDT
Alright, I see where you get getting the 1.0.6 assumption. Though as indicated
by the text "...From bug 225288 comment #19:..." that was actually a copy/paste
from someone else's posting to Bug 225288. I apologize for that confusion, I'll
be more clear when copy/pasting in the future.

In any event, at this point in time I'm testing with TB 1.1 alpha2 and am still
encountering the LDAP AutoConfig error. Is the 1.1alpha2 binary the correct
place to check for 1.1final support, or is there somewhere else I should be
downloading a Thunderbird build to test TB 1.1 functionality?
Comment 7 Scott MacGregor 2005-07-25 18:42:09 PDT
Sorry Greg, I misread your c+p as you saying because auto config was not part of
1.0.6 you were going back to moz 1.7.10.

Looking.
Comment 8 Scott MacGregor 2005-07-25 18:45:06 PDT
Created attachment 190496 [details] [diff] [review]
[checked in]make CLID different from IID for nsILdapSyncQuery

The JS exception posted in this bug report seems to be complaining about a
bogus interface ID. This tells me either we aren't packaging up an xpt file
correctly or there's something wrong with the interface declaration for
nsILDAPSyncQuery which is the interface that seems to generate the bad
interface ID exception.

I did notice that the interface ID for nsILDAPSyncQuery is identical to the
underlying class ID. That doesn't seem right. But then it should fail in
Firefox  (if Fx was built with ldap) too.
Comment 9 David :Bienvenu 2005-07-25 20:42:35 PDT
Comment on attachment 190496 [details] [diff] [review]
[checked in]make CLID different from IID for nsILdapSyncQuery

maybe that would explain it - I'm pretty sure we're building with ldap turned
on...
Comment 10 Scott MacGregor 2005-07-26 12:48:25 PDT
Gregg, can you give tomorrow's 7/27 builds a spin to see if this fixed the
problem or not? Check here tomorrow afternoon:

http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/

and make sure the server time stamp says 7/27 on it. 

thanks
Comment 11 Scott MacGregor 2005-07-27 12:59:00 PDT
Greg, windows and linux builds are now out. Can you tell us if things are
working now?
Comment 12 Gregg Berkholtz 2005-07-27 14:04:20 PDT
Created attachment 190760 [details]
Error Dialog Box
Comment 13 Gregg Berkholtz 2005-07-27 14:05:29 PDT
Looks like I'm getting the same error. This occured even after deleting both
below folders and reconfiguring for autoconfig again:
 c:\program files\Mozilla Thunderbird\
 c:\documents and settings\...\Thunderbird
Comment 14 Scott MacGregor 2005-07-27 14:06:13 PDT
shucks, and help /  about definetly says 20050727?
Comment 15 Gregg Berkholtz 2005-07-27 14:20:21 PDT
Yep: 1.0+ (20050727)

If it helps at all, here's whats going into my autoconfig:

//BEGIN CE prefs 

//put everything in a try/catch
try {

if(getenv("USER") != "") {
   // NIX settings
   var env_user    = getenv("USER");
   var env_home    = getenv("HOME");
 } else {
   // Windows settings
   var env_ldapcn    = getenv("LDAPCN");
 }

function processLDAPValues (values) {
 displayError("Getting somehwere", e); 
 if(values) {
    // set the global var with the values returned from the LDAP query
    var ldap_values = values;
    var ldapUID = getLDAPValue ( values ,"uid" );
    var ldapNAME = getLDAPValue ( values ,"cn" );
    var ldapMAIL = getLDAPValue ( values ,"mail" );
    displayError("" + ldapUID, e); 
lockPref("mail.identity.id1.draft_folder", "imap://ldapUID@imap.domain.com/Drafts");
lockPref("mail.identity.id1.fcc_folder", "imap://ldapUID@imap.domain.com/Sent");
lockPref("mail.identity.id1.fullName", "ldapNAME ");
lockPref("mail.identity.id1.stationery_folder",
"imap://ldapUID@imap.domain.com/Templates");
lockPref("mail.identity.id1.useremail", "ldapMAIL");
lockPref("mail.server.server2.name", "ldapMAIL");
lockPref("mail.server.server2.spamActionTargetAccount",
"imap://ldapUID@imap.domain.com");
lockPref("mail.server.server2.userName", "ldapUID");
lockPref("mail.smtpserver.smtp1.username", "ldapUID");
lockPref("print.print_headerleft", "ldapNAME");
    }
  }
// Call Ldap servers to get Ldap Attributes, this will call processLDAPValues
  getLDAPAttributes("ldap.domain.com","cn=Gregg
Berkholtz,ou=PDX,ou=People,dc=domain,dc=com","objectClass=person","uid,cn,mail");
);

} catch(e) {
  displayError("lockedPref", e);
}
Comment 16 Scott MacGregor 2005-07-27 14:34:32 PDT
Hmm, I'm starting to think this must be a packaging error but i'm not sure what
we are missing.

I did a JS eval on the JS statements which are throwing the exception about a
bad interface ID and they all ran fine:

const nsILDAPURL = Components.interfaces.nsILDAPURL;
const LDAPURLContractID = "@mozilla.org/network/ldap-url;1";
const nsILDAPSyncQuery = Components.interfaces.nsILDAPSyncQuery;
const LDAPSyncQueryContractID = "@mozilla.org/ldapsyncquery;1";
var url = Components.classes[LDAPURLContractID].createInstance(nsILDAPURL);
url.spec = "ldap://" + 'foo' + "/" + 'base' + "?" + 'attrib' + "?sub?" +  'filter*';
var ldapquery = Components.classes[LDAPSyncQueryContractID]
                                  .createInstance(nsILDAPSyncQuery);

that was in a debug build of course.
Comment 17 Scott MacGregor 2005-07-27 14:50:32 PDT
Created attachment 190764 [details] [diff] [review]
the fix

duh

this should fix it
Comment 18 Scott MacGregor 2005-07-27 14:51:19 PDT
marking fixed. try again with the 7/28 builds Greg. I suspect you'll be good to
go now.
Comment 19 Jehan Procaccia 2005-07-28 07:31:16 PDT
I've just tested today with
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/
 -> 20050727 (i don't see a biuil for 28072005 ! )
I confirm that it still doesn't work . Autoconfig alone works fine , but as 
soon as I use ldap queries (getLDAPAttributes) we get the famous
"...getLDAPAttributes
:: line 176" data:no]" error message .
I'am also looking forward for the solution .
If I remember well, I think it worked fine on linux when I recompiled firefox
(1.0.2)  without --desable-ldap, but I don't see the equivalent for thunderbird,
and  I still don't know how to check how thunderbird was compiled (on firefox
there's an about:buildconfig ) .
Thanks .
Comment 20 Gregg Berkholtz 2005-07-28 11:27:32 PDT
Slick! LDAP AutoConfig in TB 1.0+ (20050728) works great now! Thanks!

FYI, I had to remove the quotes around the variables. For example:
  lockPref("mail.server.server2.userName", "ldapUID" );
was changed to
  lockPref("mail.server.server2.userName", ldapUID );

Though any idea how to deal with strings such as:
 lockPref("mail.server.server2.spamActionTargetAccount",
"imap://ldapUID@imap.yoshida.com");
Comment 21 Gregg Berkholtz 2005-07-28 11:33:11 PDT
Nevermind - I answered my own question. The string should read:
 lockPref("mail.server.server2.spamActionTargetAccount", "imap://" + ldapUID +
"@imap.yoshida.com");

Thanks again for the quick responses. I assume we can plan for this support in
TB 1.1final?
Comment 22 Scott MacGregor 2005-07-28 11:47:29 PDT
great, glad it's working now.
Comment 23 Jehan Procaccia 2006-05-17 07:13:28 PDT
Good news :-), I confirme that autoconfig + ldapcalls (getLDAPAttributes) does work in thunderbird 1.5.0.2, both on windows XP and linux fedora core 5 (package thunderbird-1.5-6). thanks for maintaining  that enterprise deployement feature available in futur releases .
however check https://bugzilla.mozilla.org/show_bug.cgi?id=295329 to know how for sure those options are available ? 
Comment 24 Jehan Procaccia 2007-03-21 06:53:43 PDT
Just tested in thunderbird 2 beta 2, still works fine, thanks !
see updated doc on:
http://developer.mozilla.org/en/docs/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig#Thunderbird_2.x_beta_2

Note You need to log in before you can comment on or make changes to this bug.