Re: [PR] JAMES-2586 Fix some jmap postgres integration tests [james-project]

2024-03-10 Thread via GitHub


vttranlina commented on PR #2048:
URL: https://github.com/apache/james-project/pull/2048#issuecomment-1987633242

   > Thanks.
   > 
   > Can you test guys locally on those tests and make sure it passes with 
those fixes? => 
https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-2095/3/testReport/
   
   - `webSocketShouldPushNewMessageWhenChangeSubscriptionOfMailbox` -> failed 
on my local. Related it, I discussed it with @hungphan227 on last Thursday, it 
failed because the test suite code, was not related to Postgres -> should 
update the test code
   
   - `checkShouldTurnFromDegradedToHealthyAfterMoreReadsOnAMissedProjection` -> 
failed
   
   - `shouldFailWithCannotCalculateChangesWhenSingleChangeIsTooLarge` -> passed


-- 
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



[PR] JAMES-2586 [Postgres] FIXUP when query with IN - should pre-check collection size [james-project]

2024-03-10 Thread via GitHub


vttranlina opened a new pull request, #2103:
URL: https://github.com/apache/james-project/pull/2103

   When debugging why CI failed at 
https://github.com/apache/james-project/pull/2048#issuecomment-1987593874
   I realized that Jooq will hang when the input to `IN` clause is empty.
   => 
   We should check the collection size before the query 


-- 
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



Re: [PR] JAMES-2586 Fix some jmap postgres integration tests [james-project]

2024-03-10 Thread via GitHub


Arsnael commented on PR #2048:
URL: https://github.com/apache/james-project/pull/2048#issuecomment-1987619546

   Thanks.
   
   Can you test guys locally on those tests and make sure it passes with those 
fixes? => 
https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-2095/3/testReport/
   
   


-- 
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



Re: [PR] Postgres integration tests fix build [james-project]

2024-03-10 Thread via GitHub


Arsnael commented on PR #2095:
URL: https://github.com/apache/james-project/pull/2095#issuecomment-1987612629

   
https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-2095/3/testReport/
   
   I can reproduce two of those 3 locally (fails everytime):
   
   - PostgresFastViewProjectionHealthCheckIntegrationTest
   - PostgresMailboxSetMethodTest
   
   Those fixes have not been well tested I'm afraid...


-- 
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



Re: [PR] JAMES-2586 Fix some jmap postgres integration tests [james-project]

2024-03-10 Thread via GitHub


vttranlina commented on PR #2048:
URL: https://github.com/apache/james-project/pull/2048#issuecomment-1987593874

   > fixup! JAMES-2586 Optimize AttachmentLoader
   
   Fixed 
https://github.com/apache/james-project/pull/2048/commits/144ac90c6483eda966301297afcf9c5cc73e55d6
   
   Reason: Hanging when Collections is empty


