Skip to content

Commit

Permalink
JAMES-3928 Sample configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
quantranhong1999 authored and Arsnael committed Jul 21, 2023
1 parent eb02da5 commit 96ffd11
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ Moreover, per domain base DN can be configured:
</domains>
</usersrepository>
....

You can connect to multiple LDAP servers for better availability by using `ldapHosts` option (fallback to `ldapHost` is supported) to specify the list of LDAP Server URL with the comma `,` delimiter. We do support different schemas for LDAP servers.

Example:

....
<usersrepository name="LocalUsers" class="org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository" ldapHosts="ldap://ldapServer1:389,ldaps://ldapServer2:636"
principal="uid=ldapUser,ou=system" credentials="password" userBase="ou=People,o=myorg.com,ou=system" userIdAttribute="uid" trustAllCerts="true">
<enableVirtualHosting>true</enableVirtualHosting>
</usersrepository>
....
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<!-- LDAP support example-->
<!--
<usersrepository name="LocalUsers"
<usersrepository name="LocalUsers" class="org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository"
ldapHost="ldap://myldapserver:389"
principal="uid=ldapUser,ou=system"
credentials="password"
Expand All @@ -38,4 +38,18 @@
<enableVirtualHosting>true</enableVirtualHosting>
<enableForwarding>true</enableForwarding>
</usersrepository>
-->

<!-- Multiple LDAP servers support example-->
<!--
<usersrepository name="LocalUsers" class="org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository"
ldapHosts="ldap://ldapServer1:389,ldaps://ldapServer2:636"
principal="uid=ldapUser,ou=system"
credentials="password"
userBase="ou=People,o=myorg.com,ou=system"
userIdAttribute="uid"
userObjectClass="person">
<enableVirtualHosting>true</enableVirtualHosting>
<enableForwarding>true</enableForwarding>
</usersrepository>
-->
13 changes: 13 additions & 0 deletions src/site/xdoc/server/config-users.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@
&lt;/domains&gt;
&lt;/usersrepository&gt;</source>

<p>You can connect to multiple LDAP servers for better availability by using <code>ldapHosts</code> option
(fallback to <code>ldapHost</code> is supported) to specify the list of LDAP Server URL with the comma <code>,</code> delimiter.
We do support different schemas for LDAP servers.</p>

<p>Example:</p>

<source>
&lt;usersrepository name="LocalUsers" class="org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository" ldapHosts="ldap://ldapServer1:389,ldaps://ldapServer2:636"
principal="uid=ldapUser,ou=system" credentials="password" userBase="ou=People,o=myorg.com,ou=system" userIdAttribute="uid" trustAllCerts="true"&gt;
&lt;enableVirtualHosting&gt;true&lt;/enableVirtualHosting&gt;
&lt;/usersrepository&gt;
</source>

</subsection>

</section>
Expand Down

0 comments on commit 96ffd11

Please sign in to comment.