This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 706ff0b08b35a5fd44bdcd82264f6c3ca0cf820f Author: Benoit TELLIER <[email protected]> AuthorDate: Wed Jun 19 15:40:09 2024 +0200 JAMES-4044 Add JavaDoc --- docs/modules/servers/partials/LDAPMatchers.adoc | 10 ++++----- server/mailet/ldap/README.md | 8 ++++---- .../james/transport/matchers/HasLDAPAttribute.java | 24 ++++++++++++++++++++++ .../transport/matchers/SenderHasLDAPAttribute.java | 24 ++++++++++++++++++++++ 4 files changed, 56 insertions(+), 10 deletions(-) diff --git a/docs/modules/servers/partials/LDAPMatchers.adoc b/docs/modules/servers/partials/LDAPMatchers.adoc index 44980ca084..be110817bf 100644 --- a/docs/modules/servers/partials/LDAPMatchers.adoc +++ b/docs/modules/servers/partials/LDAPMatchers.adoc @@ -26,13 +26,11 @@ The LDAP settings are reused from the `usersrepository.xml` configuration file. Then LDAP matchers can be configured within `mailetcontainer.xml`. -Then LDAP matchers can be configured within `mailetcontainer.xml`. - For instance: ....xml <!-- Matches recipients that have the following attribute with the specified value--> -<mailet matcher="HasLDAPAttibute=description:blocked" class="Null"> +<mailet matcher="HasLDAPAttribute=description:blocked" class="Null"> </mailet> .... @@ -41,7 +39,7 @@ or ....xml <!-- Matches sender that have the following attribute with the specified value--> -<mailet matcher="SenderHasLDAPAttibute=description:blocked" class="Null"> +<mailet matcher="SenderHasLDAPAttribute=description:blocked" class="Null"> </mailet> .... @@ -50,7 +48,7 @@ or ....xml <!-- Matches recipients that have the following attribute regardless of the actual value--> -<mailet matcher="HasLDAPAttibute=description" class="Null"> +<mailet matcher="HasLDAPAttribute=description" class="Null"> </mailet> .... @@ -59,7 +57,7 @@ or ....xml <!-- Matches sender that have the following attribute regardless of the actual value--> -<mailet matcher="SenderHasLDAPAttibute=description" class="Null"> +<mailet matcher="SenderHasLDAPAttribute=description" class="Null"> </mailet> .... diff --git a/server/mailet/ldap/README.md b/server/mailet/ldap/README.md index b2ccb82d26..cb27980881 100644 --- a/server/mailet/ldap/README.md +++ b/server/mailet/ldap/README.md @@ -30,7 +30,7 @@ For instance: ```xml <!-- Matches recipients that have the following attribute with the specified value--> -<mailet matcher="HasLDAPAttibute=description:blocked" class="Null"> +<mailet matcher="HasLDAPAttribute=description:blocked" class="Null"> </mailet> ``` @@ -39,7 +39,7 @@ or ```xml <!-- Matches sender that have the following attribute with the specified value--> -<mailet matcher="SenderHasLDAPAttibute=description:blocked" class="Null"> +<mailet matcher="SenderHasLDAPAttribute=description:blocked" class="Null"> </mailet> ``` @@ -48,7 +48,7 @@ or ```xml <!-- Matches recipients that have the following attribute regardless of the actual value--> -<mailet matcher="HasLDAPAttibute=description" class="Null"> +<mailet matcher="HasLDAPAttribute=description" class="Null"> </mailet> ``` @@ -57,7 +57,7 @@ or ```xml <!-- Matches sender that have the following attribute regardless of the actual value--> -<mailet matcher="SenderHasLDAPAttibute=description" class="Null"> +<mailet matcher="SenderHasLDAPAttribute=description" class="Null"> </mailet> ``` diff --git a/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/HasLDAPAttribute.java b/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/HasLDAPAttribute.java index ce529f5edd..cecb20a681 100644 --- a/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/HasLDAPAttribute.java +++ b/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/HasLDAPAttribute.java @@ -44,6 +44,30 @@ import com.unboundid.ldap.sdk.SearchResult; import com.unboundid.ldap.sdk.SearchResultEntry; import com.unboundid.ldap.sdk.SearchScope; +/** + * Matchers that allow looking up for LDAP attributed for each recipient. + * + * To enable this matcher one need first to add the james-server-mailet-ldap.jar in the externals-jars folder of your + * James installation. + * + * In order to match the presence of an attribute: + * + * <pre><code> + * <!-- Matches recipients that have the following attribute regardless of the actual value--> + * <mailet matcher="HasLDAPAttibute=description" class="Null"> + * + * </mailet> + * </code></pre> + * + * And in order to Match a specific value for that attribute: + * + * <pre><code> + * <!-- Matches recipients that have the following attribute with the specified value--> + * <mailet matcher="HasLDAPAttribute=description:blocked" class="Null"> + * + * </mailet> + * </code></pre> + */ public class HasLDAPAttribute extends GenericMatcher { private final LDAPConnectionPool ldapConnectionPool; private final LdapRepositoryConfiguration configuration; diff --git a/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/SenderHasLDAPAttribute.java b/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/SenderHasLDAPAttribute.java index 54915d4ff3..fb1acfd76f 100644 --- a/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/SenderHasLDAPAttribute.java +++ b/server/mailet/ldap/src/main/java/org/apache/james/transport/matchers/SenderHasLDAPAttribute.java @@ -44,6 +44,30 @@ import com.unboundid.ldap.sdk.SearchResult; import com.unboundid.ldap.sdk.SearchResultEntry; import com.unboundid.ldap.sdk.SearchScope; +/** + * Matchers that allow looking up for LDAP attributed based on the sender.. + * + * To enable this matcher one need first to add the james-server-mailet-ldap.jar in the externals-jars folder of your + * James installation. + * + * In order to match the presence of an attribute: + * + * <pre><code> + * <!-- Matches sender that have the following attribute regardless of the actual value--> + * <mailet matcher="SenderHasLDAPAttibute=description" class="Null"> + * + * </mailet> + * </code></pre> + * + * And in order to Match a specific value for that attribute: + * + * <pre><code> + * <!-- Matches sender that have the following attribute with the specified value--> + * <mailet matcher="SenderHasLDAPAttribute=description:blocked" class="Null"> + * + * </mailet> + * </code></pre> + */ public class SenderHasLDAPAttribute extends GenericMatcher { private final LDAPConnectionPool ldapConnectionPool; private final LdapRepositoryConfiguration configuration; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