-- 
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: [UPDATE] commons-compress 1.24.0 -> 1.26.0 (#2089)

2024-03-10 Thread rcordier
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


The following commit(s) were added to refs/heads/master by this push:
 new e858bad711 [UPDATE] commons-compress 1.24.0 -> 1.26.0 (#2089)
e858bad711 is described below

commit e858bad7112eac3a767ebe1519e860b1687e6e09
Author: Benoit TELLIER 
AuthorDate: Mon Mar 11 04:02:09 2024 +0100

[UPDATE] commons-compress 1.24.0 -> 1.26.0 (#2089)
---
 backends-common/cassandra/pom.xml  | 5 +
 event-bus/cassandra/pom.xml| 5 +
 event-sourcing/event-store-cassandra/pom.xml   | 5 +
 mailbox/cassandra/pom.xml  | 5 +
 mailbox/plugin/deleted-messages-vault-cassandra/pom.xml| 5 +
 mailbox/plugin/quota-mailing-cassandra/pom.xml | 5 +
 mpt/impl/imap-mailbox/cassandra/pom.xml| 5 +
 mpt/impl/managesieve/cassandra/pom.xml | 5 +
 mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml| 5 +
 mpt/impl/smtp/cassandra/pom.xml| 5 +
 pom.xml| 7 ++-
 server/apps/cassandra-app/pom.xml  | 5 +
 server/apps/distributed-app/pom.xml| 5 +
 server/apps/distributed-pop3-app/pom.xml   | 5 +
 server/blob/blob-cassandra/pom.xml | 5 +
 server/data/data-cassandra/pom.xml | 5 +
 server/data/data-jmap-cassandra/pom.xml| 5 +
 server/mailrepository/mailrepository-cassandra/pom.xml | 5 +
 .../distributed-jmap-rfc-8621-integration-tests/pom.xml| 5 +
 server/queue/queue-rabbitmq/pom.xml| 5 +
 server/task/task-distributed/pom.xml   | 5 +
 21 files changed, 106 insertions(+), 1 deletion(-)

diff --git a/backends-common/cassandra/pom.xml 
b/backends-common/cassandra/pom.xml
index bb1e99ffea..92ed078a0b 100644
--- a/backends-common/cassandra/pom.xml
+++ b/backends-common/cassandra/pom.xml
@@ -80,6 +80,11 @@
 commons-beanutils
 test
 
+
+commons-codec
+commons-codec
+test
+
 
 io.projectreactor
 reactor-core
diff --git a/event-bus/cassandra/pom.xml b/event-bus/cassandra/pom.xml
index e17847ff2c..87f1d21e1a 100644
--- a/event-bus/cassandra/pom.xml
+++ b/event-bus/cassandra/pom.xml
@@ -55,6 +55,11 @@
 test-jar
 test
 
+
+commons-codec
+commons-codec
+test
+
 
 org.testcontainers
 testcontainers
diff --git a/event-sourcing/event-store-cassandra/pom.xml 
b/event-sourcing/event-store-cassandra/pom.xml
index f3fbee670d..b838dcdacd 100644
--- a/event-sourcing/event-store-cassandra/pom.xml
+++ b/event-sourcing/event-store-cassandra/pom.xml
@@ -78,6 +78,11 @@
 testing-base
 test
 
+
+commons-codec
+commons-codec
+test
+
 
 io.projectreactor
 reactor-scala-extensions_${scala.base}
diff --git a/mailbox/cassandra/pom.xml b/mailbox/cassandra/pom.xml
index fac4de46d9..cdeb8586da 100644
--- a/mailbox/cassandra/pom.xml
+++ b/mailbox/cassandra/pom.xml
@@ -175,6 +175,11 @@
 guice
 test
 
+
+commons-codec
+commons-codec
+test
+
 
 javax.inject
 javax.inject
diff --git a/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml 
b/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml
index 03652e87f6..6ada80f4a5 100644
--- a/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml
+++ b/mailbox/plugin/deleted-messages-vault-cassandra/pom.xml
@@ -80,6 +80,11 @@
 test-jar
 test
 
+
+commons-codec
+commons-codec
+test
+
 
 org.mockito
 mockito-core
diff --git a/mailbox/plugin/quota-mailing-cassandra/pom.xml 
b/mailbox/plugin/quota-mailing-cassandra/pom.xml
index f531f680a6..8186b25533 100644
--- a/mailbox/plugin/quota-mailing-cassandra/pom.xml
+++ b/mailbox/plugin/quota-mailing-cassandra/pom.xml
@@ -129,6 +129,11 @@
 com.fasterxml.jackson.datatype
 jackson-datatype-jdk8
 
+
+commons-codec
+commons-codec
+test
+
 
 net.javacrumbs.json-unit
 json-unit-assertj

Re: [PR] [FIX] Try recover invalid ascii character in filename [james-project]

2024-03-10 Thread via GitHub


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


-- 
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 (09e3803613 -> ed1c2e3d52)

2024-03-10 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 09e3803613 [FIX] RSpamD should not fail when reporting empty body
 add ed1c2e3d52 [FIX] Try recover invalid ascii character in filename

No new revisions were added by this update.

Summary of changes:
 .../main/scala/org/apache/james/jmap/routes/DownloadRoutes.scala  | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)


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



Re: [PR] [UPDATE] commons-compress 1.24.0 -> 1.26.0 [james-project]

2024-03-10 Thread via GitHub


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


-- 
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: [FIX] RSpamD should not fail when reporting empty body

2024-03-10 Thread rcordier
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


The following commit(s) were added to refs/heads/master by this push:
 new 09e3803613 [FIX] RSpamD should not fail when reporting empty body
09e3803613 is described below

commit 09e3803613e8096e952712de646efa4829a38773
Author: Benoit TELLIER 
AuthorDate: Sun Mar 10 21:28:51 2024 +0100

[FIX] RSpamD should not fail when reporting empty body
---
 .../java/org/apache/james/rspamd/client/RspamdHttpClient.java  |  4 
 .../org/apache/james/rspamd/client/RspamdHttpClientTest.java   | 10 ++
 2 files changed, 14 insertions(+)

diff --git 
a/third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RspamdHttpClient.java
 
b/third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RspamdHttpClient.java
index 427b2e4c4c..883bad3304 100644
--- 
a/third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RspamdHttpClient.java
+++ 
b/third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RspamdHttpClient.java
@@ -248,6 +248,10 @@ public class RspamdHttpClient {
 LOGGER.debug(responseBody);
 return Mono.empty();
 }
+if (responseBody.contains("Empty body is not 
permitted")) {
+LOGGER.debug(responseBody);
+return Mono.empty();
+}
 return Mono.error(() -> new 
RspamdUnexpectedException(responseBody));
 });
 }
