[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: basic ldapsearch problem

Pierangelo Masarati wrote:

Thanks for reply.
I think there's something wrong with my english, beacuse it's not quite
the thing I asked for :-)

My Sendmail also works. I mean it routes e-mail everywhere I want it to.
That's not problem, and I don't have to switch to Exim for now I think

So what's the problem ?

let's say that each entry looks like this:
dn: uid=randomuid,dc=domain,dc=pl
objectClass: inetLocalMailRecipient
mailLocalAddress: name.surname@domain.pl
mailLocalAddress: name.surname@domain.com.pl
mailHost: destination.mailhost.pl

And I have 1000 of these entries in my directory.

Now let's say I want to find if there's alredy an entry with
uid=sampleuid1. Or I want to find all accounts (users) with name set to

Notice that these entries are not inetOrgPerson entries (or similar), so
I don't have separate cn,sn, givenName attributes.

Can I make such search ?
If not, why can't I ?  What are the limits in specifying a filter for
ldapsearch command ?

Why can't I set search filter to mailLocalAddres=John* ?

Because mailLocalAddress (and mailRoutingAddress as well) do not support substring filtering, as it is specified in their definition (attributeType in the .schema file) which does not have any SUBSTR matching rule).

Moreover, inetLocalMailRecipient is not a structural
objectclass; since each entry must have one and only one
structural objectclass you should add a person, or
inetOrgPerson, to your entries, with cn, sn, mail and so
that in turn support substrings matching. This rule about
structural objectclasses is strictly enforced in 2.1 so
in case you upgrade you'll likely be in trouble and you
must be prepared to fix all your data.

Thanks a lot. At least I know what I have to read about now :-).

And thanks for the warning about the structural objectclasses.
I was thinking about adding inetOrgPerson class to all the entries.
Now I know I have to do this :-)

Regards Kuba