How to test LDAP server enabled on MTA.

  • 7023793
  • 26-Mar-2019
  • 26-Mar-2019

Environment

You have enabled LDAP feature on MTA and want to test it. Note, despite this is a setting on MTA, it is gwadminservice which needs to be stopped and started to start listening the LDAP on given port .

Situation

If you set it up and want to test it, you can use Linux open source ldapsearch command to test this LDAP feature.
Here is example of syntax to get all users listed:

ldapsearch -h <LDAP host IP> -p <port> -D "<valid GW user in LDAP format>" -w <pwd> -s sub -b "<based DN>" "(&(objectclass=person))"

For a valid GW user in LDAP format you can use any GW mailbox from your system, example "cn=user1,ou=PO1,ou=DOM1,o=GW18". The "GW18" in organization object is the GW system name. You can find this information from gwadmin console -> System -> Information. The system name is mentioned in a top of this dialog, i.e. Information - <your GW system name>.
Use valid GW mailbox and its credentials which you use to login into his mailbox.
For the <base DN> can be used entire GW system, i.e. o=GW18 in this example, or you can narrow it down to users from a certain domain, PO, i.e. "ou=<PO>,ou=<Domain>,o=<GW system Name>.

The command and its output can look like in example:

ldapsearch -h 192.168.10.25 -p 390 -D "cn=user1,ou=PO1,ou=DOM1,o=GW18" -w novell -s sub -b "o=GW18" "(&(objectclass=person))"

# extended LDIF
#
# LDAPv3
# base <o=GW18> with scope subtree
# filter: (&(objectclass=person))
# requesting: ALL
#

# ad1-gw18, PO1, Dom1, GW18
dn: cn=ad1-gw18,ou=PO1,ou=Dom1,o=GW18
mail: ad1-gw18@rum.com
sn: last
cn: ad1-gw18
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: user
givenName: ad1-gw18
displayName: ad1-gw18 last

# ad2-gw18, PO1, Dom1, GW18
dn: cn=ad2-gw18,ou=PO1,ou=Dom1,o=GW18
mail: ad2-gw18@rum.com
sn: last
cn: ad2-gw18
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: user
givenName: ad2-gw18
displayName: ad2-gw18 last

# ad3-changed, PO1, Dom1, GW18
dn: cn=ad3-changed,ou=PO1,ou=Dom1,o=GW18
mail: ad3-changed@rum.com
sn: last3
cn: ad3-changed
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: user
givenName: ad3-changed
displayName: ad3-changed last3

# search result
search: 2
result: 0 Success

# numResponses: 24
# numEntries: 23