Re: [PR] JAMES-2586 Fix PostgresAuthenticationTest [james-project]

2024-03-03 Thread via GitHub


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

   Please rebase


-- 
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) 01/02: JAMES-2586 Integration tests for JMAP postgres

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

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

commit 5e2bc8ab720fc513da9d2cb7cc9e9538c2c1ab26
Author: hung phan 
AuthorDate: Tue Feb 20 18:09:35 2024 +0700

JAMES-2586 Integration tests for JMAP postgres
---
 Jenkinsfile|   1 +
 .../james/backends/postgres/PostgresExtension.java |  14 +++
 .../java/org/apache/james/PostgresJmapModule.java  |   3 +-
 .../modules/mailbox/PostgresMailboxModule.java |   3 +-
 .../PushSubscriptionSetMethodContract.scala|   3 +
 .../rfc8621/contract/QuotaGetMethodContract.scala  | 134 +++--
 .../jmap-rfc-8621-integration-tests/pom.xml|   1 +
 .../pom.xml|  97 +++
 .../postgres/PostgresAuthenticationTest.java   |  57 +
 .../james/jmap/rfc8621/postgres/PostgresBase.java  |  59 +
 .../rfc8621/postgres/PostgresCustomMethodTest.java |  58 +
 .../postgres/PostgresCustomNamespaceTest.java  |  58 +
 .../PostgresDelegatedAccountGetMethodTest.java |  25 
 .../postgres/PostgresDelegatedAccountSetTest.java  |  25 
 .../rfc8621/postgres/PostgresDownloadTest.java |  33 +
 .../rfc8621/postgres/PostgresEchoMethodTest.java   |  25 
 .../postgres/PostgresEmailChangesMethodTest.java   |  69 +++
 .../postgres/PostgresEmailGetMethodTest.java   |  33 +
 .../postgres/PostgresEmailQueryMethodTest.java |  25 
 .../postgres/PostgresEmailSetMethodTest.java   |  53 
 ...sEmailSubmissionSetMethodFutureReleaseTest.java |  95 +++
 .../PostgresEmailSubmissionSetMethodTest.java  |  33 +
 .../rfc8621/postgres/PostgresIdentityGetTest.java  |  25 
 .../rfc8621/postgres/PostgresIdentitySetTest.java  |  25 
 .../postgres/PostgresMDNParseMethodTest.java   |  33 +
 .../postgres/PostgresMDNSendMethodTest.java|  33 +
 .../postgres/PostgresMailboxChangesMethodTest.java |  76 
 .../postgres/PostgresMailboxGetMethodTest.java |  31 +
 .../postgres/PostgresMailboxQueryChangesTest.java  |  25 
 .../postgres/PostgresMailboxQueryMethodTest.java   |  25 
 .../postgres/PostgresMailboxSetMethodTest.java |  51 
 .../rfc8621/postgres/PostgresProvisioningTest.java |  25 
 .../PostgresPushSubscriptionSetMethodTest.java |  64 ++
 .../postgres/PostgresQuotaChangesMethodTest.java   |  25 
 .../postgres/PostgresQuotaGetMethodTest.java   |  25 
 .../postgres/PostgresQuotaQueryMethodTest.java |  25 
 .../postgres/PostgresSessionRoutesTest.java|  25 
 .../rfc8621/postgres/PostgresThreadGetTest.java| 115 ++
 .../jmap/rfc8621/postgres/PostgresUploadTest.java  |  25 
 .../PostgresVacationResponseGetMethodTest.java |  25 
 .../PostgresVacationResponseSetMethodTest.java |  25 
 .../jmap/rfc8621/postgres/PostgresWebPushTest.java |  68 +++
 .../rfc8621/postgres/PostgresWebSocketTest.java|  25 
 .../src/test/resources/dnsservice.xml  |  25 
 .../src/test/resources/domainlist.xml  |  24 
 .../src/test/resources/imapserver.xml  |  24 
 .../src/test/resources/jmap.properties |   7 ++
 .../src/test/resources/keystore| Bin 0 -> 2245 bytes
 .../src/test/resources/listeners.xml   |  26 
 .../src/test/resources/mailetcontainer.xml |  98 +++
 .../src/test/resources/mailrepositorystore.xml |  30 +
 .../src/test/resources/managesieveserver.xml   |  32 +
 .../src/test/resources/pop3server.xml  |  23 
 .../src/test/resources/rabbitmq.properties |   2 +
 .../src/test/resources/smtpserver.xml  |  53 
 .../src/test/resources/usersrepository.xml |  25 
 56 files changed, 2001 insertions(+), 68 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 7dbb249737..65a65d5a5a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -46,6 +46,7 @@ pipeline {
 'server/container/guice/postgres-common,' +
 'server/container/guice/mailbox-postgres,' +
 'server/apps/postgres-app,' +
+
'server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests,'
 +
 
'server/protocols/webadmin-integration-test/postgres-webadmin-integration-test,'
 +
 'mpt/impl/imap-mailbox/postgres,' +
 'event-bus/postgres,' +
diff --git 
a/backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresExtension.java
 
b/backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresExtension.java
index bde60c3d4b..e21f846a1b 100644
--- 

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

2024-03-03 Thread via GitHub


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

   Please rebase


-- 
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/02: JAMES-2586 Disable some tests in Integration tests JMAP postgres

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

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

commit bbf0ef826441b8266b0c381851761704334f785d
Author: hung phan 
AuthorDate: Wed Feb 21 09:50:29 2024 +0700

JAMES-2586 Disable some tests in Integration tests JMAP postgres
---
 .../rfc8621/postgres/PostgresAuthenticationTest.java|  3 +++
 .../rfc8621/postgres/PostgresEmailGetMethodTest.java|  3 +++
 .../rfc8621/postgres/PostgresEmailQueryMethodTest.java  |  3 +++
 .../rfc8621/postgres/PostgresMailboxSetMethodTest.java  | 14 ++
 .../postgres/PostgresPushSubscriptionSetMethodTest.java | 17 +
 .../jmap/rfc8621/postgres/PostgresThreadGetTest.java|  3 +++
 6 files changed, 43 insertions(+)

diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresAuthenticationTest.java
 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresAuthenticationTest.java
index 57e4f56dca..8d1922e72a 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresAuthenticationTest.java
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresAuthenticationTest.java
@@ -31,8 +31,11 @@ import 
org.apache.james.jmap.rfc8621.contract.AuthenticationContract;
 import org.apache.james.modules.RabbitMQExtension;
 import org.apache.james.modules.TestJMAPServerModule;
 import org.apache.james.modules.blobstore.BlobStoreConfiguration;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
+@Disabled
+// TODO Need to fix
 public class PostgresAuthenticationTest implements AuthenticationContract {
 @RegisterExtension
 static JamesServerExtension testExtension = new 
JamesServerBuilder(tmpDir ->
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailGetMethodTest.java
 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailGetMethodTest.java
index 43e5c293fc..96da1f79ea 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailGetMethodTest.java
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailGetMethodTest.java
@@ -22,7 +22,10 @@ package org.apache.james.jmap.rfc8621.postgres;
 import org.apache.james.jmap.rfc8621.contract.EmailGetMethodContract;
 import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.postgres.PostgresMessageId;
+import org.junit.jupiter.api.Disabled;
 
+@Disabled
+// TODO Need to fix
 public class PostgresEmailGetMethodTest extends PostgresBase implements 
EmailGetMethodContract {
 public static final PostgresMessageId.Factory MESSAGE_ID_FACTORY = new 
PostgresMessageId.Factory();
 
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailQueryMethodTest.java
 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailQueryMethodTest.java
index 814292041d..3d4c3d336c 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailQueryMethodTest.java
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresEmailQueryMethodTest.java
@@ -20,6 +20,9 @@
 package org.apache.james.jmap.rfc8621.postgres;
 
 import org.apache.james.jmap.rfc8621.contract.EmailQueryMethodContract;
+import org.junit.jupiter.api.Disabled;
 
+@Disabled
+// TODO Need to fix
 public class PostgresEmailQueryMethodTest extends PostgresBase implements 
EmailQueryMethodContract {
 }
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresMailboxSetMethodTest.java
 
b/server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresMailboxSetMethodTest.java
index 8346421fb1..20d62878ee 100644
--- 

(james-project) branch postgresql updated (cefca128d7 -> bbf0ef8264)

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

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


from cefca128d7 JAMES-2586 - Postgres push subscription - expires value 
should be stored Offset time
 new 5e2bc8ab72 JAMES-2586 Integration tests for JMAP postgres
 new bbf0ef8264 JAMES-2586 Disable some tests in Integration tests JMAP 
postgres

The 2 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:
 Jenkinsfile|   1 +
 .../james/backends/postgres/PostgresExtension.java |  14 +++
 .../java/org/apache/james/PostgresJmapModule.java  |   3 +-
 .../modules/mailbox/PostgresMailboxModule.java |   3 +-
 .../PushSubscriptionSetMethodContract.scala|   3 +
 .../rfc8621/contract/QuotaGetMethodContract.scala  | 134 +++--
 .../jmap-rfc-8621-integration-tests/pom.xml|   1 +
 .../pom.xml|  97 +++
 .../postgres/PostgresAuthenticationTest.java   |  60 +
 .../james/jmap/rfc8621/postgres/PostgresBase.java  |  59 +
 .../rfc8621/postgres/PostgresCustomMethodTest.java |  58 +
 .../postgres/PostgresCustomNamespaceTest.java  |  58 +
 .../PostgresDelegatedAccountGetMethodTest.java |  25 
 .../postgres/PostgresDelegatedAccountSetTest.java  |  25 
 .../rfc8621/postgres/PostgresDownloadTest.java |  33 +
 .../rfc8621/postgres/PostgresEchoMethodTest.java   |  25 
 .../postgres/PostgresEmailChangesMethodTest.java   |  69 +++
 .../postgres/PostgresEmailGetMethodTest.java   |  36 ++
 .../postgres/PostgresEmailQueryMethodTest.java |  28 +
 .../postgres/PostgresEmailSetMethodTest.java   |  53 
 ...sEmailSubmissionSetMethodFutureReleaseTest.java |  95 +++
 .../PostgresEmailSubmissionSetMethodTest.java  |  33 +
 .../rfc8621/postgres/PostgresIdentityGetTest.java  |  25 
 .../rfc8621/postgres/PostgresIdentitySetTest.java  |  25 
 .../postgres/PostgresMDNParseMethodTest.java   |  33 +
 .../postgres/PostgresMDNSendMethodTest.java|  33 +
 .../postgres/PostgresMailboxChangesMethodTest.java |  76 
 .../postgres/PostgresMailboxGetMethodTest.java |  31 +
 .../postgres/PostgresMailboxQueryChangesTest.java  |  25 
 .../postgres/PostgresMailboxQueryMethodTest.java   |  25 
 .../postgres/PostgresMailboxSetMethodTest.java |  65 ++
 .../rfc8621/postgres/PostgresProvisioningTest.java |  25 
 .../PostgresPushSubscriptionSetMethodTest.java |  81 +
 .../postgres/PostgresQuotaChangesMethodTest.java   |  25 
 .../postgres/PostgresQuotaGetMethodTest.java   |  25 
 .../postgres/PostgresQuotaQueryMethodTest.java |  25 
 .../postgres/PostgresSessionRoutesTest.java|  25 
 .../rfc8621/postgres/PostgresThreadGetTest.java| 118 ++
 .../jmap/rfc8621/postgres/PostgresUploadTest.java  |  25 
 .../PostgresVacationResponseGetMethodTest.java |  25 
 .../PostgresVacationResponseSetMethodTest.java |  25 
 .../jmap/rfc8621/postgres/PostgresWebPushTest.java |  68 +++
 .../rfc8621/postgres/PostgresWebSocketTest.java|  25 
 .../src/test/resources/dnsservice.xml  |   0
 .../src/test/resources/domainlist.xml  |   0
 .../src/test/resources/imapserver.xml  |   0
 .../src/test/resources/jmap.properties |   0
 .../src/test/resources/keystore| Bin
 .../src/test/resources/listeners.xml   |   0
 .../src/test/resources/mailetcontainer.xml |  98 +++
 .../src/test/resources/mailrepositorystore.xml |  30 +
 .../src/test}/resources/managesieveserver.xml  |   0
 .../src/test}/resources/pop3server.xml |   0
 .../src/test/resources/rabbitmq.properties |   0
 .../src/test/resources/smtpserver.xml  |   0
 .../src/test/resources/usersrepository.xml |  25 
 56 files changed, 1828 insertions(+), 68 deletions(-)
 create mode 100644 
server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/pom.xml
 create mode 100644 
server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresAuthenticationTest.java
 create mode 100644 
server/protocols/jmap-rfc-8621-integration-tests/postgres-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/postgres/PostgresBase.java
 create mode 100644 

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

2024-03-03 Thread via GitHub


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


-- 
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] [IMPROVEMENT] Allow Email/set create to override attachment charset [james-project]

2024-03-03 Thread via GitHub


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

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

2024-03-03 Thread via GitHub


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

   > Well the OutOfMemoryError may be related to the Flux> 
observeChannels(); usage (we should use it more carefully):
   
   `OverflowStrategy.BUFFER` should be fine. We are using that within the 
RabbitMQ impl too:
   
![image](https://github.com/apache/james-project/assets/55171818/8132fdf3-dd5d-4296-842e-25c2ca9aefa6)
   
   Other OverflowStrategy(s) seems not fine as they could drop messages.
   


-- 
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] Polish SelectedMailboxImpl a bit [james-project]

2024-03-03 Thread via GitHub


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

   (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] MIME4J-326 Adopt Mime4J 0.8.11-SNAPSHOT [james-project]

2024-03-03 Thread via GitHub


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

   > Thought should never use snapshots in production code? 
   
   Well we are in for a release in MIME4J ^^


-- 
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: [ENHANCEMENT] Remove a redundant log

2024-03-03 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 2cf04ef188 [ENHANCEMENT] Remove a redundant log
2cf04ef188 is described below

commit 2cf04ef188bc603afebf1a7b6c0df7ff1fa7ddb4
Author: Benoit TELLIER 
AuthorDate: Fri Mar 1 11:51:53 2024 +0100

[ENHANCEMENT] Remove a redundant log
---
 .../src/main/java/org/apache/james/imap/encode/FetchResponseEncoder.java | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/encode/FetchResponseEncoder.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/encode/FetchResponseEncoder.java
index 401775306a..58bb2ceb09 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/encode/FetchResponseEncoder.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/encode/FetchResponseEncoder.java
@@ -216,7 +216,6 @@ public class FetchResponseEncoder implements 
ImapResponseEncoder
 for (String name : names) {
 final String value = params.get(name);
 if (value == null) {
-LOGGER.warn("Disposition parameter name has no value.");
 LOGGER.debug("Disposition parameter {} has no matching 
value", name);
 } else {
 composer.quote(name);


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



Re: [PR] [ENHANCEMENT] Remove a redundant log [james-project]

2024-03-03 Thread via GitHub


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


-- 
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] JMAP - Delete/destroy should take a set as an input [james-project]

2024-03-03 Thread via GitHub


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

   Idea from https://github.com/apache/james-project/pull/2071
   but for other methods


-- 
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] Upgrade JDK to 21 [james-project]

2024-03-03 Thread via GitHub


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

   There was a minor conflict in pom.xml, so I rebased and force pushed.


-- 
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/02: JAMES-4014 MessageIdManager::delete should take a set as an input

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

commit 23fcc298452575fe5ff6c08dc545f5fc352a2b3e
Author: Benoit TELLIER 
AuthorDate: Thu Feb 29 14:10:36 2024 +0100

JAMES-4014 MessageIdManager::delete should take a set as an input
---
 .../main/java/org/apache/james/mailbox/MessageIdManager.java |  5 +++--
 .../java/org/apache/james/mailbox/model/DeleteResult.java|  1 +
 .../org/apache/james/vault/DeletedMessageVaultHookTest.java  |  5 +++--
 .../apache/james/mailbox/store/StoreMessageIdManager.java|  4 ++--
 .../james/mailbox/store/AbstractCombinationManagerTest.java  |  3 ++-
 .../store/AbstractMessageIdManagerSideEffectTest.java|  2 +-
 .../mailbox/store/AbstractMessageIdManagerStorageTest.java   | 12 
 .../jmap/draft/methods/SetMessagesDestructionProcessor.java  |  3 ++-
 .../apache/james/jmap/method/EmailSetDeletePerformer.scala   |  2 +-
 9 files changed, 15 insertions(+), 22 deletions(-)

diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/MessageIdManager.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/MessageIdManager.java
index 1af85ac71c..4605a0fcbd 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/MessageIdManager.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/MessageIdManager.java
@@ -36,6 +36,7 @@ import org.apache.james.mailbox.model.MessageResult;
 import org.reactivestreams.Publisher;
 
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
@@ -69,7 +70,7 @@ public interface MessageIdManager {
 
 Publisher deleteReactive(List messageId, 
List mailboxIds, MailboxSession mailboxSession);
 
-Publisher delete(List messageId, MailboxSession 
mailboxSession);
+Publisher delete(Set messageId, MailboxSession 
mailboxSession);
 
 void setInMailboxes(MessageId messageId, Collection mailboxIds, 
MailboxSession mailboxSession) throws MailboxException;
 
@@ -80,7 +81,7 @@ public interface MessageIdManager {
 }
 
 default DeleteResult delete(MessageId messageId, MailboxSession 
mailboxSession) {
-return Mono.from(delete(ImmutableList.of(messageId), mailboxSession))
+return Mono.from(delete(ImmutableSet.of(messageId), mailboxSession))
 .block();
 }
 
diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/DeleteResult.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/DeleteResult.java
index 7bb4351e6f..17eff306f9 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/DeleteResult.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/DeleteResult.java
@@ -109,4 +109,5 @@ public class DeleteResult {
 public final int hashCode() {
 return Objects.hash(destroyed, notFound);
 }
+
 }
diff --git 
a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java
 
b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java
index 2862003b21..2ec44ca23b 100644
--- 
a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java
+++ 
b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultHookTest.java
@@ -62,6 +62,7 @@ import org.junit.jupiter.api.Test;
 
 import com.github.fge.lambdas.Throwing;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
@@ -172,9 +173,9 @@ class DeletedMessageVaultHookTest {
 MailboxId aliceMailbox = 
mailboxManager.createMailbox(MAILBOX_ALICE_ONE, aliceSession).get();
 MessageManager messageManager = 
mailboxManager.getMailbox(aliceMailbox, aliceSession);
 
-ImmutableList ids = IntStream.range(0, 1000)
+ImmutableSet ids = IntStream.range(0, 1000)
 .mapToObj(Throwing.intFunction(i -> 
appendMessage(messageManager).getMessageId()))
-.collect(ImmutableList.toImmutableList());
+.collect(ImmutableSet.toImmutableSet());
 
 assertThatCode(() -> Mono.from(messageIdManager.delete(ids, 
aliceSession)).subscribeOn(Schedulers.newSingle("test")).block())
 .doesNotThrowAnyException();
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageIdManager.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageIdManager.java
index 24dbb9c4e8..b042fba846 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageIdManager.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageIdManager.java
@@ -245,7 +245,7 @@ public class StoreMessageIdManager implements 

Re: [PR] JAMES-4014 Cannot Email/set destroy with twice the same id [james-project]

2024-03-03 Thread via GitHub


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


-- 
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) 01/02: JAMES-4014 Failing test MessageIdManager::deleteMessageShouldSupportDuplicatedEntries

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

commit 569a5b304723c2b2fffbd8f2940c062c9c7adbff
Author: Benoit TELLIER 
AuthorDate: Thu Feb 29 14:09:43 2024 +0100

JAMES-4014 Failing test 
MessageIdManager::deleteMessageShouldSupportDuplicatedEntries

Or... This leaks on S3 503!
---
 .../mailbox/store/AbstractMessageIdManagerStorageTest.java   | 12 
 1 file changed, 12 insertions(+)

diff --git 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerStorageTest.java
 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerStorageTest.java
index 92d568e7ae..3b3ecd2c43 100644
--- 
a/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerStorageTest.java
+++ 
b/mailbox/store/src/test/java/org/apache/james/mailbox/store/AbstractMessageIdManagerStorageTest.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.function.Predicate;
 
+import com.google.common.collect.ImmutableSet;
 import jakarta.mail.Flags;
 
 import org.apache.james.core.Username;
@@ -50,10 +51,12 @@ import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.model.MessageResult;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
+import reactor.core.publisher.Mono;
 
 public abstract class AbstractMessageIdManagerStorageTest {
 public static final Flags FLAGS = new Flags();
@@ -112,6 +115,15 @@ public abstract class AbstractMessageIdManagerStorageTest {
 .isEqualTo(DeleteResult.notFound(messageId));
 }
 
+@Disabled("Fails for cassandra app")
+@Test
+void deleteMessageShouldSupportDuplicatedEntries() throws MailboxException 
{
+MessageId messageId = 
testingData.persist(aliceMailbox1.getMailboxId(), messageUid1, FLAGS, 
aliceSession);
+
+
assertThat(Mono.from(messageIdManager.delete(ImmutableList.of(messageId, 
messageId), aliceSession)).block())
+.isEqualTo(DeleteResult.destroyed(messageId));
+}
+
 @Test
 void setInMailboxesShouldNotFailWhenMessageDoesNotExist() throws Exception 
{
 MessageId messageId = testingData.createNotUsedMessageId();


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



(james-project) branch master updated (e104a123fb -> 23fcc29845)

2024-03-03 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 e104a123fb JAMES-4007 Document 
james.mime4j.buffered.body.factory.file.threshold
 new 569a5b3047 JAMES-4014 Failing test 
MessageIdManager::deleteMessageShouldSupportDuplicatedEntries
 new 23fcc29845 JAMES-4014 MessageIdManager::delete should take a set as an 
input

The 2 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:
 .../api/src/main/java/org/apache/james/mailbox/MessageIdManager.java | 5 +++--
 .../src/main/java/org/apache/james/mailbox/model/DeleteResult.java   | 1 +
 .../java/org/apache/james/vault/DeletedMessageVaultHookTest.java | 5 +++--
 .../java/org/apache/james/mailbox/store/StoreMessageIdManager.java   | 4 ++--
 .../apache/james/mailbox/store/AbstractCombinationManagerTest.java   | 3 ++-
 .../james/mailbox/store/AbstractMessageIdManagerSideEffectTest.java  | 2 +-
 .../james/jmap/draft/methods/SetMessagesDestructionProcessor.java| 3 ++-
 .../scala/org/apache/james/jmap/method/EmailSetDeletePerformer.scala | 2 +-
 8 files changed, 15 insertions(+), 10 deletions(-)


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



(james-project) 01/06: JAMES-4007 Mono.using in storeAttachments

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

commit e19468667e19b736d7278b422f23958811b31931
Author: Benoit TELLIER 
AuthorDate: Wed Feb 28 11:29:39 2024 +0100

JAMES-4007 Mono.using in storeAttachments

If consumer was canceled / failed while extracting
attachments we could "loose" the cleanup
---
 .../main/java/org/apache/james/mailbox/store/MessageStorer.java   | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageStorer.java 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageStorer.java
index f444fc0e46..a3181fbb01 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageStorer.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageStorer.java
@@ -120,10 +120,10 @@ public interface MessageStorer {
 }
 
 private Mono> 
storeAttachments(MessageId messageId, Content messageContent, Optional 
maybeMessage, MailboxSession session) {
-MessageParser.ParsingResult attachments = 
extractAttachments(messageContent, maybeMessage);
-return attachmentMapperFactory.getAttachmentMapper(session)
-.storeAttachmentsReactive(attachments.getAttachments(), 
messageId)
-.doFinally(any -> attachments.dispose());
+return Mono.using(() -> extractAttachments(messageContent, 
maybeMessage),
+attachments -> 
attachmentMapperFactory.getAttachmentMapper(session)
+.storeAttachmentsReactive(attachments.getAttachments(), 
messageId),
+MessageParser.ParsingResult::dispose);
 }
 
 private MessageParser.ParsingResult extractAttachments(Content 
contentIn, Optional maybeMessage) {


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



(james-project) 05/06: JAMES-4007 Reset DelegateCloseableByteSource upon errors

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

commit 060039df27e4141b2c8072c5bc45006518c19676
Author: Benoit TELLIER 
AuthorDate: Wed Feb 28 16:50:03 2024 +0100

JAMES-4007 Reset DelegateCloseableByteSource upon errors

Or... This leaks on S3 503!
---
 .../src/main/java/org/apache/james/blob/api/Store.java | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java 
b/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java
index 32fe80d00a..0c5bf1c644 100644
--- a/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java
+++ b/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java
@@ -119,8 +119,14 @@ public interface Store {
 return Mono.usingWhen(blobStore.readReactive(bucketName, blobId, 
storagePolicy),
 Throwing.function(in -> {
 FileBackedOutputStream out = new 
FileBackedOutputStream(FILE_THRESHOLD);
-long size = in.transferTo(out);
-return Mono.just(new 
DelegateCloseableByteSource(out.asByteSource(), out::reset, size));
+try {
+long size = in.transferTo(out);
+return Mono.just(new 
DelegateCloseableByteSource(out.asByteSource(), out::reset, size));
+} catch (Exception e) {
+out.reset();
+out.close();
+throw e;
+}
 }),
 stream -> Mono.fromRunnable(Throwing.runnable(stream::close)));
 }


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



(james-project) 03/06: JAMES-4007 MessageParser: cleanup resources on error

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

commit 082c84187e85fd10d5971f9096c10c3f645f5fa9
Author: Benoit TELLIER 
AuthorDate: Wed Feb 28 11:31:39 2024 +0100

JAMES-4007 MessageParser: cleanup resources on error

If failing to copy the data we ended up not cleaning up
resources. We do this by explicitly registering
body parts to cleanup and do it on error.
---
 .../mail/model/impl/FileBufferedBodyFactory.java  | 19 ++-
 .../mailbox/store/mail/model/impl/MessageParser.java  | 13 ++---
 2 files changed, 28 insertions(+), 4 deletions(-)

diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
index 32cd3c568f..7a2ed51478 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
@@ -29,9 +29,11 @@ import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
 import java.nio.charset.UnsupportedCharsetException;
+import java.util.ArrayList;
 
 import org.apache.james.mime4j.Charsets;
 import org.apache.james.mime4j.dom.BinaryBody;
+import org.apache.james.mime4j.dom.Disposable;
 import org.apache.james.mime4j.dom.SingleBody;
 import org.apache.james.mime4j.dom.TextBody;
 import org.apache.james.mime4j.io.InputStreams;
@@ -39,6 +41,8 @@ import org.apache.james.mime4j.message.BasicBodyFactory;
 import org.apache.james.mime4j.message.BodyFactory;
 import org.apache.james.mime4j.util.ByteArrayOutputStreamRecycler;
 import org.apache.james.mime4j.util.ContentUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.io.CountingOutputStream;
 import com.google.common.io.FileBackedOutputStream;
@@ -46,11 +50,13 @@ import com.google.common.io.FileBackedOutputStream;
 /**
  * Factory for creating message bodies.
  */
-public class FileBufferedBodyFactory implements BodyFactory {
+public class FileBufferedBodyFactory implements BodyFactory, Disposable {
 
 public static final BasicBodyFactory INSTANCE = new BasicBodyFactory();
+public static final Logger LOGGER = 
LoggerFactory.getLogger(FileBufferedBodyFactory.class);
 
 private final Charset defaultCharset;
+private final ArrayList disposables = new ArrayList<>();
 
 public FileBufferedBodyFactory() {
 this(true);
@@ -146,6 +152,13 @@ public class FileBufferedBodyFactory implements 
BodyFactory {
 
 public BinaryBody binaryBody(final InputStream is) throws IOException {
 try (FileBackedOutputStream out = new FileBackedOutputStream(100 * 
1024)) {
+disposables.add(() -> {
+try {
+out.reset();
+} catch (IOException e) {
+LOGGER.error("Cannot delete {}", out, e);
+}
+});
 CountingOutputStream countingOutputStream = new 
CountingOutputStream(out);
 is.transferTo(countingOutputStream);
 return new BinaryBody3(out, countingOutputStream.getCount());
@@ -411,4 +424,8 @@ public class FileBufferedBodyFactory implements BodyFactory 
{
 
 }
 
+@Override
+public void dispose() {
+disposables.forEach(Disposable::dispose);
+}
 }
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
index cde27db9da..e3c6db833a 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/MessageParser.java
@@ -105,9 +105,16 @@ public class MessageParser {
 DefaultMessageBuilder defaultMessageBuilder = new 
DefaultMessageBuilder();
 defaultMessageBuilder.setMimeEntityConfig(MimeConfig.PERMISSIVE);
 defaultMessageBuilder.setDecodeMonitor(DecodeMonitor.SILENT);
-defaultMessageBuilder.setBodyFactory(new FileBufferedBodyFactory());
-Message message = defaultMessageBuilder.parseMessage(fullContent);
-return new ParsingResult(retrieveAttachments(message), 
message::dispose);
+FileBufferedBodyFactory bodyFactory = new FileBufferedBodyFactory();
+defaultMessageBuilder.setBodyFactory(bodyFactory);
+try {
+Message message = defaultMessageBuilder.parseMessage(fullContent);
+return new ParsingResult(retrieveAttachments(message), 
bodyFactory::dispose);
+} catch (Exception e) {
+// Release 

(james-project) 06/06: JAMES-4007 Document james.mime4j.buffered.body.factory.file.threshold

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

commit e104a123fb162dabf9eddbb4fa81c45ec5c0fcc0
Author: Benoit TELLIER 
AuthorDate: Thu Feb 29 08:17:48 2024 +0100

JAMES-4007 Document james.mime4j.buffered.body.factory.file.threshold
---
 server/apps/cassandra-app/sample-configuration/jvm.properties   | 6 +-
 server/apps/distributed-app/sample-configuration/jvm.properties | 4 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/server/apps/cassandra-app/sample-configuration/jvm.properties 
b/server/apps/cassandra-app/sample-configuration/jvm.properties
index 6f7e598d17..9415002bc7 100644
--- a/server/apps/cassandra-app/sample-configuration/jvm.properties
+++ b/server/apps/cassandra-app/sample-configuration/jvm.properties
@@ -58,4 +58,8 @@ jmx.remote.x.mlet.allow.getMBeansFromURL=false
 # Defaults to true, meaning James will use JMAP filters event source 
increments, thus transparently and significantly
 # improving JMAP filter storage efficiency. Snapshots enable to only build the 
aggregate from the last few events.
 # james.jmap.filters.eventsource.increments.enabled=true
-# james.jmap.filters.eventsource.snapshots.enabled=true
\ No newline at end of file
+# james.jmap.filters.eventsource.snapshots.enabled=true
+
+# Value from which dedicated BodyFactory shall start buffering data to a file.
+# Used for attachment parsing upon message creation. Default value: 100K.
+# james.mime4j.buffered.body.factory.file.threshold=100K
\ No newline at end of file
diff --git a/server/apps/distributed-app/sample-configuration/jvm.properties 
b/server/apps/distributed-app/sample-configuration/jvm.properties
index 2e78d542f8..7d7e5f084a 100644
--- a/server/apps/distributed-app/sample-configuration/jvm.properties
+++ b/server/apps/distributed-app/sample-configuration/jvm.properties
@@ -71,6 +71,10 @@ jmx.remote.x.mlet.allow.getMBeansFromURL=false
 # Unit supported: K, M, G, default to no unit
 #james.blob.aes.file.threshold.decrypt=256K
 
+# Value from which dedicated BodyFactory shall start buffering data to a file.
+# Used for attachment parsing upon message creation. Default value: 100K.
+# james.mime4j.buffered.body.factory.file.threshold=100K
+
 # Maximum size of a blob. Larger blobs will be rejected.
 # Unit supported: K, M, G, default to no unit
 #james.blob.aes.blob.max.size=100M


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



(james-project) 04/06: JAMES-4007 FileBufferedBodyFactory: add a handy JVM option

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

commit ac002dc64ae7a589a8bc42b6b4fbeeb0b97c8488
Author: Benoit TELLIER 
AuthorDate: Wed Feb 28 11:33:25 2024 +0100

JAMES-4007 FileBufferedBodyFactory: add a handy JVM option

Avoids a hard coded value enabling runtime changes...
---
 .../mailbox/store/mail/model/impl/FileBufferedBodyFactory.java | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
index 7a2ed51478..0867328e34 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/FileBufferedBodyFactory.java
@@ -30,6 +30,7 @@ import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
 import java.nio.charset.UnsupportedCharsetException;
 import java.util.ArrayList;
+import java.util.Optional;
 
 import org.apache.james.mime4j.Charsets;
 import org.apache.james.mime4j.dom.BinaryBody;
@@ -41,6 +42,7 @@ import org.apache.james.mime4j.message.BasicBodyFactory;
 import org.apache.james.mime4j.message.BodyFactory;
 import org.apache.james.mime4j.util.ByteArrayOutputStreamRecycler;
 import org.apache.james.mime4j.util.ContentUtil;
+import org.apache.james.util.Size;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -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"))
+.map(s -> Size.parse(s, Size.Unit.NoUnit))
+.map(s -> (int) s.asBytes())
+.orElse(100 * 1024);
+
+
 
 private final Charset defaultCharset;
 private final ArrayList disposables = new ArrayList<>();
@@ -151,7 +159,7 @@ public class FileBufferedBodyFactory implements 
BodyFactory, Disposable {
 }
 
 public BinaryBody binaryBody(final InputStream is) throws IOException {
-try (FileBackedOutputStream out = new FileBackedOutputStream(100 * 
1024)) {
+try (FileBackedOutputStream out = new 
FileBackedOutputStream(FILE_THRESHOLD)) {
 disposables.add(() -> {
 try {
 out.reset();


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



(james-project) branch master updated (966f1e6597 -> e104a123fb)

2024-03-03 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 966f1e6597 JAMES-4008 Fix EmailSubmissionSetMethod with named address
 new e19468667e JAMES-4007 Mono.using in storeAttachments
 new 468383ebbe JAMES-4007 AESBlobStoreDAO: cleanup resources on error
 new 082c84187e JAMES-4007 MessageParser: cleanup resources on error
 new ac002dc64a JAMES-4007 FileBufferedBodyFactory: add a handy JVM option
 new 060039df27 JAMES-4007 Reset DelegateCloseableByteSource upon errors
 new e104a123fb JAMES-4007 Document 
james.mime4j.buffered.body.factory.file.threshold

The 6 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:
 .../apache/james/mailbox/store/MessageStorer.java  |  8 +++---
 .../mail/model/impl/FileBufferedBodyFactory.java   | 29 --
 .../store/mail/model/impl/MessageParser.java   | 13 +++---
 .../sample-configuration/jvm.properties|  6 -
 .../sample-configuration/jvm.properties|  4 +++
 .../org/apache/james/blob/aes/AESBlobStoreDAO.java | 10 +---
 .../main/java/org/apache/james/blob/api/Store.java | 10 ++--
 7 files changed, 65 insertions(+), 15 deletions(-)


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



(james-project) 02/06: JAMES-4007 AESBlobStoreDAO: cleanup resources on error

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

commit 468383ebbe0bbbcba29c129e9b16e4d80fa5481a
Author: Benoit TELLIER 
AuthorDate: Wed Feb 28 11:30:44 2024 +0100

JAMES-4007 AESBlobStoreDAO: cleanup resources on error

If failing to copy the data we ended up not cleaning up
resources
---
 .../main/java/org/apache/james/blob/aes/AESBlobStoreDAO.java   | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/server/blob/blob-aes/src/main/java/org/apache/james/blob/aes/AESBlobStoreDAO.java
 
b/server/blob/blob-aes/src/main/java/org/apache/james/blob/aes/AESBlobStoreDAO.java
index dfd2750f11..662e2ff08f 100644
--- 
a/server/blob/blob-aes/src/main/java/org/apache/james/blob/aes/AESBlobStoreDAO.java
+++ 
b/server/blob/blob-aes/src/main/java/org/apache/james/blob/aes/AESBlobStoreDAO.java
@@ -72,14 +72,18 @@ public class AESBlobStoreDAO implements BlobStoreDAO {
 this.streamingAead = 
PBKDF2StreamingAeadFactory.newAesGcmHkdfStreaming(cryptoConfig);
 }
 
-public FileBackedOutputStream encrypt(InputStream input) {
-try (FileBackedOutputStream encryptedContent = new 
FileBackedOutputStream(FILE_THRESHOLD_ENCRYPT)) {
+public FileBackedOutputStream encrypt(InputStream input) throws 
IOException {
+FileBackedOutputStream encryptedContent = new 
FileBackedOutputStream(FILE_THRESHOLD_ENCRYPT);
+try {
 OutputStream outputStream = 
streamingAead.newEncryptingStream(encryptedContent, 
PBKDF2StreamingAeadFactory.EMPTY_ASSOCIATED_DATA);
 input.transferTo(outputStream);
 outputStream.close();
 return encryptedContent;
-} catch (GeneralSecurityException | IOException e) {
+} catch (Exception e) {
+encryptedContent.reset();
 throw new RuntimeException("Unable to build payload for object 
storage, failed to encrypt", e);
+} finally {
+encryptedContent.close();
 }
 }
 


-
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-03-03 Thread via GitHub


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


-- 
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-03-03 Thread via GitHub


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

   - [ ] todo rebase after:
   
   - https://github.com/linagora/james-project/issues/5110


-- 
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] MIME4J-326 Adopt Mime4J 0.8.11-SNAPSHOT [james-project]

2024-03-03 Thread via GitHub


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

   > Thought should never use snapshots in production code? That could create 
issues if something unstable gets merged later in mime4j project no?
   
   I have no idea about that. But in case we want to override the mime4j 
version just on tmail for example:
   `mvn clean install -DskipTests -Dmaven.skip.doc=true 
-Dapache-mime4j.version=0.8.11-SNAPSHOT`


-- 
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 (5b60e158e1 -> 966f1e6597)

2024-03-03 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 5b60e158e1 [FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded
 add 966f1e6597 JAMES-4008 Fix EmailSubmissionSetMethod with named address

No new revisions were added by this update.

Summary of changes:
 .../EmailSubmissionSetMethodContract.scala | 80 ++
 .../jmap/method/EmailSubmissionSetMethod.scala |  7 +-
 2 files changed, 86 insertions(+), 1 deletion(-)


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



Re: [PR] JAMES-4008 Fix EmailSubmissionSetMethod with named address [james-project]

2024-03-03 Thread via GitHub


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


-- 
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: [FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded

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

rcordier 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 2de10b03c1 [FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded
2de10b03c1 is described below

commit 2de10b03c11a923de17e2e8706df21a839196cc1
Author: Benoit TELLIER 
AuthorDate: Fri Mar 1 16:03:39 2024 +0100

[FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded
---
 server/apps/spring-app/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/apps/spring-app/pom.xml b/server/apps/spring-app/pom.xml
index 87457b9a6d..f66bc61790 100644
--- a/server/apps/spring-app/pom.xml
+++ b/server/apps/spring-app/pom.xml
@@ -70,7 +70,7 @@
 
-Djames.message.usememorycopy=false
 
 
-Djdk.tls.ephemeralDHKeySize=2048
-
-openjpa.Multithreaded=true
+
-Dopenjpa.Multithreaded=true
 ${james.system-property1} 
${james.system-property2} ${james.system-property3}
 
 apache-james


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



Re: [PR] [FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded [james-project]

2024-03-03 Thread via GitHub


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


-- 
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] -openjpa.Multithreaded => -Dopenjpa.Multithreaded

2024-03-03 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 5b60e158e1 [FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded
5b60e158e1 is described below

commit 5b60e158e14d50ba2511aa479902f9b97bfd201e
Author: Benoit TELLIER 
AuthorDate: Fri Mar 1 16:03:39 2024 +0100

[FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded
---
 server/apps/spring-app/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/apps/spring-app/pom.xml b/server/apps/spring-app/pom.xml
index cf6987755d..6535df8258 100644
--- a/server/apps/spring-app/pom.xml
+++ b/server/apps/spring-app/pom.xml
@@ -70,7 +70,7 @@
 
-Djames.message.usememorycopy=false
 
 
-Djdk.tls.ephemeralDHKeySize=2048
-
-openjpa.Multithreaded=true
+
-Dopenjpa.Multithreaded=true
 ${james.system-property1} 
${james.system-property2} ${james.system-property3}
 
 apache-james


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



Re: [PR] [FIX] -openjpa.Multithreaded => -Dopenjpa.Multithreaded [james-project]

2024-03-03 Thread via GitHub


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


-- 
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] Notify eventbus outside of the lock

2024-03-03 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 a5fcf50acf [FIX] Notify eventbus outside of the lock
a5fcf50acf is described below

commit a5fcf50acfdc4b871757ae6c70bd987bfa7710c7
Author: Benoit TELLIER 
AuthorDate: Fri Mar 1 22:26:41 2024 +0100

[FIX] Notify eventbus outside of the lock

Nested manager calls in listener would cause
deadlock, and event bus remote call would
cause severe performance hit.
---
 .../james/mailbox/store/StoreMailboxManager.java   | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
index 3fb414d116..32a8602543 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
@@ -415,20 +415,20 @@ public class StoreMailboxManager implements 
MailboxManager {
 private Mono performConcurrentMailboxCreation(MailboxSession 
mailboxSession, MailboxPath mailboxPath, CreateOption createOption) {
 MailboxMapper mapper = 
mailboxSessionMapperFactory.getMailboxMapper(mailboxSession);
 return Mono.from(locker.executeReactiveWithLockReactive(mailboxPath,
-mapper.executeReactive(mapper.create(mailboxPath, 
UidValidity.generate())
-.flatMap(mailbox ->
-// notify listeners
-eventBus.dispatch(EventFactory.mailboxAdded()
+mapper.executeReactive(Mono.from(mapper.create(mailboxPath, 
UidValidity.generate(, MailboxPathLocker.LockType.Write))
+.flatMap(mailbox ->
+// notify listeners
+eventBus.dispatch(EventFactory.mailboxAdded()
 .randomEventId()
 .mailboxSession(mailboxSession)
 .mailbox(mailbox)
 .build(),
 new MailboxIdRegistrationKey(mailbox.getMailboxId()))
-.thenReturn(mailbox.getMailboxId()))
-.onErrorResume(MailboxExistsException.class, e -> {
-LOGGER.info("{} mailbox was created concurrently", 
mailboxPath.asString());
-return Mono.empty();
-})), MailboxPathLocker.LockType.Write))
+.thenReturn(mailbox.getMailboxId()))
+.onErrorResume(MailboxExistsException.class, e -> {
+LOGGER.info("{} mailbox was created concurrently", 
mailboxPath.asString());
+return Mono.empty();
+})
 .flatMap(any -> createSubscriptionIfNeeded(mailboxPath, 
createOption, mailboxSession).thenReturn(any));
 }
 


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



Re: [PR] [FIX] Notify eventbus outside of the lock [james-project]

2024-03-03 Thread via GitHub


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


-- 
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-03-03 Thread via GitHub


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


-- 
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 (d3ec938e0a -> bb54e356cb)

2024-03-03 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 d3ec938e0a Update 
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RecipientRewriteTableProcessor.java
 add 99eab22747 JAMES-3925 - JMAP Upload - Method delete of Upload 
Repository should return Boolean value when applied
 add d30aa3b7ff JAMES-3925 - JMAP Upload - Update current usage only when 
delete succeed
 add f8095a4e9f JAMES-3925 - JMAP Upload - Cleanup 
UploadUsageRepositoryContract
 add bb54e356cb JAMES-3925 - JMAP Upload - Optimize resetSpace method - do 
nothing when newUsage is equal currentUsage

No new revisions were added by this update.

Summary of changes:
 .../upload/CassandraUploadRepository.java  |  2 +-
 .../upload/CassandraUploadUsageRepository.java |  5 +++--
 .../james/jmap/cassandra/upload/UploadDAO.java |  5 +++--
 .../upload/CassandraUploadRepositoryTest.java  | 13 
 .../james/jmap/api/upload/UploadRepository.java|  2 +-
 .../jmap/api/upload/UploadServiceDefaultImpl.java  |  8 +---
 .../memory/upload/InMemoryUploadRepository.java|  9 +---
 .../jmap/api/upload/UploadRepositoryContract.scala | 13 
 .../api/upload/UploadUsageRepositoryContract.scala | 24 +++---
 9 files changed, 57 insertions(+), 24 deletions(-)


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



Re: [PR] JAMES-4008 JMAP - Email/set - Should be able to save a draft with invalid email address [james-project]

2024-03-03 Thread via GitHub


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


##
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailSubmissionSetMethod.scala:
##
@@ -337,6 +338,24 @@ class EmailSubmissionSetMethod @Inject()(serializer: 
EmailSubmissionSetSerialize
   Failure(new IllegalArgumentException("Invalid delayed time!"))
 }
 
+  def validateMimeMessages(mimeMessage: MimeMessage) : SMono[MimeMessage] = 
validateMailAddressHeaderMimeMessage(mimeMessage)
+  private def validateMailAddressHeaderMimeMessage(mimeMessage: MimeMessage): 
SMono[MimeMessage] =
+SFlux.fromIterable(Map("to" -> 
Option(mimeMessage.getRecipients(RecipientType.TO)).toList.flatten,
+"cc" -> 
Option(mimeMessage.getRecipients(RecipientType.CC)).toList.flatten,
+"bcc" -> 
Option(mimeMessage.getRecipients(RecipientType.BCC)).toList.flatten,
+"from" -> Option(mimeMessage.getFrom).toList.flatten,
+"sender" -> Option(mimeMessage.getSender).toList,
+"replyTo" -> Option(mimeMessage.getReplyTo).toList.flatten))
+  .doOnNext { case (headerName, addresses) => (headerName, 
addresses.foreach(address => validateMailAddress(headerName, address))) }
+  .`then`()
+  .`then`(SMono.just(mimeMessage))
+
+  private def validateMailAddress(headName: String, address: Address): 
MailAddress =
+Try(new MailAddress(address.toString)) match {

Review Comment:
   class `Address` do not have `.getAddress` method



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