Discussion:
[Davmail-users] a succesfull LDAP query
Geert Stappers
2017-01-08 14:38:31 UTC
Permalink
Hello Davmail community,

LDAP is new to me. I do know SQL.

I have no idea how standard LDAP in Davmail is.

What I'm looking for is a succesfull LDAP query.

How to query an e-mail address from Davmail LDAP?

An LDAP query tool is not the problem.
(an advise about it, is welcome)

Problem is the "table name" and the "column name".

In MySQL / Mariadb I would do `show tables` and `describe tblnm`,
then something

select email
from tblnm
where firstname = '%Geert%'


Groeten
Geert Stappers
--
Leven en laten leven
Mickaël Guessant
2017-01-08 20:33:03 UTC
Permalink
Post by Geert Stappers
LDAP is new to me. I do know SQL.
I have no idea how standard LDAP in Davmail is.
What I'm looking for is a succesfull LDAP query.
How to query an e-mail address from Davmail LDAP?
An LDAP query tool is not the problem.
(an advise about it, is welcome)
Problem is the "table name" and the "column name".
In MySQL / Mariadb I would do `show tables` and `describe tblnm`,
then something
select email
from tblnm
where firstname = '%Geert%'
Hi Geert,

table => context => ou=people

email => attribute => mail

% => * => filter: *Geert*

Use any ldap client available, e.g. ldapsearch

Happy new year !
--
Mickael Guessant
mailto:***@free.fr
Geert Stappers
2017-01-09 06:24:44 UTC
Permalink
Post by Geert Stappers
What I'm looking for is a succesfull LDAP query.
How to query an e-mail address from Davmail LDAP?
Problem is the "table name" and the "column name".
In MySQL / Mariadb I would do `show tables` and `describe tblnm`,
} then something like
Post by Geert Stappers
select email
from tblnm
where firstname = '%Geert%'
table => context => ou=people
email => attribute => mail
% => * => filter: *Geert*
Yes, that looks like some of the missing piece
for a succesfull LDAP query.
Use any ldap client available, e.g. ldapsearch
I will play with it, such as adding "dc=domain,dc=tld" and report back.


Groeten
Geert Stappers
--
Leven en laten leven
Geert Stappers
2017-01-12 18:42:00 UTC
Permalink
Post by Geert Stappers
Post by Mickaël Guessant
table => context => ou=people
email => attribute => mail
% => * => filter: *Geert*
Yes, that looks like some of the missing piece
for a succesfull LDAP query.
Post by Mickaël Guessant
Use any ldap client available, e.g. ldapsearch
I will play with it, such as adding "dc=domain,dc=tld" and report back.
Doing

$ ldapsearch -H ldap://localhost:1389/ -X u:me -w p55wrd -b ou=people,dc=example,dc=com '(mail=*myself*)'

yields response
ldap_sasl_interactive_bind_s: No such attribute (16)


In the logging is
2017-01-12 07:36:21,137 DEBUG [davmail.ldap.LdapServer] davmail - Connection from /0:0:0:0:0:0:0:1 on port 1389
2017-01-12 07:36:22,337 DEBUG [LdapConnection-58740] davmail.exchange.ExchangeSession - Test configuration status: 401
2017-01-12 07:36:22,339 DEBUG [LdapConnection-58740] davmail - LDAP_REQ_SEARCH 1 base= scope: 0 sizelimit: 100 timelimit: 0 filter: (objectclass=*) returning attributes: [supportedsaslmechanisms] 2017-01-12 07:36:22,339 DEBUG [LdapConnection-58740] davmail - Sending root DSE
2017-01-12 07:36:22,340 DEBUG [LdapConnection-58740] davmail - LDAP_REQ_SEARCH 1 success
2017-01-12 07:36:22,340 DEBUG [LdapConnection-58740] davmail - LDAP_REQ_UNBIND 2


What is a succesfull LDAP query?


Groeten
Geert Stappers
--
Leven en laten leven
Mickaël Guessant
2017-01-14 10:57:11 UTC
Permalink
$ ldapsearch -Hldap://localhost:1389/ -X u:me -w p55wrd -b ou=people,dc=example,dc=com '(mail=*myself*)'
yields response
ldap_sasl_interactive_bind_s: No such attribute (16)
=> Use -D username instead of -X

=> base context is ou=people
--
Mickael Guessant
mailto:***@free.fr
Geert Stappers
2017-01-14 13:37:34 UTC
Permalink
Post by Mickaël Guessant
$ ldapsearch -Hldap://localhost:1389/ -X u:me -w p55wrd -b ou=people,dc=example,dc=com '(mail=*myself*)'
yields response
ldap_sasl_interactive_bind_s: No such attribute (16)
=> Use -D username instead of -X
=> base context is ou=people
Yes \o/

$ ldapsearch -H ldap://localhost:1389/ -D me -w p55wrd -b ou=people '(mail=*myself*)'

is a succesfull LDAP query. Thanks.


Groeten
Geert Stappers
--
Leven en laten leven
Loading...