Re: [PR] JAMES-2586 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


hungphan227 commented on code in PR #2029:
URL: https://github.com/apache/james-project/pull/2029#discussion_r1507145561


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   > I'm not keen on having modifications on other tests suites than Postgres 
tbh on a separate working branch than master
   
   I have reversed code and used a new solution



-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


hungphan227 commented on code in PR #2029:
URL: https://github.com/apache/james-project/pull/2029#discussion_r1507144868


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   @quantranhong1999 you commented on wrong thread



-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


hungphan227 commented on PR #2029:
URL: https://github.com/apache/james-project/pull/2029#issuecomment-1970588097

   
https://github.com/apache/james-project/pull/2029/commits/81e77471099821a19fcfbbc6c5033ad23331d83a
 has been reversed by 
https://github.com/apache/james-project/pull/2029/commits/02981dd85229a171d570cf61efaf6bc7c2ffa524


-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   I'm exploring an alternative at the moment as well doing like what we 
have with a part of our cassandra test, forcing a restart of the db after 
reaching a certain numbers of tests played



-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


chibenwa commented on code in PR #2068:
URL: https://github.com/apache/james-project/pull/2068#discussion_r1507140243


##
server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/upload/UploadServiceContract.scala:
##
@@ -126,6 +127,7 @@ trait UploadServiceContract {
 .block())
 
 // Exceed 100 bytes limit
+Thread.sleep(500)

Review Comment:
   Why?



-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


chibenwa commented on code in PR #2068:
URL: https://github.com/apache/james-project/pull/2068#discussion_r1507139870


