Skip to main content
WisMail

Connect LDAP / Active Directory

If your company already keeps users and passwords in a directory, you do not have to create them twice. WisMail can map a mail domain to an LDAP or Microsoft Active Directory server: the directory supplies the users and groups, and people log in to IMAP, POP3, SMTP and webmail with their directory password. Allow about 20 minutes. Feature overview: Security, 2FA and LDAP.

What we have verified. Directory login and user mapping were tested against OpenLDAP, including a custom attribute map and failover to a backup directory server. Active Directory and other directory products are selectable but we have not tested them ourselves: pilot on a test domain first, and use the free trial to check your own directory.

What you get

  • Directory login. The directory checks the password when a user logs in. A user's local password is not used for a directory user.
  • User and group mapping. The domain lists the directory's users and groups. They appear in web administration marked as directory users and are read-only there: you edit them in the directory, not in WisMail. The server refreshes the directory data periodically and again when you change the settings.
  • A backup directory server is used when the primary does not answer.

Users you create locally in the same domain still work as before.

Before you start

  • The mail domain already exists in WisMail (see the install guide).
  • You have the directory server's host name and port reachable from the WisMail server (389 for LDAP, 636 for LDAPS).
  • You have a bind account: a read-only directory user that can search users and groups. Do not use an administrator account.
  • You know the search suffix (base DN), for example dc=example,dc=com. For Active Directory you need the AD domain name.

Step 1. Open the domain's directory settings

Web administration domain settings, Directory Service tab: server, bind account and Test Connection

Log in to web administration, open Configuration, Domains, edit the domain and open the Directory Service tab.

Step 2. Switch on mapping and choose the type

  1. Tick Map user accounts and groups from a directory service to this domain.
  2. In Directory service type choose Microsoft Active Directory or custom LDAP server (for OpenLDAP and similar).

Step 3. Connection and bind account

Under Directory server (domain controller):

  1. Hostname: the directory server name or IP address.
  2. Username and Password: the bind account.
  3. Tick Secure connection (LDAPS) if the server offers LDAPS. This encrypts the traffic. Keep directory traffic on a network you trust: the connection does not verify the directory server's certificate.
  4. Optionally enter a Secondary (backup) directory server host name.

Step 4. Search suffix or AD domain name

  • For a custom LDAP server enter the Search suffix, for example ou=people,dc=example,dc=com.
  • For Active Directory enter the Microsoft Active Directory domain name; tick Different from this mail domain name when it differs from your mail domain (for example corp.example.com).

Step 5. Test, then apply

Click Test Connection. The result shows whether the primary and the secondary server answered. Fix any error, then click Apply.

Step 6. Check the users

Open Accounts, Users and pick the domain: the directory users should be listed with a directory icon. Log in to webmail as one of them with the directory password. A wrong password and an empty password are refused. A message such as Can't contact LDAP server or Invalid username or password appears in the Security log.

Custom attribute mappings

A mapping tells WisMail which directory attribute feeds which field (login name, full name, e-mail address, group membership). Ready-made map files for several directory types are installed in /opt/wismail/ldapmap/ (for example openldap.map, ads.map). They are XML files. If your schema uses other attribute names, copy the closest map, change the attribute names, and test it on a non-production domain first. We have verified a custom map against OpenLDAP only. Group mapping from the directory is read-only, like users.

Troubleshooting

Test Connection fails. Check the host name resolves from the WisMail server and the port is open in both firewalls: nc -vz ldap.example.com 389 (or 636).

Users do not appear. The search suffix is wrong, or the bind account cannot read that part of the tree. Test the same search with ldapsearch from the WisMail server.

A user cannot log in. Check the Security log for the reason. Remember the directory password is the one that works, and an account disabled in the directory cannot log in.

The primary directory server is down. If you configured a secondary server, logins use it.

Next steps