[imp] LDAP on IMP 2.2.7

Brian Helman bhelman@salemstate.edu
Mon, 13 May 2002 17:42:05 -0400


Ok, I know there have been a lot of questions asked about this and this is 
not the most recent version of IMP, but I have been unable to get LDAP 
working through IMP 2.2.7 and I have been unable to get IMP 3.0 to work 
with my IMAP server.  So, IMP 2.2.7 it is and I would really like to get 
LDAP working:

I have installed a duplicate IMP system so I can hack at the configuration 
to my heart's content without worrying about a production box.  It is a RH 
7.2 kernel 2.4.7-10 system.  Here is what test.php3 reports:

Horde Versions
·       Horde: 1.2.7
·       IMP: 2.2.7
PHP Version
·       PHP Version: 4.1.0
·       PHP Major Version: 4
·       PHP Minor Version: 0
·       PHP Version Classification: release
·       You are running a version of PHP4 older than 4.0.3. You need to 
upgrade to at least 4.0.3.
PHP Module Capabilities
·       IMAP Support: Yes
·       LDAP Support: Yes
·       MySQL Support: No
·       PostgreSQL Support: Yes
PHPLIB Configuration
·       track_vars: Yes
·       PHPLIB (is page_open() defined): Yes
·       I am now going to try to create a HordeSession class. If this line 
is the last thing that you see, then you do not have class HordeSession 
defined in the phplib local.inc file. Fix that before proceeding.
·       Created a HordeSession instance successfully.
·       ·       Click here to test PHPLIB for Horde (If this link results 
in "Document Contains No Data" or "Fatal error...", then you probably have 
not defined the HordeSession class in the PHPLIB local.inc file).
Miscellaneous PHP Settings
·       register_globals set to On: Yes
·       magic_quotes_gpc set to Off: Yes
·       magic_quotes_runtime set to Off: Yes

I am just learning how to use LDAP, but I did get it running.  The slapd 
server is running on the same test box as IMP.

Here is the relevant section of the slapd.conf file:
database        ldbm
suffix          "dc=salemstate,dc=edu"
suffix          "o=Salem State College,c=US"
rootdn          "cn=Manager,dc=salemstate,dc=edu"
rootdn          "cn=Manager,o=Salem State College,c=US"

My ldap.php3 file looks like this:
$LDAPServers = array();
$LDAPServers['bigfoot'] = new LDAPServer('bigfoot',
                                          'Bigfoot',
                                          'ldap.bigfoot.com',
                                          '',
                                          'surname',
                                          'cn,mail,sn',
                                          'is,sounds,is_strict,contains,begins,en
ds');
$LDAPServers['salemstate'] = new LDAPServer('salemstate',
                                          'Salem State College',
                                          'lighthouse.salemstate.edu',
                                          'dc=salemstate, dc=edu',
                                          'cn',
                                          'cn',
                                          'contains',
                                          '',''
                                          );

 From the command line, if I type:

ldapsearch -x -b 'dc=salemstate,dc=edu' '(cn=dan*)'

I get:

version: 2

#
# filter: (cn=dan*)
# requesting: ALL
#

# Daniel P McCue, salemstate, edu
dn: cn=Daniel P McCue, dc=salemstate, dc=edu
cn: Daniel P McCue
cn: Daniel McCue
objectClass: person
sn: McCue

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

 From a PC on another IP segment, if I use a Eudora client configured with 
the searchbase as:
dc=salemstate,dc=edu
and the word-wise search filter as:
(cn=*^0*)
Searching "dan" yields:
cn: Daniel P McCue
   : Daniel McCue
sn: McCue

So, as far as I can tell, LDAP is working on the box and accepting 
connections from clients off the box.  HOWEVER, when I try searching from 
the IMP Contact screen I get the "No appropriate entries found." 
message.   I have tried playing around with configurations in the ldap.php3 
file.  I have noticed that, if I make an error in the syntax, the error 
message when I try to query becomes misleading.  Something to the effect of 
"Too many entries, try narrowing search."

Any assistance would be greatly appreciated.

brian helman