[GitHub] [james-project] chibenwa commented on pull request #1525: Support `start-dev` argument when running Memory James server

2023-04-27 Thread via GitHub


chibenwa commented on PR #1525:
URL: https://github.com/apache/james-project/pull/1525#issuecomment-1526974601

   Todo:
   
- [ ] Manually test all APPs


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] woj-tek opened a new pull request, #1546: Don't add gateway if no gateway is configured (empty value)

2023-04-27 Thread via GitHub


woj-tek opened a new pull request, #1546:
URL: https://github.com/apache/james-project/pull/1546

   If there is an empty `` element in configuration then 
RemoteDelivery adds empty values to collection resulting in entry `[:]` which 
then fails to deliver. I'd argue that in that case James should skip such 
configuration and use `serviceNoGateway()` method.
   
   Example configuration:
   ```xml
   
   
   outgoing
   5000, 10, 50
   3
   0
   10
   true
   bounces
   true
   
   
   
   
   
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] branch master updated (32c42b631d -> 315f30114c)

2023-04-27 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


from 32c42b631d JAMES-3903 Only archive the code coverage report when the 
build is success.
 new 64d394f721 [FIX] Strengthen IMAP ESEARCH tests
 new f812548421 [PERF] Optimize IMAP ESEARCH options
 new 315f30114c [PERF] IMAP ESEARCH: working with uids is not needed

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../imap/scripts/SearchOptionAggregations.test | 62 --
 .../james/imap/encode/ESearchResponseEncoder.java  |  8 +--
 .../imap/message/response/ESearchResponse.java |  9 +---
 .../james/imap/processor/SearchProcessor.java  | 61 +
 4 files changed, 100 insertions(+), 40 deletions(-)


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] 01/03: [FIX] Strengthen IMAP ESEARCH tests

2023-04-27 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 64d394f721b6296bd5387226dc8a6a5445847fa2
Author: Benoit Tellier 
AuthorDate: Wed Apr 26 17:28:41 2023 +0700

[FIX] Strengthen IMAP ESEARCH tests
---
 .../imap/scripts/SearchOptionAggregations.test | 62 --
 1 file changed, 59 insertions(+), 3 deletions(-)

diff --git 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
index c408a3f4f4..79ebebf289 100644
--- 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
+++ 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/SearchOptionAggregations.test
@@ -143,6 +143,62 @@ S: \* 5 FETCH .*
 }
 S: i OK FETCH completed.
 
-C: h SEARCH RETURN (ALL) FLAGGED
-S: \* ESEARCH \(TAG "h"\) ALL 1:2,4:5
-S: h OK SEARCH completed.
\ No newline at end of file
+C: j SEARCH RETURN (ALL) FLAGGED
+S: \* ESEARCH \(TAG "j"\) ALL 1:2,4:5
+S: j OK SEARCH completed.
+
+C: k UID SEARCH RETURN (ALL) FLAGGED
+S: \* ESEARCH \(TAG "k"\) UID ALL 1:2,4:5
+S: k OK SEARCH completed.
+
+C: l UID SEARCH RETURN (MIN MAX COUNT) FLAGGED
+S: \* ESEARCH \(TAG "l"\) UID MIN 1 MAX 5 COUNT 4
+S: l OK SEARCH completed.
+
+C: m UID SEARCH RETURN (ALL SAVE) FLAGGED
+S: \* ESEARCH \(TAG "m"\) UID ALL 1:2,4:5
+S: m OK SEARCH completed.
+
+C: n FETCH $ FLAGS
+SUB {
+S: \* 1 FETCH .*
+S: \* 2 FETCH .*
+S: \* 4 FETCH .*
+S: \* 5 FETCH .*
+}
+S: n OK FETCH completed.
+
+C: o UID SEARCH RETURN (MIN MAX SAVE) FLAGGED
+S: \* ESEARCH \(TAG "o"\) UID MIN 1 MAX 5
+S: o OK SEARCH completed.
+
+C: p FETCH $ FLAGS
+SUB {
+S: \* 1 FETCH .*
+S: \* 5 FETCH .*
+}
+S: p OK FETCH completed.
+
+C: q UID SEARCH RETURN (MIN MAX COUNT SAVE) FLAGGED
+S: \* ESEARCH \(TAG "q"\) UID MIN 1 MAX 5 COUNT 4
+S: q OK SEARCH completed.
+
+C: r FETCH $ FLAGS
+SUB {
+S: \* 1 FETCH .*
+S: \* 2 FETCH .*
+S: \* 4 FETCH .*
+S: \* 5 FETCH .*
+}
+S: r OK FETCH completed.
+
+C: s UID SEARCH RETURN (MIN MAX) ANSWERED
+S: \* ESEARCH \(TAG "s"\) UID
+S: s OK SEARCH completed.
+
+C: t UID SEARCH RETURN (MIN MAX SAVE) ANSWERED
+S: \* ESEARCH \(TAG "t"\) UID
+S: t OK SEARCH completed.
+
+C: u FETCH $ FLAGS
+S: u OK FETCH completed.


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] 03/03: [PERF] IMAP ESEARCH: working with uids is not needed

2023-04-27 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 315f30114cbdbe9b99015436e7a1028c5b46eb20
Author: Benoit Tellier 
AuthorDate: Wed Apr 26 17:38:49 2023 +0700

[PERF] IMAP ESEARCH: working with uids is not needed

The untyped idSet represent the exact same data
---
 .../james/imap/encode/ESearchResponseEncoder.java|  8 +---
 .../james/imap/message/response/ESearchResponse.java |  9 +
 .../apache/james/imap/processor/SearchProcessor.java | 20 +++-
 3 files changed, 5 insertions(+), 32 deletions(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/encode/ESearchResponseEncoder.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/encode/ESearchResponseEncoder.java
index 819090fa9d..212758f1d5 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/encode/ESearchResponseEncoder.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/encode/ESearchResponseEncoder.java
@@ -24,7 +24,6 @@ import java.util.List;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.Tag;
 import org.apache.james.imap.api.message.IdRange;
-import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.SearchResultOption;
 import org.apache.james.imap.message.response.ESearchResponse;
 import org.apache.james.mailbox.ModSeq;
@@ -45,7 +44,6 @@ public class ESearchResponseEncoder implements 
ImapResponseEncoder options = response.getSearchResultOptions();
@@ -63,14 +61,10 @@ public class ESearchResponseEncoder implements 
ImapResponseEncoder 0 && 
options.contains(SearchResultOption.ALL)) {
+if (all != null && all.length > 0 && 
options.contains(SearchResultOption.ALL)) {
 composer.message(SearchResultOption.ALL.name());
 composer.sequenceSet(all);
 }
-if (useUid && allUids != null && allUids.length > 0 && 
options.contains(SearchResultOption.ALL)) {
-composer.message(SearchResultOption.ALL.name());
-composer.sequenceSet(allUids);
-}
 
 // Add the MODSEQ to the response if needed. 
 //
diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/message/response/ESearchResponse.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/message/response/ESearchResponse.java
index 89e0437fdb..b21ad10f82 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/message/response/ESearchResponse.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/message/response/ESearchResponse.java
@@ -23,7 +23,6 @@ import java.util.List;
 
 import org.apache.james.imap.api.Tag;
 import org.apache.james.imap.api.message.IdRange;
-import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.SearchResultOption;
 import org.apache.james.imap.api.message.response.ImapResponseMessage;
 import org.apache.james.mailbox.ModSeq;
@@ -37,16 +36,14 @@ public class ESearchResponse implements ImapResponseMessage 
{
 private final boolean useUid;
 private final List options;
 private final ModSeq highestModSeq;
-private UidRange[] allUids;
 
-public ESearchResponse(long minUid, long maxUid, long count, IdRange[] 
all, UidRange[] allUids, ModSeq highestModSeq, Tag tag, boolean useUid, 
List options) {
+public ESearchResponse(long minUid, long maxUid, long count, IdRange[] 
all, ModSeq highestModSeq, Tag tag, boolean useUid, List 
options) {
 this.options = options;
 this.minUid = minUid;
 this.maxUid = maxUid;
 this.count = count;
 this.all = all;
 this.tag = tag;
-this.allUids = allUids;
 this.useUid = useUid;
 this.highestModSeq = highestModSeq;
 }
@@ -66,10 +63,6 @@ public class ESearchResponse implements ImapResponseMessage {
 public IdRange[] getAll() {
 return all;
 }
-
-public UidRange[] getAllUids() {
-return allUids;
-}
 
 public Tag getTag() {
 return tag;
diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
index 499047dd94..3b33d0abc9 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
@@ -22,7 +22,6 @@ package org.apache.james.imap.processor;
 import static 
org.apache.james.mailbox.MessageManager.MailboxMetaData.RecentMode.IGNORE;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -76,7 +75,6 @@ import com.google.common.collect.ImmutableList;
 
 import it.unimi.dsi.fastutil.longs.LongArrayList;
 import 

[james-project] 02/03: [PERF] Optimize IMAP ESEARCH options

2023-04-27 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit f812548421384d44f0d2f0a580c249a2db957b30
Author: Benoit Tellier 
AuthorDate: Wed Apr 26 17:34:31 2023 +0700

[PERF] Optimize IMAP ESEARCH options

 - Compute UID ranges only if needed
 - Compute the idSet directly from the LongList to work in-place and drop 
complexity
---
 .../james/imap/processor/SearchProcessor.java  | 69 --
 1 file changed, 50 insertions(+), 19 deletions(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
index 6d506900c3..499047dd94 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
@@ -22,6 +22,7 @@ package org.apache.james.imap.processor;
 import static 
org.apache.james.mailbox.MessageManager.MailboxMetaData.RecentMode.IGNORE;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -74,6 +75,8 @@ import com.github.fge.lambdas.Throwing;
 import com.google.common.collect.ImmutableList;
 
 import it.unimi.dsi.fastutil.longs.LongArrayList;
+import it.unimi.dsi.fastutil.longs.LongComparators;
+import it.unimi.dsi.fastutil.longs.LongConsumer;
 import it.unimi.dsi.fastutil.longs.LongList;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
@@ -164,22 +167,8 @@ public class SearchProcessor extends 
AbstractMailboxProcessor imp
 
 private ImapResponseMessage handleResultOptions(SearchRequest request, 
ImapSession session, Collection uids, ModSeq highestModSeq, 
LongList ids) {
 List resultOptions = 
request.getSearchOperation().getResultOptions();
-List idList = new ArrayList<>(ids.size());
-for (long id : ids) {
-idList.add(id);
-}
 
-List idsAsRanges = new ArrayList<>();
-for (Long id: idList) {
-idsAsRanges.add(new IdRange(id));
-}
-IdRange[] idRanges = 
IdRange.mergeRanges(idsAsRanges).toArray(IdRange[]::new);
-
-List uidsAsRanges = new ArrayList<>();
-for (MessageUid uid: uids) {
-uidsAsRanges.add(new UidRange(uid));
-}
-UidRange[] uidRanges = 
UidRange.mergeRanges(uidsAsRanges).toArray(UidRange[]::new);
+IdRange[] idRanges = asRanges(ids);
 
 boolean esearch = false;
 for (SearchResultOption resultOption : resultOptions) {
@@ -194,12 +183,11 @@ public class SearchProcessor extends 
AbstractMailboxProcessor imp
 long max = -1;
 long count = ids.size();
 
-if (ids.size() > 0) {
+if (!ids.isEmpty()) {
 min = ids.getLong(0);
 max = ids.getLong(ids.size() - 1);
 }
 
-
 // Save the sequence-set for later usage. This is part of SEARCHRES
 if (resultOptions.contains(SearchResultOption.SAVE)) {
 if (resultOptions.contains(SearchResultOption.ALL) || 
resultOptions.contains(SearchResultOption.COUNT)) {
@@ -207,17 +195,18 @@ public class SearchProcessor extends 
AbstractMailboxProcessor imp
 SearchResUtil.saveSequenceSet(session, idRanges);
 } else {
 List savedRanges = new ArrayList<>();
-if (resultOptions.contains(SearchResultOption.MIN)) {
+if (resultOptions.contains(SearchResultOption.MIN) && min 
> 0) {
 // Store the MIN
 savedRanges.add(new IdRange(min));
 }
-if (resultOptions.contains(SearchResultOption.MAX)) {
+if (resultOptions.contains(SearchResultOption.MAX) && max 
> 0) {
 // Store the MAX
 savedRanges.add(new IdRange(max));
 }
 SearchResUtil.saveSequenceSet(session, 
savedRanges.toArray(IdRange[]::new));
 }
 }
+UidRange[] uidRanges = uidRangeIfNeeded(request, resultOptions, 
uids);
 return new ESearchResponse(min, max, count, idRanges, uidRanges, 
highestModSeq, request.getTag(), request.isUseUids(), resultOptions);
 } else {
 // Just save the returned sequence-set as this is not SEARCHRES + 
ESEARCH
@@ -226,6 +215,48 @@ public class SearchProcessor extends 
AbstractMailboxProcessor imp
 }
 }
 
+private UidRange[] uidRangeIfNeeded(SearchRequest request, 
List resultOptions, Collection uids) {
+if (resultOptions.contains(SearchResultOption.ALL) && 
request.isUseUids()) {
+List uidsAsRanges = new ArrayList<>();

[GitHub] [james-project] chibenwa merged pull request #1543: [PERF + FIX] Improve IMAP ESEARCH

2023-04-27 Thread via GitHub


chibenwa merged PR #1543:
URL: https://github.com/apache/james-project/pull/1543


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] Arsnael merged pull request #1522: POC Code coverage for Apache James

2023-04-27 Thread via GitHub


Arsnael merged PR #1522:
URL: https://github.com/apache/james-project/pull/1522


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] branch master updated (8768378814 -> 32c42b631d)

2023-04-27 Thread rcordier
This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


from 8768378814 JAMES-3905 LDAP should allow per user base DN (#1540)
 add 68e58599e2 JAMES-3903 Code coverage for Apache James
 add 5dfc4c94be JAMES-3903 No need to sort code-coverage-report pom
 add 52a10702d4 JAMES-3903 Avoid building jar for (big) code coverage 
report module
 add dcfaaea759 JAMES-3903 apache-james-mpt-all can be in jar type packaged
 add 7fdbbc911a JAMES-3903 Fix broken build on the Examples module
 add 32c42b631d JAMES-3903 Only archive the code coverage report when the 
build is success.

No new revisions were added by this update.

Summary of changes:
 Jenkinsfile|5 +-
 code-coverage-report/pom.xml   | 1293 
 examples/pom.xml   |   24 +
 mailbox/tools/indexer/pom.xml  |4 +-
 mpt/all/pom.xml|2 +-
 pom.xml|   23 +-
 server/apps/distributed-app/pom.xml|4 +-
 server/apps/distributed-pop3-app/pom.xml   |4 +-
 server/blob/blob-memory/pom.xml|4 +-
 .../memory-jmap-draft-integration-testing/pom.xml  |4 +-
 .../pom.xml|4 +-
 .../pom.xml|4 +-
 server/protocols/protocols-imap4/pom.xml   |4 +-
 server/protocols/protocols-lmtp/pom.xml|4 +-
 server/protocols/protocols-pop3/pom.xml|4 +-
 server/protocols/protocols-smtp/pom.xml|4 +-
 .../distributed-webadmin-integration-test/pom.xml  |4 +-
 .../memory-webadmin-integration-test/pom.xml   |4 +-
 server/protocols/webadmin/webadmin-mailbox/pom.xml |4 +-
 19 files changed, 1386 insertions(+), 17 deletions(-)
 create mode 100644 code-coverage-report/pom.xml


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[james-project] branch master updated: JAMES-3905 LDAP should allow per user base DN (#1540)

2023-04-27 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git


The following commit(s) were added to refs/heads/master by this push:
 new 8768378814 JAMES-3905 LDAP should allow per user base DN (#1540)
8768378814 is described below

commit 8768378814b7cffdf20934164b181b45b5740867
Author: Benoit TELLIER 
AuthorDate: Thu Apr 27 14:25:17 2023 +0700

JAMES-3905 LDAP should allow per user base DN (#1540)
---
 .../ROOT/pages/configure/usersrepository.adoc  | 24 --
 .../user/ldap/LdapRepositoryConfiguration.java | 45 --
 .../james/user/ldap/ReadOnlyLDAPUsersDAO.java  | 54 --
 .../user/ldap/ReadOnlyUsersLDAPRepositoryTest.java | 46 ++
 .../src/test/resources/ldif-files/Dockerfile   |  2 +-
 .../src/test/resources/ldif-files/populate.ldif| 13 ++
 src/site/xdoc/server/config-users.xml  | 25 --
 7 files changed, 180 insertions(+), 29 deletions(-)

diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/usersrepository.adoc
 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/usersrepository.adoc
index 21adc49072..e9020c6ac3 100644
--- 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/usersrepository.adoc
+++ 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/usersrepository.adoc
@@ -60,8 +60,10 @@ to get some examples and hints.
 Example:
 
 
-ldap://myldapserver:389;
-principal="uid=ldapUser,ou=system" credentials="password" 
userBase="ou=People,o=myorg.com,ou=system" userIdAttribute="uid"/>;
+ldap://myldapserver:389;
+principal="uid=ldapUser,ou=system" credentials="password" 
userBase="ou=People,o=myorg.com,ou=system" userIdAttribute="uid">
+true
+
 
 
 SSL can be enabled by using `ldaps` scheme. `trustAllCerts` option can be used 
to trust all LDAP client certificates
@@ -70,7 +72,21 @@ SSL can be enabled by using `ldaps` scheme. `trustAllCerts` 
option can be used t
 Example:
 
 
-;
+trustAllCerts="true">
+true
+
+
+
+Moreover, per domain base DN can be configured:
+
+
+ldap://myldapserver:389;
+principal="uid=ldapUser,ou=system" credentials="password" 
userBase="ou=People,o=myorg.com,ou=system" userIdAttribute="uid"
+true
+
+ou=People,o=other.com,ou=system
+
+
 
diff --git 
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
 
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
index 1fb7f38017..e9e0b50fb8 100644
--- 
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
+++ 
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
@@ -19,15 +19,18 @@
 
 package org.apache.james.user.ldap;
 
+import java.util.Iterator;
 import java.util.Objects;
 import java.util.Optional;
 
 import org.apache.commons.configuration2.HierarchicalConfiguration;
 import org.apache.commons.configuration2.ex.ConfigurationException;
 import org.apache.commons.configuration2.tree.ImmutableNode;
+import org.apache.james.core.Domain;
 import org.apache.james.core.Username;
 
 import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
 
 public class LdapRepositoryConfiguration {
 public static final String SUPPORTS_VIRTUAL_HOSTING = 
"supportsVirtualHosting";
@@ -49,6 +52,7 @@ public class LdapRepositoryConfiguration {
 private Optional userObjectClass;
 private Optional poolSize;
 private Optional trustAllCerts;
+private ImmutableMap.Builder perDomainBaseDN;
 
 public Builder() {
 ldapHost = Optional.empty();
@@ -59,6 +63,7 @@ public class LdapRepositoryConfiguration {
 userObjectClass = Optional.empty();
 poolSize = Optional.empty();
 trustAllCerts = Optional.empty();
+perDomainBaseDN = ImmutableMap.builder();
 }
 
 public Builder ldapHost(String ldapHost) {
@@ -101,6 +106,11 @@ public class LdapRepositoryConfiguration {
 return this;
 }
 
+public Builder addPerDomainDN(Domain domain, String dn) {
+this.perDomainBaseDN.put(domain, dn);
+return this;
+}
+
 public LdapRepositoryConfiguration build() throws 
ConfigurationException {
 Preconditions.checkState(ldapHost.isPresent(), "'ldapHost' is 
mandatory");
 Preconditions.checkState(principal.isPresent(), "'principal' is 
mandatory");
@@ -123,7 +133,8 @@ public class LdapRepositoryConfiguration {
 NO_RESTRICTION,
 NO_FILTER,
 NO_ADMINISTRATOR_ID,
-trustAllCerts.orElse(false));
+trustAllCerts.orElse(false),
+

[GitHub] [james-project] chibenwa merged pull request #1540: JAMES-3905 LDAP should allow per user base DN

2023-04-27 Thread via GitHub


chibenwa merged PR #1540:
URL: https://github.com/apache/james-project/pull/1540


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org



[GitHub] [james-project] chibenwa commented on pull request #1522: POC Code coverage for Apache James

2023-04-27 Thread via GitHub


chibenwa commented on PR #1522:
URL: https://github.com/apache/james-project/pull/1522#issuecomment-1524962092

   IMO yes we can


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org