Subject: Re: CVS commit: pkgsrc/mail/sqwebmail
To: Johnny Lam <jlam@jgrind.org>
From: John Darrow <John.P.Darrow@wheaton.edu>
List: pkgsrc-changes
Date: 01/24/2002 23:21:10
On Thu, Jan 24, 2002 at 05:13:53PM -0800, Johnny Lam wrote:
> On Thu, Jan 24, 2002 at 07:01:44PM -0600, John Darrow wrote:
> > Johnny C. Lam <jlam@netbsd.org> wrote:
> > >Do some editting of the output returned by OpenLDAP's ldapsearch so that
> > >it can be parsed by SqWebMail. SqWebMail expects output to be of the
> > >form
> > > class1=name1
> > > class2=name2
> > > ...
> > >
> > >but the output from ldapsearch seems to be
> > >
> > > class1: name1
> > > class2: name2
> >
> > Try removing the '-L' from the ldapsearch command line. This should
> > give you the form you want, without any sed munching whatsoever.
>
> There is no '-L' in the ldapsearch command line. The only flags that
> sqwebmail passes to ldapsearch are: -[lzDWhpb]. For example, I have
> openldap-2.0.9nb1 installed. When I execute:
>
> ldapsearch -h ldap.bigfoot.com -p 389 -b c=US "(&(sn=Lam)(cn=Johnny))"
>
> I get:
>
> -------------------------------------------------------------------------
> version: 2
>
> #
> # filter: (&(sn=Lam)(cn=Johnny))
> # requesting: ALL
> #
>
> # Lam Johnny, kami48@hotmail.com, US, hotmail.com
> dn: cn="Lam Johnny",mail=kami48@hotmail.com,c=US,o=hotmail.com
> mail: kami48@hotmail.com
> cn: Lam Johnny
> o: hotmail.com
> givenName: Lam
> surname: Johnny
> [...]
> -------------------------------------------------------------------------
Hmmm... under 1.x, the default format was:
$ ldapsearch -h ldap.wheaton.edu -b "o=Wheaton College,c=US" "(cn=*darrow*)" "mail"
cn=John.P.Darrow, o=Wheaton College, c=US
mail=John.P.Darrow@wheaton.edu
Getting the colon-separated (what the man page called "ldif") format
required the '-L' flag:
$ ldapsearch -L -h ldap.wheaton.edu -b "o=Wheaton College,c=US" "(cn=*darrow*)" "mail"
dn: cn=John.P.Darrow, o=Wheaton College, c=US
mail: John.P.Darrow@wheaton.edu
Changing the default format is _not_ a very friendly thing for the
openldap people to do (think about how many scripts are now broken).
And even so, one would think that they'd have provided some way of
getting back the original format. But I don't currently have an
openldap 2.x installation anywhere to test with...
jdarrow
--
John Darrow - Senior Technical Specialist Office: 630/752-5201
Computing Services, Wheaton College, Wheaton, IL 60187 Fax: 630/752-5968
Pager via email: 6303160707@alphapage.airtouch.com Pager: 630/316-0707
Email: John.P.Darrow@wheaton.edu (plain text please, no HTML or proprietary)