##
server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/upload/UploadDAO.java:
##
@@ -171,6 +171,7 @@ public UploadDAO(CqlSession session, BlobId.Factory 
blobIdFactory) {
 this.delete = session.prepare(deleteFrom(TABLE_NAME)
 .whereColumn(USER).isEqualTo(bindMarker(USER))
 .whereColumn(ID).isEqualTo(bindMarker(ID))
+.ifExists()

Review Comment:
   Please for the postgres branch use @Disable and do not put a LWT in here,



-- 
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-3925 - JMAP Upload - cleanup/fixup/optimize upload usage [james-project]

2024-02-28 Thread via GitHub


chibenwa commented on code in PR #2069:
URL: https://github.com/apache/james-project/pull/2069#discussion_r1507138244


##
server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/upload/UploadDAO.java:
##
@@ -171,6 +171,7 @@ public UploadDAO(CqlSession session, BlobId.Factory 
blobIdFactory) {
 this.delete = session.prepare(deleteFrom(TABLE_NAME)
 .whereColumn(USER).isEqualTo(bindMarker(USER))
 .whereColumn(ID).isEqualTo(bindMarker(ID))
+.ifExists()

Review Comment:
   Using a LWT? Are we sure we need strong consistency?



-- 
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-3925 - JMAP Upload - cleanup/fixup/optimize upload usage [james-project]

2024-02-28 Thread via GitHub


chibenwa commented on code in PR #2069:
URL: https://github.com/apache/james-project/pull/2069#discussion_r1507137814


##
server/data/data-jmap/src/test/java/org/apache/james/jmap/api/upload/UploadRepositoryContract.scala:
##
@@ -188,4 +188,16 @@
.isNotNull
}
 
+   @Test
+   def deleteShouldReturnTrueWhenRowExists(): Unit = {
+ val uploadId: UploadId = SMono.fromPublisher(testee.upload(data(), 
CONTENT_TYPE, USER)).block().uploadId
+
+ assertThat(SMono.fromPublisher(testee.delete(uploadId, 
USER)).block()).isTrue
+   }
+   @Test

Review Comment:
   Missing LF



-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   I'm exploring an alternative at the moment as well doing like what we 
have with a part of our cassandra test, forcing a restart of the db after 
reaching a certain numbers of tests played



-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   I'm exploring an alternative at the moment as well doing like what we 
have with a part of our cassandra test, allowing a restart of the db after 
reaching a certain numbers of tests played



-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   I tend to agree with @Arsnael. We should not modify the contract test unless 
something is actually wrong with the contract test itself.
   
   @hungphan227 maybe try more on releasing the connection upon James shutdown? 
As I think the production code deserves the connection release as well.
   e.g. add this to the `SinglePostgresConnectionFactory`
   ```
   @PreDestroy
   public void dispose() {
   Mono.from(connection.close()).block();
   }
   ```



-- 
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-02-28 Thread via GitHub


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

   org.apache.james.events.PostgresEventDeadLettersTest 
   
   Related?


-- 
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-4007 Improve file buffering [james-project]

2024-02-28 Thread via GitHub


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


##
mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java:
##
@@ -54,6 +56,12 @@ public class FileBufferedBodyFactory implements BodyFactory, 
Disposable {
 
 public static final BasicBodyFactory INSTANCE = new BasicBodyFactory();
 public static final Logger LOGGER = 
LoggerFactory.getLogger(FileBufferedBodyFactory.class);
+public static final int FILE_THRESHOLD = 
Optional.ofNullable(System.getProperty("james.mime4j.buffered.body.factory.file.threshold"))

Review Comment:
   Documentation for this property is needed IMO.



-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


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

   > Can we contribute the non postgres enhancement on jmap upload to master 
branch as well?
   
   I've split it into the master branch here: 
https://github.com/apache/james-project/pull/2069
   
   As it relates to PostgreSQL changes, I'll rebase this pull request later, 
after the master branch has been merged.
   


-- 
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-3925 - JMAP Upload - cleanup/fixup/optimize upload usage [james-project]

2024-02-28 Thread via GitHub


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

   (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



Re: [PR] JAMES-2586 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


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

   The CI failed looks like not related to this pr
   I tried to test it on local, the test passed
   https://github.com/apache/james-project/assets/81145350/19d0d7ab-4c47-49b8-9a96-5d110ea9e231;>
   
   ```
   org.apache.james.DistributedPostgresJamesServerTest
   
   02:47:05.340 [ERROR] t.postgres:16.1 - Could not start container
   org.testcontainers.containers.ContainerLaunchException: Timed out waiting 
for log output matching '.*database system is ready to accept connections.*\s'
at 
org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy.waitUntilReady(LogMessageWaitStrategy.java:47)
at 
org.testcontainers.containers.wait.strategy.AbstractWaitStrategy.waitUntilReady(AbstractWaitStrategy.java:52)
at 
org.testcontainers.containers.PostgreSQLContainer.waitUntilContainerStarted(PostgreSQLContainer.java:147)
   ```


-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


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


##
server/data/data-jmap/src/test/java/org/apache/james/jmap/api/upload/UploadRepositoryContract.scala:
##
@@ -206,4 +206,17 @@
.isNotNull
}
 
+   @Test
+   def deleteShouldReturnTrueWhenRowExists(): Unit = {
+ val uploadId: UploadId = SMono.fromPublisher(testee.upload(data(), 
CONTENT_TYPE, USER)).block().uploadId
+
+ assertThat(SMono.fromPublisher(testee.delete(uploadId, 
USER)).block()).isTrue
+   }
+
+   @Test
+   def deleteShouldReturnFalseWhenRowDoesExists(): Unit = {

Review Comment:
   ```suggestion
  def deleteShouldReturnFalseWhenRowDoesNotExist(): Unit = {
   ```



-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


vttranlina commented on code in PR #2068:
URL: https://github.com/apache/james-project/pull/2068#discussion_r1506928950


##
server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/upload/UploadServiceContract.scala:
##
@@ -108,6 +108,7 @@ trait UploadServiceContract {
 .block())
 
 // Exceed 100 bytes limit
+Thread.sleep(500)

Review Comment:
   It is a difference.
   Here I want the `cleanupUploadIfNeeded` completed (it was called 10 times) 
before triggering "exceed". 



-- 
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 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/QuotaGetMethodContract.scala:
##
@@ -502,6 +502,8 @@ trait QuotaGetMethodContract {
 .build))
   .getMessageId.serialize()
 
+Thread.sleep(1000)

Review Comment:
   Maybe we could think having an await here instead?



-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


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


##
server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/upload/UploadServiceContract.scala:
##
@@ -108,6 +108,7 @@ trait UploadServiceContract {
 .block())
 
 // Exceed 100 bytes limit
+Thread.sleep(500)

Review Comment:
   Q: any chance we can use await?



-- 
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 - JMAP Upload - cleanup, optimize, fix unstable test upload usage [james-project]

2024-02-28 Thread via GitHub


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

   (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



(james-project) 02/03: fixup! [FIX] Avoid forwarding bounces

2024-02-28 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 abecfe9a0b749e2239b498bc6f791f40f260eb4e
Author: Benoit TELLIER 
AuthorDate: Fri Feb 23 09:21:24 2024 +0100

fixup! [FIX] Avoid forwarding bounces
---
 .../modules/ROOT/partials/RecipientRewriteTable.adoc  |  5 -
 .../transport/mailets/RecipientRewriteTable.java  |  9 +++--
 .../mailets/RecipientRewriteTableProcessor.java   | 19 ++-
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/partials/RecipientRewriteTable.adoc
 
b/server/apps/distributed-app/docs/modules/ROOT/partials/RecipientRewriteTable.adoc
index d3fef29688..ec94fac455 100644
--- 
a/server/apps/distributed-app/docs/modules/ROOT/partials/RecipientRewriteTable.adoc
+++ 
b/server/apps/distributed-app/docs/modules/ROOT/partials/RecipientRewriteTable.adoc
@@ -16,4 +16,7 @@ Example:
 The *rewriteSenderUponForward* option (default to true) can be used to prevent 
senders to be rewritten upon forwards in the transport envelope
 (JAMES 3.8.0 default behaviour). *WARNING*: Please note that not rewriting the 
sender will cause issues forwarding emails
 from external senders to external addresses as the DKIM and SPF records will 
not be matching the ones of the sending
-domain.
\ No newline at end of file
+domain.
+
+The *forwardAutoSubmittedEmails* option (default to false) can be used to 
prevent forwarding bounces as such a scenario
+can lead to an infinite loop if the forward recipient bounces the email.
\ No newline at end of file
diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java
index 05b0bc3e10..f146f76a82 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTable.java
@@ -50,10 +50,13 @@ import com.google.common.collect.ImmutableList;
  * 
  * 
  *
- * The rewriteSenderUponForward option (fault to true) can be used to 
prevent senders to be rewritten upon forwards in the transport enveloppe
+ * The rewriteSenderUponForward option (default to true) can be used to 
prevent senders to be rewritten upon forwards in the transport enveloppe
  * (JAMES 3.8.0 default behaviour). WARNING: Please note that not 
rewriting the sender will cause issues forwarding emails
  * from external senders to external addresses as the DKIM and SPF records 
will not be matching the ones of the sending
  * domain.
+ *
+ * The forwardAutoSubmittedEmails option (default to false) can be used 
to prevent forwarding bounces as such a scenario
+ * can lead to an infinite loop if the forward recipient bounces the email.
  */
 public class RecipientRewriteTable extends GenericMailet {
 public static final String ERROR_PROCESSOR = "errorProcessor";
@@ -63,6 +66,7 @@ public class RecipientRewriteTable extends GenericMailet {
 private RecipientRewriteTableProcessor processor;
 private ProcessingState errorProcessor;
 private boolean rewriteSenderUponForward = true;
+private boolean forwardAutoSubmittedEmails = false;
 
 @Inject
 public 
RecipientRewriteTable(org.apache.james.rrt.api.RecipientRewriteTable 
virtualTableStore, DomainList domainList) {
@@ -74,8 +78,9 @@ public class RecipientRewriteTable extends GenericMailet {
 public void init() throws MessagingException {
 errorProcessor = new ProcessingState(getInitParameter(ERROR_PROCESSOR, 
Mail.ERROR));
 rewriteSenderUponForward = 
getBooleanParameter("rewriteSenderUponForward", true);
+forwardAutoSubmittedEmails = 
getBooleanParameter("forwardAutoSubmittedEmails", false);
 processor = new RecipientRewriteTableProcessor(virtualTableStore, 
domainList, getMailetContext(), errorProcessor,
-rewriteSenderUponForward);
+rewriteSenderUponForward, forwardAutoSubmittedEmails);
 }
 
 
diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
index 3220bf55a6..7f49c92719 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
@@ -71,6 +71,7 @@ import com.google.common.collect.Sets;
 public class RecipientRewriteTableProcessor {
 private static final Logger LOGGER = 
LoggerFactory.getLogger(RecipientRewriteTableProcessor.class);
 private static final boolean REWRITE_SENDER_UPON_FORWARD = true;
+private 

(james-project) 01/03: [FIX] Avoid forwarding bounces

2024-02-28 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 cf16dbea09d676030be7451bc49f98aa7b1eb8a8
Author: Benoit TELLIER 
AuthorDate: Wed Feb 14 15:50:44 2024 +0100

[FIX] Avoid forwarding bounces
---
 .../james/transport/mailets/RecipientRewriteTableProcessor.java| 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
index 01e6109312..3220bf55a6 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
@@ -278,7 +278,12 @@ public class RecipientRewriteTableProcessor {
 void apply(Mail mail) throws Exception;
 }
 
-public void processForwards(Mail mail) {
+public void processForwards(Mail mail) throws MessagingException {
+if 
(Optional.ofNullable(mail.getMessage().getHeader("Auto-Submitted")).map(ImmutableList::copyOf).orElse(ImmutableList.of())
+.stream()
+.anyMatch(value -> value.startsWith("auto-replied"))) {
+return;
+}
 if (rewriteSenderUponForward) {
 mail.getRecipients()
 .stream()


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



Re: [PR] JAMES-4003 [FIX] Avoid forwarding bounces as it might create infinite loops [james-project]

2024-02-28 Thread via GitHub


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


-- 
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) 03/03: Update server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java

2024-02-28 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 d3ec938e0aab741b79c9199e6118ee5464ead646
Author: Rene Cordier 
AuthorDate: Wed Feb 28 14:13:41 2024 +0700

Update 
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
---
 .../apache/james/transport/mailets/RecipientRewriteTableProcessor.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
index 7f49c92719..1e2bd047ea 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
@@ -187,7 +187,7 @@ public class RecipientRewriteTableProcessor {
 
 public RecipientRewriteTableProcessor(RecipientRewriteTable 
virtualTableStore, DomainList domainList, MailetContext mailetContext) {
 this(virtualTableStore, domainList, mailetContext, new 
ProcessingState(Mail.ERROR), !REWRITE_SENDER_UPON_FORWARD,
-false);
+!FORWARD_AUTOMATED_EMAILS);
 }
 
 private Domain getDefaultDomain(DomainList domainList) throws 
MessagingException {


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



(james-project) branch master updated (1fb2e4b4f7 -> d3ec938e0a)

2024-02-28 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 1fb2e4b4f7 JAMES-4007 Manage IMAP litteral with Leak aware
 new cf16dbea09 [FIX] Avoid forwarding bounces
 new abecfe9a0b fixup! [FIX] Avoid forwarding bounces
 new d3ec938e0a Update 
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java

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:
 .../modules/ROOT/partials/RecipientRewriteTable.adoc |  5 -
 .../transport/mailets/RecipientRewriteTable.java |  9 +++--
 .../mailets/RecipientRewriteTableProcessor.java  | 20 +---
 3 files changed, 28 insertions(+), 6 deletions(-)


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



(james-project) 07/07: JAMES-4007 Manage IMAP litteral with Leak aware

2024-02-28 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 1fb2e4b4f784bbe8c1e21c7c73e4a2bcbc920337
Author: Benoit TELLIER 
AuthorDate: Tue Feb 27 10:34:11 2024 +0100

JAMES-4007 Manage IMAP litteral with Leak aware
---
 .../imapserver/netty/ImapRequestFrameDecoder.java  | 52 ++
 .../netty/NettyStreamImapRequestLineReader.java| 18 
 2 files changed, 51 insertions(+), 19 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index 4f9fd126a8..fbd8930423 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -36,6 +36,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Consumer;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.imap.api.ImapSessionState;
@@ -43,6 +44,7 @@ import org.apache.james.imap.api.process.ImapSession;
 import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.decode.ImapRequestLineReader;
+import org.apache.james.lifecycle.api.Disposable.LeakAware;
 import org.apache.james.protocols.netty.LineHandlerAware;
 
 import com.github.fge.lambdas.Throwing;
@@ -230,10 +232,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 // Not doing this causes IDLEd IMAP connections to 
clear IMAP append literal while they are processed.
 attachment.remove(SUBSCRIPTION);
 parseImapMessage(ctx, null, attachment, 
Pair.of(reader, size), readerIndex)
-.ifPresent(message -> {
-
-ctx.fireChannelRead(message);
-});
+.ifPresent(ctx::fireChannelRead);
 } catch (DecodingException e) {
 ctx.fireExceptionCaught(e);
 }
@@ -253,18 +252,53 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 }
 }
 
+public static class FileHolderInner extends LeakAware.Resource {
+public static FileHolderInner create() throws IOException {
+return new FileHolderInner(Files.createTempFile("imap-literal", 
".tmp").toFile());
+}
+
+private final File file;
+
+private FileHolderInner(File file) {
+super(() -> FileUtils.deleteQuietly(file));
+this.file = file;
+}
+
+public File getFile() {
+return file;
+}
+}
+
+public static class FileHolder extends LeakAware {
+public static FileHolder create() throws IOException {
+return new FileHolder(FileHolderInner.create());
+}
+
+private final FileHolderInner file;
+
+private FileHolder(FileHolderInner file) {
+super(file);
+this.file = file;
+}
+
+public File getFile() {
+return file.file;
+}
+
+}
+
 static class FileChunkConsumer implements Consumer {
 private final int size;
 private final AtomicInteger written = new AtomicInteger(0);
 private final AtomicBoolean initialized = new AtomicBoolean(false);
 private OutputStream outputStream;
-private File file;
+private FileHolder file;
 
 FileChunkConsumer(int size) {
 this.size = size;
 }
 
-public File getFile() {
+public FileHolder getFile() {
 return file;
 }
 
@@ -279,8 +313,8 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 
 private void initialize() {
 try {
-file = Files.createTempFile("imap-literal", ".tmp").toFile();
-outputStream = new FileOutputStream(file, true);
+file = FileHolder.create();
+outputStream = new FileOutputStream(file.getFile(), true);
 initialized.set(true);
 } catch (IOException e) {
 throw new RuntimeException(e);
@@ -318,7 +352,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 outputStream.close();
 }
 if (file != null) {
-

(james-project) 05/07: JAMES-4007 Remove subscription once data is all received

2024-02-28 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 dc560803d427b77d195a3a6a65c5043bc8f70f77
Author: Benoit TELLIER 
AuthorDate: Mon Feb 26 17:25:23 2024 +0100

JAMES-4007 Remove subscription once data is all received
---
 .../org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index 27628ad1f1..e157c0e8b2 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -227,12 +227,13 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 ImapRequestLineReader reader = new 
NettyStreamImapRequestLineReader(ctx.channel(), fileChunkConsumer.getFile(), 
RETRY);
 
 try {
+// Remove ongoing subscription: now on lifecycle 
of the message will be managed by ImapChannelUpstreamHandler.
+// Not doing this causes IDLEd IMAP connections to 
clear IMAP append literal while they are processed.
+attachment.remove(SUBSCRIPTION);
 parseImapMessage(ctx, null, attachment, 
Pair.of(reader, size), readerIndex)
 .ifPresent(message -> {
+
 ctx.fireChannelRead(message);
-// Remove ongoing subscription: now on 
lifecycle of the message will be managed by ImapChannelUpstreamHandler.
-// Not doing this causes IDLEd IMAP 
connections to clear IMAP append literal while they are processed.
-attachment.remove(SUBSCRIPTION);
 });
 } catch (DecodingException e) {
 ctx.fireExceptionCaught(e);


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



(james-project) branch master updated (7c95b0c086 -> 1fb2e4b4f7)

2024-02-28 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 7c95b0c086 JAMES-1717 Notification Registry - handle case 
Ints.checkedCast throws out of range when expireDate too far (#2051)
 new 6b1ad6d413 JAMES-4007 Flush data before close
 new 7bdf6f4585 JAMES-4007 Quietly delete IMAP litteral
 new 802c18e907 JAMES-4007 Avoid leaking litteral flux
 new a1440fc7dd JAMES-4007 Avoid a callback
 new dc560803d4 JAMES-4007 Remove subscription once data is all received
 new 752b2c01b5 JAMES-4007 ImapRequestFrameDecoder: use concurrentHashMap
 new 1fb2e4b4f7 JAMES-4007 Manage IMAP litteral with Leak aware

The 7 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:
 .../imapserver/netty/ImapRequestFrameDecoder.java  | 115 +
 .../netty/NettyStreamImapRequestLineReader.java|  18 ++--
 2 files changed, 79 insertions(+), 54 deletions(-)


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



(james-project) 03/07: JAMES-4007 Avoid leaking litteral flux

2024-02-28 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 802c18e907a2ccfb6700e4fa8e80df1eef2aa1ba
Author: Benoit TELLIER 
AuthorDate: Mon Feb 26 17:19:00 2024 +0100

JAMES-4007 Avoid leaking litteral flux

The oncomplete was never called causing sinks and flux to
hang around
---
 .../james/imapserver/netty/ImapRequestFrameDecoder.java | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index f4f0717a59..ddee979b0f 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -205,14 +205,14 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 }
 
 private void uploadToAFile(ChannelHandlerContext ctx, ByteBuf in, 
Map attachment, int size, int readerIndex) throws IOException {
-Sinks.Many sink;
+Pair, AtomicInteger> sink;
 
 // check if we have created a temporary file already or if
 // we need to create a new one
 if (attachment.containsKey(SINK)) {
-sink = (Sinks.Many) attachment.get(SINK);
+sink = (Pair, AtomicInteger>) 
attachment.get(SINK);
 } else {
-sink = Sinks.many().unicast().onBackpressureBuffer();
+sink = Pair.of(Sinks.many().unicast().onBackpressureBuffer(), new 
AtomicInteger(0));
 attachment.put(SINK, sink);
 
 FileChunkConsumer fileChunkConsumer = new FileChunkConsumer(size,
@@ -231,7 +231,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 ctx.fireExceptionCaught(e);
 }
 });
-Disposable subscribe = sink.asFlux()
+Disposable subscribe = sink.getLeft().asFlux()
 .publishOn(Schedulers.boundedElastic())
 .subscribe(fileChunkConsumer,
 e -> {
@@ -250,7 +250,10 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 int readableBytes = in.readableBytes();
 byte[] bytes = new byte[readableBytes];
 in.readBytes(bytes);
-sink.emitNext(bytes, FAIL_FAST);
+sink.getLeft().emitNext(bytes, FAIL_FAST);
+if (sink.getRight().addAndGet(readableBytes) >= size) {
+sink.getLeft().tryEmitComplete();
+}
 }
 
 static class FileChunkConsumer implements Consumer {


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



(james-project) 01/07: JAMES-4007 Flush data before close

2024-02-28 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 6b1ad6d413bb59eac3fc2ea4037f93de678a0972
Author: Benoit TELLIER 
AuthorDate: Mon Feb 26 16:41:50 2024 +0100

JAMES-4007 Flush data before close
---
 .../java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index 0888311e36..f4f0717a59 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -311,6 +311,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 
 private void finalizeDataTransfer() {
 try {
+outputStream.flush();
 outputStream.close();
 } catch (IOException ignored) {
 //ignore exception during close


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



(james-project) 02/07: JAMES-4007 Quietly delete IMAP litteral

2024-02-28 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 7bdf6f45856a2c4bc8b9718a3cdffbff821dd2ae
Author: Benoit TELLIER 
AuthorDate: Mon Feb 26 16:43:00 2024 +0100

JAMES-4007 Quietly delete IMAP litteral
---
 .../james/imapserver/netty/NettyStreamImapRequestLineReader.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
index a5b189dab5..e567013f86 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/NettyStreamImapRequestLineReader.java
@@ -24,8 +24,8 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
-import java.nio.file.Files;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.decode.DecodingException;
 import org.apache.james.imap.message.Literal;
@@ -57,7 +57,7 @@ public class NettyStreamImapRequestLineReader extends 
AbstractNettyImapRequestLi
 
 @Override
 public void close() {
-Mono.fromRunnable(Throwing.runnable(() -> 
Files.delete(file.toPath(
+Mono.fromRunnable(Throwing.runnable(() -> 
FileUtils.deleteQuietly(file)))
 .subscribeOn(Schedulers.boundedElastic())
 .subscribe();
 }


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



(james-project) 06/07: JAMES-4007 ImapRequestFrameDecoder: use concurrentHashMap

2024-02-28 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 752b2c01b5f51e2c08f8d9b0509b94423580c4a7
Author: Benoit TELLIER 
AuthorDate: Mon Feb 26 17:26:22 2024 +0100

JAMES-4007 ImapRequestFrameDecoder: use concurrentHashMap

Because file buffering might access this but outside of
the event loop
---
 .../org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index e157c0e8b2..4f9fd126a8 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -27,10 +27,10 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.file.Files;
 import java.util.Deque;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedDeque;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -59,7 +59,6 @@ import reactor.core.publisher.Mono;
 import reactor.core.publisher.Sinks;
 import reactor.core.scheduler.Schedulers;
 
-
 /**
  * {@link ByteToMessageDecoder} which will decode via and {@link ImapDecoder} 
instance
  */
@@ -86,7 +85,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 
 @Override
 public void channelActive(ChannelHandlerContext ctx) throws Exception {
-ctx.channel().attr(FRAME_DECODE_ATTACHMENT_ATTRIBUTE_KEY).set(new 
HashMap<>());
+ctx.channel().attr(FRAME_DECODE_ATTACHMENT_ATTRIBUTE_KEY).set(new 
ConcurrentHashMap<>());
 super.channelActive(ctx);
 }
 


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



(james-project) 04/07: JAMES-4007 Avoid a callback

2024-02-28 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 a1440fc7dd1d3cc876b6a2ca47ed756d58f01103
Author: Benoit TELLIER 
AuthorDate: Mon Feb 26 17:22:56 2024 +0100

JAMES-4007 Avoid a callback
---
 .../imapserver/netty/ImapRequestFrameDecoder.java  | 61 +-
 1 file changed, 25 insertions(+), 36 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index ddee979b0f..27628ad1f1 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -34,7 +34,6 @@ import java.util.Optional;
 import java.util.concurrent.ConcurrentLinkedDeque;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.BiConsumer;
 import java.util.function.Consumer;
 
 import org.apache.commons.lang3.tuple.Pair;
@@ -215,22 +214,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 sink = Pair.of(Sinks.many().unicast().onBackpressureBuffer(), new 
AtomicInteger(0));
 attachment.put(SINK, sink);
 
-FileChunkConsumer fileChunkConsumer = new FileChunkConsumer(size,
-(file, written) -> {
-ImapRequestLineReader reader = new 
NettyStreamImapRequestLineReader(ctx.channel(), file, RETRY);
-
-try {
-parseImapMessage(ctx, null, attachment, 
Pair.of(reader, size), readerIndex)
-.ifPresent(message -> {
-ctx.fireChannelRead(message);
-// Remove ongoing subscription: now on 
lifecycle of the message will be managed by ImapChannelUpstreamHandler.
-// Not doing this causes IDLEd IMAP 
connections to clear IMAP append literal while they are processed.
-attachment.remove(SUBSCRIPTION);
-});
-} catch (DecodingException e) {
-ctx.fireExceptionCaught(e);
-}
-});
+FileChunkConsumer fileChunkConsumer = new FileChunkConsumer(size);
 Disposable subscribe = sink.getLeft().asFlux()
 .publishOn(Schedulers.boundedElastic())
 .subscribe(fileChunkConsumer,
@@ -239,7 +223,20 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 ctx.fireExceptionCaught(e);
 },
 () -> {
-
+fileChunkConsumer.finalizeDataTransfer();
+ImapRequestLineReader reader = new 
NettyStreamImapRequestLineReader(ctx.channel(), fileChunkConsumer.getFile(), 
RETRY);
+
+try {
+parseImapMessage(ctx, null, attachment, 
Pair.of(reader, size), readerIndex)
+.ifPresent(message -> {
+ctx.fireChannelRead(message);
+// Remove ongoing subscription: now on 
lifecycle of the message will be managed by ImapChannelUpstreamHandler.
+// Not doing this causes IDLEd IMAP 
connections to clear IMAP append literal while they are processed.
+attachment.remove(SUBSCRIPTION);
+});
+} catch (DecodingException e) {
+ctx.fireExceptionCaught(e);
+}
 });
 attachment.put(SUBSCRIPTION, (Disposable) () -> {
 // Clear the file if the connection is reset while buffering 
the litteral.
@@ -259,14 +256,16 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 static class FileChunkConsumer implements Consumer {
 private final int size;
 private final AtomicInteger written = new AtomicInteger(0);
-private final BiConsumer callback;
 private final AtomicBoolean initialized = new AtomicBoolean(false);
 private OutputStream outputStream;
-private File f;
+private File file;
 
-FileChunkConsumer(int size, BiConsumer callback) {
+FileChunkConsumer(int size) {
 this.size = size;
-this.callback = callback;
+}
+
+public File getFile() {
+return file;
 }
 
 @Override
@@ -276,17 +275,12 @@ public class 

Re: [PR] JAMES-4007 Getting a second shot at IMAP large litteral management [james-project]

2024-02-28 Thread via GitHub


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


-- 
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: JAMES-1717 Notification Registry - handle case Ints.checkedCast throws out of range when expireDate too far (#2051)

2024-02-28 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 7c95b0c086 JAMES-1717 Notification Registry - handle case 
Ints.checkedCast throws out of range when expireDate too far (#2051)
7c95b0c086 is described below

commit 7c95b0c086f656d1461e90e5b7045db5915149e5
Author: vttran 
AuthorDate: Thu Feb 29 00:30:00 2024 +0700

JAMES-1717 Notification Registry - handle case Ints.checkedCast throws out 
of range when expireDate too far (#2051)
---
 .../vacation/cassandra/CassandraNotificationRegistry.java | 12 +++-
 .../cassandra/CassandraNotificationRegistryTest.java  | 15 +++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git 
a/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistry.java
 
b/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistry.java
index 5471061322..5ddc9d06cc 100644
--- 
a/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistry.java
+++ 
b/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistry.java
@@ -51,7 +51,7 @@ public class CassandraNotificationRegistry implements 
NotificationRegistry {
 
 @Override
 public Mono register(AccountId accountId, RecipientId recipientId, 
Optional expiryDate) {
-Optional waitDelay = expiryDate.map(expiry -> 
Ints.checkedCast(zonedDateTimeProvider.get().until(expiry, 
ChronoUnit.SECONDS)));
+Optional waitDelay = evaluateWaitDelay(expiryDate);
 if (isValid(waitDelay)) {
 return cassandraNotificationRegistryDAO.register(accountId, 
recipientId, waitDelay);
 } else {
@@ -60,6 +60,16 @@ public class CassandraNotificationRegistry implements 
NotificationRegistry {
 }
 }
 
+private Optional evaluateWaitDelay(Optional 
expiryDate) {
+return expiryDate.map(expiry -> 
zonedDateTimeProvider.get().until(expiry, ChronoUnit.SECONDS))
+.flatMap(longValue -> {
+if (longValue >= Integer.MAX_VALUE || longValue <= 
Integer.MIN_VALUE) {
+return Optional.empty();
+}
+return Optional.of(Ints.checkedCast(longValue));
+});
+}
+
 @Override
 public Mono isRegistered(AccountId accountId, RecipientId 
recipientId) {
 return cassandraNotificationRegistryDAO.isRegistered(accountId, 
recipientId);
diff --git 
a/server/data/data-cassandra/src/test/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryTest.java
 
b/server/data/data-cassandra/src/test/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryTest.java
index 57c09b7bf6..11f4435bf8 100644
--- 
a/server/data/data-cassandra/src/test/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryTest.java
+++ 
b/server/data/data-cassandra/src/test/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryTest.java
@@ -19,6 +19,11 @@
 
 package org.apache.james.vacation.cassandra;
 
+import static org.assertj.core.api.Assertions.assertThatCode;
+import static org.mockito.Mockito.when;
+
+import java.util.Optional;
+
 import org.apache.james.backends.cassandra.CassandraCluster;
 import org.apache.james.backends.cassandra.CassandraClusterExtension;
 import org.apache.james.core.MailAddress;
@@ -26,6 +31,7 @@ import org.apache.james.vacation.api.NotificationRegistry;
 import org.apache.james.vacation.api.NotificationRegistryContract;
 import org.apache.james.vacation.api.RecipientId;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 class CassandraNotificationRegistryTest implements 
NotificationRegistryContract {
@@ -49,4 +55,13 @@ class CassandraNotificationRegistryTest implements 
NotificationRegistryContract
 public RecipientId recipientId() {
 return recipientId;
 }
+
+@Test
+void registerShouldNotFailedWhenExpiredIsTooFar() {
+when(zonedDateTimeProvider.get()).thenReturn(ZONED_DATE_TIME);
+
+assertThatCode(() -> notificationRegistry().register(ACCOUNT_ID, 
recipientId(), Optional.of(ZONED_DATE_TIME_PLUS_8_SECONDS)).block())
+.doesNotThrowAnyException();
+}
+
 }


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



Re: [PR] JAMES-1717 Notification Registry - handle case Ints.checkedCast throws out of range when expireDate too far [james-project]

2024-02-28 Thread via GitHub


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


-- 
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-4006 Bouncer should pass DSN to bounce processor (3.8.x) [james-project]

2024-02-28 Thread via GitHub


ottoka merged PR #2066:
URL: https://github.com/apache/james-project/pull/2066


-- 
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 3.8.x updated: JAMES-4006 Bouncer should pass DSN to bounce processor

2024-02-28 Thread kao
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/3.8.x by this push:
 new e4bbc04be0 JAMES-4006 Bouncer should pass DSN to bounce processor
e4bbc04be0 is described below

commit e4bbc04be00e411477660c374b0d6865a8d17896
Author: Karsten Otto 
AuthorDate: Wed Feb 28 09:03:28 2024 +0100

JAMES-4006 Bouncer should pass DSN to bounce processor
---
 .../transport/mailets/remote/delivery/Bouncer.java | 44 +++---
 .../mailets/remote/delivery/BouncerTest.java   | 12 --
 2 files changed, 31 insertions(+), 25 deletions(-)

diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remote/delivery/Bouncer.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remote/delivery/Bouncer.java
index c073d0a043..d5528934f7 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remote/delivery/Bouncer.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remote/delivery/Bouncer.java
@@ -54,21 +54,17 @@ public class Bouncer {
 }
 
 public void bounce(Mail mail, Exception ex) {
-if (!mail.hasSender()) {
-LOGGER.debug("Null Sender: no bounce will be generated for {}", 
mail.getName());
-} else {
-configuration.getBounceProcessor().ifPresentOrElse(
-bounceProcessor -> {
-computeErrorCode(ex).ifPresent(mail::setAttribute);
-mail.setAttribute(new Attribute(DELIVERY_ERROR, 
AttributeValue.of(getErrorMsg(ex;
-try {
-mailetContext.sendMail(mail, 
bounceProcessor.getValue());
-} catch (MessagingException e) {
-LOGGER.warn("Exception re-inserting failed mail: ", e);
-}
-},
-() -> bounceWithMailetContext(mail, ex));
-}
+configuration.getBounceProcessor().ifPresentOrElse(
+bounceProcessor -> {
+computeErrorCode(ex).ifPresent(mail::setAttribute);
+mail.setAttribute(new Attribute(DELIVERY_ERROR, 
AttributeValue.of(getErrorMsg(ex;
+try {
+mailetContext.sendMail(mail, bounceProcessor.getValue());
+} catch (MessagingException e) {
+LOGGER.warn("Exception re-inserting failed mail: ", e);
+}
+},
+() -> bounceWithMailetContext(mail, ex));
 }
 
 private Optional computeErrorCode(Exception ex) {
@@ -81,13 +77,17 @@ public class Bouncer {
 }
 
 private void bounceWithMailetContext(Mail mail, Exception ex) {
-LOGGER.debug("Sending failure message {}", mail.getName());
-try {
-mailetContext.bounce(mail, explanationText(mail, ex));
-} catch (MessagingException me) {
-LOGGER.warn("Encountered unexpected messaging exception while 
bouncing message", me);
-} catch (Exception e) {
-LOGGER.warn("Encountered unexpected exception while bouncing 
message", e);
+if (!mail.hasSender()) {
+LOGGER.debug("Null Sender: no bounce will be generated for {}", 
mail.getName());
+} else {
+LOGGER.debug("Sending failure message {}", mail.getName());
+try {
+mailetContext.bounce(mail, explanationText(mail, ex));
+} catch (MessagingException me) {
+LOGGER.warn("Encountered unexpected messaging exception while 
bouncing message", me);
+} catch (Exception e) {
+LOGGER.warn("Encountered unexpected exception while bouncing 
message", e);
+}
 }
 }
 
diff --git 
a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/BouncerTest.java
 
b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/BouncerTest.java
index 86b7e9c1b3..531192dfa5 100644
--- 
a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/BouncerTest.java
+++ 
b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/BouncerTest.java
@@ -330,7 +330,7 @@ class BouncerTest {
 }
 
 @Test
-void bounceShouldNotBounceWhenNoSenderWhenProcessorSpecified() throws 
Exception {
+void bounceShouldWorkWhenProcessorSpecifiedAndNoSender() throws Exception {
 RemoteDeliveryConfiguration configuration = new 
RemoteDeliveryConfiguration(
 FakeMailetConfig.builder()
 .setProperty(RemoteDeliveryConfiguration.HELO_NAME, HELLO_NAME)
@@ -341,9 +341,15 @@ class BouncerTest {
 
 Mail mail = FakeMail.builder().name("name").state(Mail.DEFAULT)
 .build();
-testee.bounce(mail, new 

(james-site) branch asf-staging updated: Site checkin for project Apache James: Jenkins Tools

2024-02-28 Thread git-site-role
This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/james-site.git


The following commit(s) were added to refs/heads/asf-staging by this push:
 new 02226633f Site checkin for project Apache James: Jenkins Tools
02226633f is described below

commit 02226633fc11993092a3c324a0041e86b101b11c
Author: jenkins 
AuthorDate: Wed Feb 28 12:09:27 2024 +

Site checkin for project Apache James: Jenkins Tools
---
 sitemap-james-project.xml | 92 +++
 sitemap-james-site.xml|  4 +--
 2 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/sitemap-james-project.xml b/sitemap-james-project.xml
index 88b652fe0..3e34883d0 100644
--- a/sitemap-james-project.xml
+++ b/sitemap-james-project.xml
@@ -2,186 +2,186 @@
 http://www.sitemaps.org/schemas/sitemap/0.9;>
 
 
https://james.apache.org/james-project/3.8.1/community/contributing.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/community/download.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/community/guidelines.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/community/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/community/mailing-lists.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/community/release.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/community/support.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/community/website.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/configuration.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/concepts/glossary.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/concepts/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/mail/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/messages/imf.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/messages/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/messages/mime.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/processing/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/esmtp.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/imap.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/jmap.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/lmtp.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/pop.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/smtp.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/storage/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/storage/mailbox.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/storage/users.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/user/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/customization/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/development/deployment-tests.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 https://james.apache.org/james-project/3.8.1/development/index.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 
https://james.apache.org/james-project/3.8.1/development/logging.html
-2024-02-28T07:37:22.224Z
+2024-02-28T12:09:10.895Z
 
 
 

[PR] JAMES-4007 Improve file buffering [james-project]

2024-02-28 Thread via GitHub


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

   (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



Re: [PR] JAMES-2586 Integration tests for JMAP postgres [james-project]

2024-02-28 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedAuthenticationTest.java:
##
@@ -52,6 +52,5 @@ class DistributedAuthenticationTest implements 
AuthenticationContract {
 .extension(new AwsS3BlobStoreExtension())
 .server(configuration -> 
CassandraRabbitMQJamesServerMain.createServer(configuration)
 .overrideWith(new TestJMAPServerModule()))
-.lifeCycle(JamesServerExtension.Lifecycle.PER_ENCLOSING_CLASS)

Review Comment:
   I'm not keen on having modifications on other tests suites than Postgres tbh 
on a separate working branch than master



-- 
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 3996 Redis event bus POC [james-project]

2024-02-28 Thread via GitHub


quantranhong1999 commented on PR #2028:
URL: https://github.com/apache/james-project/pull/2028#issuecomment-1968540260

   Hi,
   
   I want to share the performance test and metrics results for this POC.
   
   ## Performance test
   Perf test result generally is good as it is a bit better than 0.8.2. No 
related error logs.
   
   ### IMAP
   ![Screenshot from 2024-02-26 
15-40-19](https://github.com/apache/james-project/assets/55171818/0322c85c-1202-4073-ad3d-ce8bba9c7438)
   
   The **SELECT** command (which uses `eventBus.register`) has better perf on 
Redis POC than RabbitMQ one (from TMail 0.8.2 release): p99 911ms compared to 
1590ms.
   
   ## JMAP
   ![Screenshot from 2024-02-26 
16-19-14](https://github.com/apache/james-project/assets/55171818/6bf0a858-fda3-4b94-85d1-58be57261b49)
   
   ## Event bus key metrics
   
   Redis metrics generally outperform RabbitMQ. 
   
   ### Redis POC
   ```
   # HELP redis_register Generated from Dropwizard metric import 
(metric=redis-register, type=com.codahale.metrics.Timer)
   # TYPE redis_register summary
   redis_register{quantile="0.5",} 9.29791E-4
   redis_register{quantile="0.75",} 0.00135987101
   redis_register{quantile="0.95",} 0.00337510304
   redis_register{quantile="0.98",} 0.005308415
   redis_register{quantile="0.99",} 0.00770047905
   redis_register{quantile="0.999",} 0.0445644794
   redis_register_count 21670.0
   ```
   => p99 7ms for registering a key
   
   ```
   # HELP redis_dispatch Generated from Dropwizard metric import 
(metric=redis-dispatch, type=com.codahale.metrics.Timer)
   # TYPE redis_dispatch summary
   redis_dispatch{quantile="0.5",} 0.00161382301
   redis_dispatch{quantile="0.75",} 0.002506751
   redis_dispatch{quantile="0.95",} 0.0048496631
   redis_dispatch{quantile="0.98",} 0.007143423
   redis_dispatch{quantile="0.99",} 0.0099614711
   redis_dispatch{quantile="0.999",} 0.045350911
   redis_dispatch_count 205453.0
   ```
=> p99 10ms for dispatching an event
   
   ```
   # HELP redis_unregister Generated from Dropwizard metric import 
(metric=redis-unregister, type=com.codahale.metrics.Timer)
   # TYPE rabbit_unregister summary
   redis_unregister{quantile="0.5",} 0.001040383
   redis_unregister{quantile="0.75",} 0.00171212701
   redis_unregister{quantile="0.95",} 0.0252968953
   redis_unregister{quantile="0.98",} 0.0348651514
   redis_unregister{quantile="0.99",} 0.0584581110001
   redis_unregister{quantile="0.999",} 0.070254591
   redis_unregister_count 21670.0
   ```
=> p99 58ms for unregistering a key (a bit surprising as it is higher than 
2 above)
   
   ### RabbitMQ
   
   ```
   # HELP rabbit_register Generated from Dropwizard metric import 
(metric=rabbit-register, type=com.codahale.metrics.Timer)
   # TYPE rabbit_register summary
   rabbit_register{quantile="0.5",} 3.135E-6
   rabbit_register{quantile="0.75",} 0.0279183352
   rabbit_register{quantile="0.95",} 3.019898879003
   rabbit_register{quantile="0.98",} 6.67733196701
   rabbit_register{quantile="0.99",} 9.328132095
   rabbit_register{quantile="0.999",} 13.623099391
   rabbit_register_count 18846.0
   ```
   
   => p99 9 seconds 0.0 for registering a key
   
   ```
   # HELP rabbit_dispatch Generated from Dropwizard metric import 
(metric=rabbit-dispatch, type=com.codahale.metrics.Timer)
   # TYPE rabbit_dispatch summary
   rabbit_dispatch{quantile="0.5",} 5.57055E-4
   rabbit_dispatch{quantile="0.75",} 7.98719E-4
   rabbit_dispatch{quantile="0.95",} 0.001941503
   rabbit_dispatch{quantile="0.98",} 0.00340787103
   rabbit_dispatch{quantile="0.99",} 0.005931007
   rabbit_dispatch{quantile="0.999",} 6.509559807005
   rabbit_dispatch_count 174339.0
   ```
   
   => p99 5ms for dispatching an event
   
   ```
   # HELP rabbit_unregister Generated from Dropwizard metric import 
(metric=rabbit-unregister, type=com.codahale.metrics.Timer)
   # TYPE rabbit_unregister summary
   rabbit_unregister{quantile="0.5",} 0.1148190710001
   rabbit_unregister{quantile="0.75",} 0.327155711
   rabbit_unregister{quantile="0.95",} 2.038431743003
   rabbit_unregister{quantile="0.98",} 4.177526783
   rabbit_unregister{quantile="0.99",} 10.737418239
   rabbit_unregister{quantile="0.999",} 25.90402150303
   rabbit_unregister_count 1295.0
   ```
   
   => p99 10 seconds 0.0 for unregistering a key


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

Re: [PR] JAMES 3996 Redis event bus POC [james-project]

2024-02-28 Thread via GitHub


quantranhong1999 commented on PR #2028:
URL: https://github.com/apache/james-project/pull/2028#issuecomment-1968513440

   > I tried to run RabbitMQEventBusTest on local,
   
   Well the `OutOfMemoryError` may be related to the `Flux> observeChannels();` usage (we should use it more carefully):
   
   
![image](https://github.com/apache/james-project/assets/55171818/a1708c13-6803-44bf-b20d-9d98dd59a21e)
   


-- 
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 3996 Redis event bus POC [james-project]

2024-02-28 Thread via GitHub


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

   Good job
   
   I tried to run RabbitMQEventBusTest on local, 
   
![image](https://github.com/apache/james-project/assets/81145350/6ff393a7-f75e-4d44-89a8-02aed93189de)
   


-- 
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] POC Make all queues on Rabbitmq quorum queue when quorum option is en… [james-project]

2024-02-28 Thread via GitHub


chibenwa commented on code in PR #2065:
URL: https://github.com/apache/james-project/pull/2065#discussion_r1505546533


##
event-bus/distributed/src/main/java/org/apache/james/events/KeyReconnectionHandler.java:
##
@@ -56,7 +55,7 @@ public KeyReconnectionHandler(NamingStrategy namingStrategy, 
EventBusId eventBus
 public Publisher handleReconnection(Connection connection) {
 return Mono.fromRunnable(() -> {
 try (Channel channel = connection.createChannel()) {
-QueueArguments.Builder builder = 
configuration.workQueueArgumentsBuilder(!ALLOW_QUORUM);
+QueueArguments.Builder builder = 
configuration.workQueueArgumentsBuilder();
 configuration.getQueueTTL().ifPresent(builder::queueTTL);

Review Comment:
   Are those options compatible?



-- 
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] [BUILD] Use git-commit-id-maven-plugin in ci-test [james-project]

2024-02-28 Thread via GitHub


jeantil commented on PR #2063:
URL: https://github.com/apache/james-project/pull/2063#issuecomment-1968451667

`ci-test` is only applied for test execution, neither build nor deploy
   stage will execute the plugin.
   
   I think we reuse the output of the previous stage to execute the next so it
   might work and unblock you. I'll revisit this when I'm back from vacation
   
   
   Le mer. 28 févr. 2024 à 04:55, vttran ***@***.***> a écrit :
   
   > ***@***. approved this pull request.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > 
,
   > or unsubscribe
   > 

   > .
   > You are receiving this because you are subscribed to this thread.Message
   > ID: ***@***.***>
   >
   


-- 
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-4006 Bouncer should pass DSN to bounce processor (3.8.x) [james-project]

2024-02-28 Thread via GitHub


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

   Cherrypick from master.
   
   This fixes an inconsistent behavior, so it should be on the stable branch as 
well.


-- 
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] POC Make all queues on Rabbitmq quorum queue when quorum option is en… [james-project]

2024-02-28 Thread via GitHub


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

   …abled


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