ldapsearch mail filter

View: New views
4 Messages — Rating Filter:   Alert me  

ldapsearch mail filter

by Etienne Le Sueur-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to do an ldapsearch with the following filter:

"mail=an_email@address"

The entries may have more than one email address. this filter is only
matching on the first email address.

I would like it to match on any of the addresses the user has added.

Can anyone help with the correct filter? I have tried
"mail~=an_email@address" but that matches multiple entries sometimes.

---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

Parent Message unknown Re: ldapsearch mail filter

by Peter Schober :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Etienne Le Sueur <etienne.lesueur@...> [2008-05-16 09:00]:
> I'm trying to do an ldapsearch with the following filter:
>
> "mail=an_email@address"
>
> The entries may have more than one email address. this filter is only
> matching on the first email address.

How did you come to this conclusion? An LDAP search filter filters the
objects that are being returned, not their attributes and respective
values.

reagrds,
-peter

---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

Parent Message unknown Re: ldapsearch mail filter

by Michael Ströder :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Etienne Le Sueur wrote:
> I'm trying to do an ldapsearch with the following filter:
>
> "mail=an_email@address"
>
> The entries may have more than one email address. this filter is only
> matching on the first email address.

What do you mean by "matching on the first email address"? If the user
entry has multiple e-mail addresses as multiple attribute values in the
attribute 'mail' any of the e-mail address matches in terms of LDAP
matching. So this particular entry is returned as search result with all
value of attribute 'mail'.

But commonly used e-mail clients will only add the "first" e-mail
address (attribute value) to the address list when creating a new
e-mail. Is that what you mean?

Ciao, Michael.

---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.

Parent Message unknown Re: ldapsearch mail filter

by Terry Gardner-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If the entry in question is "cn=example,ou=people,dc=sun,dc=com", and  
that entry contains multiple "mail" attributes, then your filter might  
be '(cn=example)' with a search base of  
'cn=example,ou=people,dc=sun,dc=com' and a search scope of 'base',  
returning the attribute 'mail'. If there is an entry that matches the  
filter, all values of 'mail' will be returned to the LDAP client.

Note that a filter of '(mail=*)' would also work in this case, and  
assuming that the 'mail' attribute was indexed for equality should be  
just as fast.

Also note that this example assumes that the LDAP client knows the RDN  
of the entry. If the LDAP client did not know the RDN of the entry,  
then the client should increase the search scope depth, and widen the  
search base to 'ou=people,dc=sun,dc=com', and change the filter to  
'(mail=*)' or '(cn=*)', or something similar that will allow Directory  
Server to locate the entry(s) desired.

On May 16, 2008, at 3:00 AM, Etienne Le Sueur wrote:

> Hi,
>
> I'm trying to do an ldapsearch with the following filter:
>
> "mail=an_email@address"
>
> The entries may have more than one email address. this filter is only
> matching on the first email address.
>
> I would like it to match on any of the addresses the user has added.
>
> Can anyone help with the correct filter? I have tried
> "mail~=an_email@address" but that matches multiple entries sometimes.
>
> ---
> You are currently subscribed to ldap@... as: [Terry.Gardner@...
> ]
> To unsubscribe send email to ldap-request@... with the word  
> UNSUBSCRIBE as the SUBJECT of the message.

http://blogs.sun.com/terrygardner

"Sometime they'll give a war and nobody will come." - Carl Sandberg




---
You are currently subscribed to ldap@... as: [lists@...]
To unsubscribe send email to ldap-request@... with the word UNSUBSCRIBE as the SUBJECT of the message.
LightInTheBox - Buy quality products at wholesale price