diff --git 
a/third-party/rspamd/src/test/java/org/apache/james/rspamd/client/RspamdHttpClientTest.java
 
b/third-party/rspamd/src/test/java/org/apache/james/rspamd/client/RspamdHttpClientTest.java
index eb2777db27..2f8e384b76 100644
--- 
a/third-party/rspamd/src/test/java/org/apache/james/rspamd/client/RspamdHttpClientTest.java
+++ 
b/third-party/rspamd/src/test/java/org/apache/james/rspamd/client/RspamdHttpClientTest.java
@@ -27,6 +27,7 @@ import static 
org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.hamcrest.Matchers.nullValue;
 import static org.hamcrest.core.Is.is;
 
+import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.util.Optional;
 
@@ -317,6 +318,15 @@ class RspamdHttpClientTest {
 
assertThat(client.ping().block().status()).isEqualTo(HttpResponseStatus.OK);
 }
 
+@Test
+void shouldNotFailOnEmptyContent() {
+RspamdClientConfiguration configuration = new 
RspamdClientConfiguration(rspamdExtension.getBaseUrl(), PASSWORD, 
Optional.empty());
+RspamdHttpClient client = new RspamdHttpClient(configuration);
+
+client.reportAsSpam(ReactorUtils.toChunks(new 
ByteArrayInputStream("".getBytes()),
+BUFFER_SIZE), RspamdHttpClient.Options.forUser(BOB)).block();
+}
+
 private void reportAsSpam(RspamdHttpClient client, InputStream 
inputStream) {
 client.reportAsSpam(ReactorUtils.toChunks(inputStream, 
BUFFER_SIZE)).block();
 }


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



Re: [PR] [FIX] RSpamD should not fail when reporting empty body [james-project]

2024-03-10 Thread via GitHub


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


-- 
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 (d1bfeddc7e -> 35fa8040ff)

2024-03-10 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 d1bfeddc7e JAMES-2644 ContentTypeCleaner: add a test with a parameter
 add 35fa8040ff JAMES-3534 Fixbug - Identity response alway return 
mayDelete=false when server set identity

No new revisions were added by this update.

Summary of changes:
 .../jmap/api/identity/CustomIdentityDAO.scala  | 29 +++--
 .../rfc8621/contract/IdentityGetContract.scala | 69 +-
 .../james/jmap/json/IdentitySerializer.scala   | 17 +-
 3 files changed, 106 insertions(+), 9 deletions(-)


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



Re: [PR] JAMES-3534 Fixbug - Identity response alway return mayDelete=false when server set identity [james-project]

2024-03-10 Thread via GitHub


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


-- 
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



Re: [PR] JAMES-2644 Various COntentTypeCleaner enhancements [james-project]

2024-03-10 Thread via GitHub


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


-- 
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 (956cf750ba -> d1bfeddc7e)

2024-03-10 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 956cf750ba [FIX] Enforce a separate keyspace for blob store cache 
(#2060)
 add 831c6c7433 JAMES-2644 Add back tests
 add 4c5085975e JAMES-2644 ContentTypeCleaner Decrease log level
 add d1bfeddc7e JAMES-2644 ContentTypeCleaner: add a test with a parameter

No new revisions were added by this update.

Summary of changes:
 .../apache/james/server/core/ContentTypeCleaner.java   |  2 +-
 .../james/server/core/ContentTypeCleanerTest.java  |  8 
 .../james/server/core/MimeMessageWrapperTest.java  | 18 ++
 3 files changed, 27 insertions(+), 1 deletion(-)


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



Re: [PR] [FIX] JMAP: Set configurable limits for /get /set objects [james-project]

2024-03-10 Thread via GitHub


Arsnael commented on code in PR #2096:
URL: https://github.com/apache/james-project/pull/2096#discussion_r1519084111


##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/Method.scala:
##
@@ -56,6 +56,35 @@ trait Method {
 trait WithAccountId {
   def accountId: AccountId
 }
+trait GetRequest extends ValidableRequest {

Review Comment:
   Bit of breathing with a line skip between traits maybe?



##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/Method.scala:
##
@@ -56,6 +56,35 @@ trait Method {
 trait WithAccountId {
   def accountId: AccountId
 }
+trait GetRequest extends ValidableRequest {
+  def idCount: Option[Int]
+
+  override def validate(configuration: JmapRfc8621Configuration): 
Either[Exception, GetRequest] =
+if (idCount.exists(value => value > 
configuration.maxObjectsInGet.value.value)) {
+  Left(RequestTooLargeException(s"Too many items in a get request 
${this.getClass}. " +
+s"Got $idCount items instead of maximum 
${configuration.maxObjectsInGet.value}."))
+} else {
+  scala.Right(this)
+}
+}
+trait SetRequest extends ValidableRequest {
+  def idCount: Int
+
+  override def validate(configuration: JmapRfc8621Configuration): 
Either[Exception, SetRequest] =
+validateIdCounts(configuration)
+
+  def validateIdCounts(configuration: JmapRfc8621Configuration) = {
+if (idCount > configuration.maxObjectsInGet.value.value) {
+  Left(RequestTooLargeException(s"Too many items in a set request 
${this.getClass}. " +
+s"Got $idCount items instead of maximum 
${configuration.maxObjectsInSet.value}."))
+} else {
+  scala.Right(this)
+}
+  }
+}
+trait ValidableRequest {

Review Comment:
   idem



##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/Method.scala:
##
@@ -56,6 +56,35 @@ trait Method {
 trait WithAccountId {
   def accountId: AccountId
 }
+trait GetRequest extends ValidableRequest {
+  def idCount: Option[Int]
+
+  override def validate(configuration: JmapRfc8621Configuration): 
Either[Exception, GetRequest] =
+if (idCount.exists(value => value > 
configuration.maxObjectsInGet.value.value)) {
+  Left(RequestTooLargeException(s"Too many items in a get request 
${this.getClass}. " +
+s"Got $idCount items instead of maximum 
${configuration.maxObjectsInGet.value}."))
+} else {
+  scala.Right(this)
+}
+}
+trait SetRequest extends ValidableRequest {

Review Comment:
   idem



##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/Method.scala:
##
@@ -56,6 +56,35 @@ trait Method {
 trait WithAccountId {
   def accountId: AccountId
 }
+trait GetRequest extends ValidableRequest {
+  def idCount: Option[Int]
+
+  override def validate(configuration: JmapRfc8621Configuration): 
Either[Exception, GetRequest] =
+if (idCount.exists(value => value > 
configuration.maxObjectsInGet.value.value)) {
+  Left(RequestTooLargeException(s"Too many items in a get request 
${this.getClass}. " +
+s"Got $idCount items instead of maximum 
${configuration.maxObjectsInGet.value}."))
+} else {
+  scala.Right(this)
+}
+}
+trait SetRequest extends ValidableRequest {
+  def idCount: Int
+
+  override def validate(configuration: JmapRfc8621Configuration): 
Either[Exception, SetRequest] =
+validateIdCounts(configuration)
+
+  def validateIdCounts(configuration: JmapRfc8621Configuration) = {
+if (idCount > configuration.maxObjectsInGet.value.value) {
+  Left(RequestTooLargeException(s"Too many items in a set request 
${this.getClass}. " +
+s"Got $idCount items instead of maximum 
${configuration.maxObjectsInSet.value}."))
+} else {
+  scala.Right(this)
+}
+  }
+}
+trait ValidableRequest {
+  def validate(configuration: JmapRfc8621Configuration): Either[Exception, 
ValidableRequest]
+}
 trait MethodRequiringAccountId[REQUEST <: WithAccountId] extends Method {

Review Comment:
   idem



-- 
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



Re: [PR] [FIX] JMAP: Set configurable limits for /get /set objects [james-project]

2024-03-10 Thread via GitHub


quantranhong1999 commented on code in PR #2096:
URL: https://github.com/apache/james-project/pull/2096#discussion_r1519080682


##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/JmapRfc8621Configuration.scala:
##
@@ -46,6 +46,8 @@ object JmapConfigProperties {
   val DISABLED_CAPABILITIES: String = "disabled.capabilities"
   val JMAP_UPLOAD_QUOTA_LIMIT_PROPERTY: String = "upload.quota.limit"
   val JMAP_EMAIL_GET_FULL_MAX_SIZE_PROPERTY: String = "email.get.full.max.size"
+  val JMAP_GET_MAX_SIZE_PROPERTY: String = "get.max.size"
+  val JMAP_SET_MAX_SIZE_PROPERTY: String = "set.max.size"

Review Comment:
   documentation needed



##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/JmapRfc8621Configuration.scala:
##
@@ -56,6 +58,9 @@ object JmapRfc8621Configuration {
   val MAX_SIZE_ATTACHMENTS_PER_MAIL_DEFAULT: MaxSizeAttachmentsPerEmail = 
MaxSizeAttachmentsPerEmail.of(Size.of(20_000_000L, Size.Unit.B)).get
   val JMAP_UPLOAD_QUOTA_LIMIT_DEFAULT: JmapUploadQuotaLimit = 
JmapUploadQuotaLimit.of(Size.of(200L, Size.Unit.M)).get
   val JMAP_EMAIL_GET_FULL_MAX_SIZE_DEFAULT: JmapEmailGetFullMaxSize = 
JmapEmailGetFullMaxSize(UnsignedInt.liftOrThrow(5))
+  val JMAP_MAX_OBJECT_IN_GET: MaxObjectsInGet = 
MaxObjectsInGet(UnsignedInt.liftOrThrow(500))
+  val JMAP_MAX_OBJECT_IN_EMAIL_GET_FULL: MaxObjectsInGet = 
MaxObjectsInGet(UnsignedInt.liftOrThrow(5))

Review Comment:
   ```suggestion
   ```
   
   Likely duplicated with `JMAP_EMAIL_GET_FULL_MAX_SIZE_DEFAULT`.



-- 
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



Re: [PR] [ENHANCEMENT] Decrease log level for "NotSslRecordException" [james-project]

2024-03-10 Thread via GitHub


quantranhong1999 commented on code in PR #2102:
URL: https://github.com/apache/james-project/pull/2102#discussion_r1519074376


##
server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java:
##
@@ -30,6 +30,7 @@
 import java.util.Optional;
 import java.util.Set;
 
+import io.netty.handler.ssl.NotSslRecordException;

Review Comment:
   Checkstyle: Wrong order for 'javax.net.ssl.SSLHandshakeException' import.
   
   I could not make a quick suggestion, sorry.



-- 
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



[PR] [ENHANCEMENT] Decrease log level for "NotSslRecordException" [james-project]

2024-03-10 Thread via GitHub


chibenwa opened a new pull request, #2102:
URL: https://github.com/apache/james-project/pull/2102

   This pollutes the logs.
   
   ERROR logs are for really bad thing needing immediate admin attention, 
ideally triggering an alarm.
   
   Those are not to be triggered when a guy try telnet on a SMTPS endpoint.
   
   Reducing the log level to info would help making james easier to monitor


-- 
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



[PR] JAMES-2644 Various COntentTypeCleaner enhancements [james-project]

2024-03-10 Thread via GitHub


chibenwa opened a new pull request, #2101:
URL: https://github.com/apache/james-project/pull/2101

   (no comment)


-- 
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



[PR] JAMES-4018 SMTP RCPT TO should parse parameters once [james-project]

2024-03-10 Thread via GitHub


chibenwa opened a new pull request, #2100:
URL: https://github.com/apache/james-project/pull/2100

   (no comment)


-- 
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



[PR] [FIX] Ship mail over web webadmin routes into more apps [james-project]

2024-03-10 Thread via GitHub


chibenwa opened a new pull request, #2099:
URL: https://github.com/apache/james-project/pull/2099

   Reported from the matric channel by البهي
   
   @muhammadbahey_twitter:gitter.im
   
   > I tried to james:jpa-3.8.0 and tried to call curl -XPOST 
/mail-transfer-service but it gives 404 NOT found


-- 
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



[PR] [FIX] RSpamD should not fail when reporting empty body [james-project]

2024-03-10 Thread via GitHub


chibenwa opened a new pull request, #2098:
URL: https://github.com/apache/james-project/pull/2098

   Technicly this can be caused by buggy IMAP clients
   
   When that happens then this causes a cascade of failures with dead letter as 
this gets retried.
   
   Better ignore...


-- 
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 postgresql updated: JAMES 2586 PostgresPushSubscriptionRepository: rely on Postgres unique constraint for deviceClientId (#2094)

2024-03-10 Thread btellier
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/postgresql by this push:
 new 29c85f3fe2 JAMES 2586 PostgresPushSubscriptionRepository: rely on 
Postgres unique constraint for deviceClientId (#2094)
29c85f3fe2 is described below

commit 29c85f3fe23b9d8638fab0505bc839f981b40845
Author: Trần Hồng Quân <55171818+quantranhong1...@users.noreply.github.com>
AuthorDate: Mon Mar 11 03:23:14 2024 +0700

JAMES 2586 PostgresPushSubscriptionRepository: rely on Postgres unique 
constraint for deviceClientId (#2094)

Avoid 2 round trips (checking duplicate deviceClientId + INSERT 
subscription) when saving a subscription.
---
 .../PostgresPushSubscriptionDAO.java   | 17 ++---
 .../PostgresPushSubscriptionModule.java|  8 ---
 .../PostgresPushSubscriptionRepository.java| 28 --
 3 files changed, 29 insertions(+), 24 deletions(-)

diff --git 
a/server/data/data-jmap-postgres/src/main/java/org/apache/james/jmap/postgres/pushsubscription/PostgresPushSubscriptionDAO.java
 
b/server/data/data-jmap-postgres/src/main/java/org/apache/james/jmap/postgres/pushsubscription/PostgresPushSubscriptionDAO.java
index 5d59e08fe2..91b06c248b 100644
--- 
a/server/data/data-jmap-postgres/src/main/java/org/apache/james/jmap/postgres/pushsubscription/PostgresPushSubscriptionDAO.java
+++ 
b/server/data/data-jmap-postgres/src/main/java/org/apache/james/jmap/postgres/pushsubscription/PostgresPushSubscriptionDAO.java
@@ -21,6 +21,8 @@ package org.apache.james.jmap.postgres.pushsubscription;
 
 import static 
org.apache.james.backends.postgres.PostgresCommons.IN_CLAUSE_MAX_SIZE;
 import static 
org.apache.james.backends.postgres.PostgresCommons.OFFSET_DATE_TIME_ZONED_DATE_TIME_FUNCTION;
+import static 
org.apache.james.backends.postgres.utils.PostgresUtils.UNIQUE_CONSTRAINT_VIOLATION_PREDICATE;
+import static 
org.apache.james.jmap.postgres.pushsubscription.PostgresPushSubscriptionModule.PushSubscriptionTable.PRIMARY_KEY_CONSTRAINT;
 
 import java.time.ZonedDateTime;
 import java.util.Arrays;
@@ -28,11 +30,13 @@ import java.util.Collection;
 import java.util.Optional;
 import java.util.Set;
 import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import org.apache.james.backends.postgres.utils.PostgresExecutor;
 import org.apache.james.core.Username;
 import org.apache.james.jmap.api.change.TypeStateFactory;
+import org.apache.james.jmap.api.model.DeviceClientIdInvalidException;
 import org.apache.james.jmap.api.model.PushSubscription;
 import org.apache.james.jmap.api.model.PushSubscriptionExpiredTime;
 import org.apache.james.jmap.api.model.PushSubscriptionId;
@@ -51,6 +55,8 @@ import scala.jdk.javaapi.CollectionConverters;
 import scala.jdk.javaapi.OptionConverters;
 
 public class PostgresPushSubscriptionDAO {
+private static final Predicate IS_PRIMARY_KEY_UNIQUE_CONSTRAINT 
= throwable -> throwable.getMessage().contains(PRIMARY_KEY_CONSTRAINT);
+
 private final PostgresExecutor postgresExecutor;
 private final TypeStateFactory typeStateFactory;
 
@@ -71,7 +77,9 @@ public class PostgresPushSubscriptionDAO {
 .set(PushSubscriptionTable.VERIFICATION_CODE, 
pushSubscription.verificationCode())
 .set(PushSubscriptionTable.VALIDATED, pushSubscription.validated())
 .set(PushSubscriptionTable.ENCRYPT_PUBLIC_KEY, 
OptionConverters.toJava(pushSubscription.keys().map(PushSubscriptionKeys::p256dh)).orElse(null))
-.set(PushSubscriptionTable.ENCRYPT_AUTH_SECRET, 
OptionConverters.toJava(pushSubscription.keys().map(PushSubscriptionKeys::auth)).orElse(null;
+.set(PushSubscriptionTable.ENCRYPT_AUTH_SECRET, 
OptionConverters.toJava(pushSubscription.keys().map(PushSubscriptionKeys::auth)).orElse(null
+
.onErrorMap(UNIQUE_CONSTRAINT_VIOLATION_PREDICATE.and(IS_PRIMARY_KEY_UNIQUE_CONSTRAINT),
+e -> new 
DeviceClientIdInvalidException(pushSubscription.deviceClientId(), 
"deviceClientId must be unique"));
 }
 
 public Flux listByUsername(Username username) {
@@ -134,13 +142,6 @@ public class PostgresPushSubscriptionDAO {
 .map(record -> 
OFFSET_DATE_TIME_ZONED_DATE_TIME_FUNCTION.apply(record.get(PushSubscriptionTable.EXPIRES)));
 }
 
-public Mono existDeviceClientId(Username username, String 
deviceClientId) {
-return postgresExecutor.executeExists(dslContext -> 
dslContext.selectOne()
-.from(PushSubscriptionTable.TABLE_NAME)
-.where(PushSubscriptionTable.USER.eq(username.asString()))
-.and(PushSubscriptionTable.DEVICE_CLIENT_ID.eq(deviceClientId)));
-}
-
 private PushSubscription recordAsPushSubscription(Record record) {
 try {
 return new 

Re: [PR] JAMES 2586 PostgresPushSubscriptionRepository: rely on Postgres unique constraint for deviceClientId [james-project]

2024-03-10 Thread via GitHub


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


-- 
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



Re: [PR] [UPDATE] commons-compress 1.24.0 -> 1.26.0 [james-project]

2024-03-10 Thread via GitHub


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

   Finally!
   
   Review please ;-)


-- 
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



[PR] [FIX] Try recover invalid ascii character in filename [james-project]

2024-03-10 Thread via GitHub


chibenwa opened a new pull request, #2097:
URL: https://github.com/apache/james-project/pull/2097

   (no comment)


-- 
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