(james-mime4j) branch master updated: MIME4J-327 LenientAddressParser now handles UTF-8 (#104)

2024-05-07 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-mime4j.git


The following commit(s) were added to refs/heads/master by this push:
 new 85995590 MIME4J-327 LenientAddressParser now handles UTF-8 (#104)
85995590 is described below

commit 85995590ad6700cc8bf7a3b8462ce87843dab5bd
Author: Benoit TELLIER 
AuthorDate: Tue May 7 15:05:49 2024 +0200

MIME4J-327 LenientAddressParser now handles UTF-8 (#104)

Huge thanks to Chung dae hyun for reporting the issue and writing the test
Huge thanks to @twn for fixing utf-8 handling in the first place and
fixing up the test
---
 .../mime4j/field/address/LenientAddressBuilderTest.java| 14 ++
 1 file changed, 14 insertions(+)

diff --git 
a/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
 
b/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
index 78535802..a9d59642 100644
--- 
a/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
+++ 
b/dom/src/test/java/org/apache/james/mime4j/field/address/LenientAddressBuilderTest.java
@@ -108,6 +108,20 @@ public class LenientAddressBuilderTest {
 Assert.assertEquals("=?utf-8?Q?Dupont,_Gr=C3=A9goire", 
mailbox.getName());
 }
 
+@Test // MIME4J-327
+public void testNameUTF8Support() throws Exception {
+String s = "\"시험\" ";
+ByteSequence raw = ContentUtil.encode(s);
+ParserCursor cursor = new ParserCursor(0, raw.length());
+
+Address address = parser.parseAddress(raw, cursor, 
RawFieldParser.INIT_BITSET(','));
+Assert.assertNotNull(address);
+Assert.assertTrue(address instanceof Mailbox);
+Mailbox mailbox = (Mailbox) address;
+Assert.assertEquals("시험", mailbox.getName());
+Assert.assertEquals("koreant...@example.com", mailbox.getAddress());
+}
+
 @Test
 public void shouldTolerateMalformedEncoding() throws Exception {
 String s = "\"=?windows-1251?B?onsonsmekqixrbahkinyv?=\" 
";


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



(james-mime4j) branch master updated: MIME4J-284 Test unfolding with equal sign (#105)

2024-05-07 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-mime4j.git


The following commit(s) were added to refs/heads/master by this push:
 new 70a7b1ee MIME4J-284 Test unfolding with equal sign (#105)
70a7b1ee is described below

commit 70a7b1ee87b20a332aa78aeb65baff38b6a48f6b
Author: Benoit TELLIER 
AuthorDate: Tue May 7 15:05:36 2024 +0200

MIME4J-284 Test unfolding with equal sign (#105)
---
 .../java/org/apache/james/mime4j/field/UnstructuredFieldTest.java | 8 
 1 file changed, 8 insertions(+)

diff --git 
a/dom/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java 
b/dom/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java
index 23f3b0a9..d5ac6f99 100644
--- a/dom/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java
+++ b/dom/src/test/java/org/apache/james/mime4j/field/UnstructuredFieldTest.java
@@ -43,6 +43,14 @@ public class UnstructuredFieldTest {
 Assert.assertEquals("Testing value without a leading ' '", "yada", 
f.getValue());
 }
 
+@Test
+public void testUnfoldWithEqualSign() throws Exception {
+UnstructuredField f = (UnstructuredField) 
DefaultFieldParser.parse("\n" +
+"References: 
\n" +
+" 
\r\n");
+
Assert.assertEquals("
 ", 
f.getValue());
+}
+
 @Test
 public void testGetBodyUtf8() throws Exception {
 UnstructuredField f;


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



(james-project) branch 3.8.x updated: JAMES-4023 Avoid blocking the SMTP Netty event loop (#2230)

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

btellier 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 6b89b97761 JAMES-4023 Avoid blocking the SMTP Netty event loop (#2230)
6b89b97761 is described below

commit 6b89b97761fb28f8de08db5e6a6e8ee115ae9fc4
Author: Benoit TELLIER 
AuthorDate: Tue May 7 15:05:29 2024 +0200

JAMES-4023 Avoid blocking the SMTP Netty event loop (#2230)
---
 .../james/protocols/netty/AbstractChannelPipelineFactory.java | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
index 4263d7d27f..41c926ea75 100644
--- 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
+++ 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractChannelPipelineFactory.java
@@ -70,14 +70,12 @@ public abstract class AbstractChannelPipelineFactory ex
 pipeline.addLast(HandlerConstants.PROXY_HANDLER, new 
HAProxyMessageDecoder());
 }
 
-// Add the text line decoder which limit the max line length, don't 
strip the delimiter and use CRLF as delimiter
-pipeline.addLast(eventExecutorGroup, HandlerConstants.FRAMER, 
frameHandlerFactory.create(pipeline));
-   
 // Add the ChunkedWriteHandler to be able to write ChunkInput
 pipeline.addLast(HandlerConstants.CHUNK_HANDLER, new 
ChunkedWriteHandler());
 pipeline.addLast(HandlerConstants.TIMEOUT_HANDLER, new 
TimeoutHandler(timeout));
-
-pipeline.addLast(HandlerConstants.CORE_HANDLER, createHandler());
+// Add the text line decoder which limit the max line length, don't 
strip the delimiter and use CRLF as delimiter
+pipeline.addLast(eventExecutorGroup, HandlerConstants.FRAMER, 
frameHandlerFactory.create(pipeline));
+pipeline.addLast(eventExecutorGroup, HandlerConstants.CORE_HANDLER, 
createHandler());
 }
 
 


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



(james-project) branch master updated: Bump org.xmlunit:xmlunit-core in /server/mailet/integration-testing (#2223)

2024-05-02 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 49637c423c Bump org.xmlunit:xmlunit-core in 
/server/mailet/integration-testing (#2223)
49637c423c is described below

commit 49637c423cab247206e914f1c1387d9df9c2d988
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Thu May 2 09:08:04 2024 +0200

Bump org.xmlunit:xmlunit-core in /server/mailet/integration-testing (#2223)

Bumps [org.xmlunit:xmlunit-core](https://github.com/xmlunit/xmlunit) from 
2.9.1 to 2.10.0.
- [Release notes](https://github.com/xmlunit/xmlunit/releases)
- [Changelog](https://github.com/xmlunit/xmlunit/blob/main/RELEASE_NOTES.md)
- [Commits](https://github.com/xmlunit/xmlunit/compare/v2.9.1...v2.10.0)

---
updated-dependencies:
- dependency-name: org.xmlunit:xmlunit-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 server/mailet/integration-testing/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/mailet/integration-testing/pom.xml 
b/server/mailet/integration-testing/pom.xml
index 94fd366a87..7dcbce43ba 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -33,7 +33,7 @@
 Apache James :: Server :: Mailet :: Integration Testing
 
 
-2.9.1
+2.10.0
 
 
 


-
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] FetchProcessor: only log Resuming IMAP FETCH once (#2217)

2024-04-29 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 c07d393b35 [FIX] FetchProcessor: only log Resuming IMAP FETCH once 
(#2217)
c07d393b35 is described below

commit c07d393b353f3aef088d8710087a3a5492e97659
Author: Benoit TELLIER 
AuthorDate: Mon Apr 29 14:30:59 2024 +0200

[FIX] FetchProcessor: only log Resuming IMAP FETCH once (#2217)

The log mistakenly lead to think backpressure was restored multiple time
---
 .../main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
index 90291cae84..800c036e14 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
@@ -99,8 +99,8 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 AtomicBoolean mustRequestOne = new AtomicBoolean(true);
 responder.respond(fetchResponse);
 Runnable requestOne = () -> {
-LOGGER.info("Resuming IMAP FETCH for user {}", 
imapSession.getUserName().asString());
 if (mustRequestOne.getAndSet(false)) {
+LOGGER.info("Resuming IMAP FETCH for user {}", 
imapSession.getUserName().asString());
 requestOne();
 }
 };


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



(james-project) branch master updated: [UPGRADE] com.datastax.oss:java-driver-core:4.17.0 => org.apache.cass… (#2212)

2024-04-29 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 259bcf41ec [UPGRADE] com.datastax.oss:java-driver-core:4.17.0 => 
org.apache.cass… (#2212)
259bcf41ec is described below

commit 259bcf41ecac9846adb591e20737a16c90a5da30
Author: Benoit TELLIER 
AuthorDate: Mon Apr 29 14:30:41 2024 +0200

[UPGRADE] com.datastax.oss:java-driver-core:4.17.0 => org.apache.cass… 
(#2212)
---
 backends-common/cassandra/pom.xml | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/backends-common/cassandra/pom.xml 
b/backends-common/cassandra/pom.xml
index e6a7e324a8..b2f84b2f9a 100644
--- a/backends-common/cassandra/pom.xml
+++ b/backends-common/cassandra/pom.xml
@@ -31,7 +31,7 @@
 Apache James :: Backends Common :: Cassandra
 
 
-4.17.0
+4.18.0
 
 
 
@@ -61,16 +61,6 @@
 testing-base
 test
 
-
-com.datastax.oss
-java-driver-core
-${cassandra.driver.version}
-
-
-com.datastax.oss
-java-driver-query-builder
-${cassandra.driver.version}
-
 
 com.google.guava
 guava
@@ -111,6 +101,16 @@
 json-unit-assertj
 test
 
+
+org.apache.cassandra
+java-driver-core
+${cassandra.driver.version}
+
+
+org.apache.cassandra
+java-driver-query-builder
+${cassandra.driver.version}
+
 
 org.apache.commons
 commons-configuration2


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



(james-project) branch master updated (874764038e -> a4c5e19765)

2024-04-29 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 874764038e JAMES-3693 Fixup parsing `redisURL` when cluster with multi 
url endpoint
 add a4c5e19765 [FIX] Attachments were disposed on the Cassandra driver 
threads (#2211)

No new revisions were added by this update.

Summary of changes:
 .../src/main/java/org/apache/james/mailbox/store/MessageStorer.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


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



(james-mime4j) branch master updated: MIME4J-328 Fix DecoderUtil split point (#101)

2024-04-29 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-mime4j.git


The following commit(s) were added to refs/heads/master by this push:
 new ff415b3a MIME4J-328 Fix DecoderUtil split point (#101)
ff415b3a is described below

commit ff415b3a664066818b7e9ed1ad65f36d9e1fd0f2
Author: Benoit TELLIER 
AuthorDate: Mon Apr 29 14:29:19 2024 +0200

MIME4J-328 Fix DecoderUtil split point (#101)

Huge thanks to Chung dae hyun
---
 .../org/apache/james/mime4j/codec/DecoderUtil.java | 62 ++
 .../apache/james/mime4j/codec/DecoderUtilTest.java |  7 +++
 2 files changed, 59 insertions(+), 10 deletions(-)

diff --git a/core/src/main/java/org/apache/james/mime4j/codec/DecoderUtil.java 
b/core/src/main/java/org/apache/james/mime4j/codec/DecoderUtil.java
index 14a981dd..5526b8fc 100644
--- a/core/src/main/java/org/apache/james/mime4j/codec/DecoderUtil.java
+++ b/core/src/main/java/org/apache/james/mime4j/codec/DecoderUtil.java
@@ -19,6 +19,7 @@
 
 package org.apache.james.mime4j.codec;
 
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.lang.ref.SoftReference;
@@ -28,7 +29,6 @@ import java.util.Map;
 
 import org.apache.james.mime4j.io.InputStreams;
 import org.apache.james.mime4j.util.BufferRecycler;
-import org.apache.james.mime4j.util.ByteArrayBuffer;
 import org.apache.james.mime4j.util.CharsetUtil;
 import org.apache.james.mime4j.util.RecycledByteArrayBuffer;
 
@@ -122,6 +122,10 @@ public class DecoderUtil {
 return new String(decodedBytes, charset);
 }
 
+static byte[] decodeByteAryB(String encodedText, DecodeMonitor monitor) 
throws UnsupportedEncodingException {
+return decodeBase64(encodedText, monitor);
+}
+
 /**
  * Decodes an encoded text encoded with the 'Q' encoding (described in
  * RFC 2047) found in a header field body.
@@ -140,6 +144,10 @@ public class DecoderUtil {
 return new String(decodedBytes, charset);
 }
 
+static byte[] decodeByteAryQ(String encodedText, DecodeMonitor monitor) 
throws UnsupportedEncodingException {
+return decodeQuotedPrintable(replaceUnderscores(encodedText), monitor);
+}
+
 static String decodeEncodedWords(String body)  {
 return decodeEncodedWords(body, DecodeMonitor.SILENT);
 }
@@ -208,8 +216,11 @@ public class DecoderUtil {
 Map charsetOverrides)
 throws IllegalArgumentException {
 
+ByteArrayOutputStream out = new ByteArrayOutputStream();
 StringBuilder sb = new StringBuilder();
 int position = 0;
+String mimeCharset ="";
+String encoding ="";
 
 while (position < body.length()) {
 int startPattern = body.indexOf("=?", position);
@@ -217,6 +228,7 @@ public class DecoderUtil {
 if (position == 0) {
 return body;
 }
+appendStringBuffer(fallback, charsetOverrides, out, sb, 
mimeCharset);
 sb.append(body, position, body.length());
 break;
 }
@@ -227,29 +239,48 @@ public class DecoderUtil {
 
 if (charsetEnd < 0 || encodingEnd < 0 || encodedTextEnd < 0) {
 // Invalid pattern
+appendStringBuffer(fallback, charsetOverrides, out, sb, 
mimeCharset);
 sb.append(body, position, startPattern + 2);
 position = startPattern + 2;
 } else if (encodingEnd == encodedTextEnd) {
+appendStringBuffer(fallback, charsetOverrides, out, sb, 
mimeCharset);
 sb.append(body, position, Math.min(encodedTextEnd + 2, 
body.length()));
 position = encodedTextEnd +2;
 } else {
 String separator = body.substring(position, startPattern);
 if ((!CharsetUtil.isWhitespace(separator) || position == 0) && 
!separator.isEmpty()) {
+appendStringBuffer(fallback, charsetOverrides, out, sb, 
mimeCharset);
 sb.append(separator);
 }
-String mimeCharset = body.substring(startPattern + 2, 
charsetEnd);
-String encoding = body.substring(charsetEnd + 1, encodingEnd);
+String mimeCurCharset = body.substring(startPattern + 2, 
charsetEnd);
+String curEncoding = body.substring(charsetEnd + 1, 
encodingEnd);
 String encodedText = body.substring(encodingEnd + 1, 
encodedTextEnd);
 
+if (!mimeCharset.isEmpty() && 
!mimeCurCharset.equals(mimeCharset)){
+appendStringBuffer(fallback, charsetOverrides, out, sb, 
mimeCharset);
+}
+
+if (!encoding.isEmpty() && !curEncoding.equals(encoding)){
+

(james-project) branch master updated (9166b778cb -> b351841813)

2024-04-16 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 9166b778cb [ENHANCEMENT] More information in mailrepository audit log
 add b351841813 [FIX] Multi-mailbox search should not fail when user has 
many mailboxes (#2198)

No new revisions were added by this update.

Summary of changes:
 .../opensearch/OpenSearchIntegrationTest.java  | 37 ++
 1 file changed, 37 insertions(+)


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



(james-project) branch master updated: [DOCUMENTATION] Refresh server/features.xml (#2178)

2024-04-07 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 6a316e53a7 [DOCUMENTATION] Refresh server/features.xml (#2178)
6a316e53a7 is described below

commit 6a316e53a7c0a2070fd376cbbcb1bf469119441e
Author: Benoit TELLIER 
AuthorDate: Sun Apr 7 13:24:30 2024 +0700

[DOCUMENTATION] Refresh server/features.xml (#2178)
---
 src/site/xdoc/server/features.xml | 78 +--
 1 file changed, 18 insertions(+), 60 deletions(-)

diff --git a/src/site/xdoc/server/features.xml 
b/src/site/xdoc/server/features.xml
index e0e383229e..1e09ae2f56 100644
--- a/src/site/xdoc/server/features.xml
+++ b/src/site/xdoc/server/features.xml
@@ -45,7 +45,7 @@
 
 
 POP3
-Experimental
+Stable
 yes
 yes
 1.1
@@ -53,7 +53,7 @@
 
 
 IMAP
-Supported
+Stable
 yes
 no
 3.0
@@ -69,7 +69,7 @@
 
 
 LMTP
-Experimental
+Stable
 yes
 no
 
@@ -85,15 +85,15 @@
 
 
 NNTP
-Experimental
+Dropped (3.x)
 no
 yes
 1.2
 1.2
 
 
-TLS POP3/SMTP
-Experimental
+TLS POP3/SMTP/IMAP
+Stable
 yes
 yes
 1.2
@@ -101,7 +101,7 @@
 
 
 Mailing List
-Experimental
+Dropped (3.x)
 no
 yes
 
@@ -109,7 +109,7 @@
 
 
 FetchMail
-Stable
+Experimental
 yes
 yes
 2.2
@@ -141,7 +141,7 @@
 
 
 TLS Remote Manager
-Stable
+Dropped (3.x)
 yes
 yes
 1.2
@@ -149,7 +149,7 @@
 
 
 JPA Mailbox
-Stable
+Legacy
 yes
 no
 
@@ -157,7 +157,7 @@
 
 
 Cassandra Mailbox
-Beta
+Stable
 yes
 no
 3.0.0
@@ -165,7 +165,7 @@
 
 
 Lucene search
-Stable
+Legacy
 yes
 no
 
@@ -181,7 +181,7 @@
 
 
 Simple search
-Stable
+Stable but not advised
 yes
 no
 3.0.0
@@ -195,14 +195,6 @@
 1.2
 1.0
 
-
-JDBC Database Mail Store
-Experimental
-yes
-yes
-1.2
-1.2
-
 
 JPA Database Mail Store
 Experimental
@@ -211,22 +203,6 @@
 
 
 
-
-Alternate Mail stores
-Experimental
-yes
-yes
-
-
-
-
-JDBC Users
-Stable
-yes
-yes
-1.2.1
-1.2.1
-
 
 JPA Users
 Stable
@@ -237,7 +213,7 @@
 
 
 Cassandra Users
-Beta
+Stable
 yes
 no
 3.0.0
@@ -245,20 +221,12 @@
 
 
 LDAP Users
-Experimental
+Stable
 yes
 yes

(james-project) branch droplist created (now 5dca120ce2)

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

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


  at 5dca120ce2 Fix simple typo in run-kubernetes.adoc

No new revisions were added by this update.


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



(james-project) branch dtm-workqueue updated (a32eb317f4 -> 4df78e56e4)

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

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


from a32eb317f4 [ENHANCEMENT] Workqueue for the deleted message vault
 add 4df78e56e4 fixup! [ENHANCEMENT] Workqueue for the deleted message vault

No new revisions were added by this update.

Summary of changes:
 .../main/java/org/apache/james/CassandraRabbitMQJamesServerMain.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


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



(james-project) 03/03: [ENHANCEMENT] IMAP configuration for netty high/low write buffer watermarks

2024-03-26 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 6e7bc6be51ed94deb022209310a6a662880c1813
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 16:56:07 2024 +0100

[ENHANCEMENT] IMAP configuration for netty high/low write buffer watermarks
---
 .../apache/james/protocols/netty/AbstractAsyncServer.java   |  6 ++
 .../docs/modules/ROOT/pages/configure/imap.adoc |  6 ++
 .../java/org/apache/james/imapserver/netty/IMAPServer.java  |  1 +
 .../lib/netty/AbstractConfigurableAsyncServer.java  | 13 +
 src/site/xdoc/server/config-imap4.xml   |  4 
 5 files changed, 30 insertions(+)

diff --git 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
index 1a7c09c76f..c364e80498 100644
--- 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
+++ 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
@@ -34,6 +34,7 @@ import io.netty.channel.Channel;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelOption;
 import io.netty.channel.EventLoopGroup;
+import io.netty.channel.WriteBufferWaterMark;
 import io.netty.channel.epoll.EpollEventLoopGroup;
 import io.netty.channel.epoll.EpollServerSocketChannel;
 import io.netty.channel.group.ChannelGroup;
@@ -73,6 +74,7 @@ public abstract class AbstractAsyncServer implements 
ProtocolServer {
 
 private boolean gracefulShutdown = true;
 private boolean useEpoll = false;
+protected WriteBufferWaterMark writeBufferWaterMark = 
WriteBufferWaterMark.DEFAULT;
 
 public synchronized void setListenAddresses(InetSocketAddress... 
addresses) {
 if (started) {
@@ -89,6 +91,10 @@ public abstract class AbstractAsyncServer implements 
ProtocolServer {
 this.useEpoll = useEpoll;
 }
 
+public void setWriteBufferWaterMark(WriteBufferWaterMark 
writeBufferWaterMark) {
+this.writeBufferWaterMark = writeBufferWaterMark;
+}
+
 /**
  * Set the IO-worker thread count to use.
  *
diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/imap.adoc 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/imap.adoc
index 72352f0fa2..862400ab92 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/imap.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/imap.adoc
@@ -139,6 +139,12 @@ Optional integer, defaults to 2 times the count of CPUs.
 
 | gracefulShutdown
 | true or false - If true attempts a graceful shutdown, which is safer but can 
take time. Defaults to true.
+
+| highWriteBufferWaterMark
+| Netty's write buffer high watermark configuration. Unit supported: none, K, 
M. Netty defaults applied.
+
+| lowWriteBufferWaterMark
+| Netty's write buffer low watermark configuration. Unit supported: none, K, 
M. Netty defaults applied.
 |===
 
 == OIDC setup
diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
index f4fa0c5412..a80fb2e882 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/IMAPServer.java
@@ -243,6 +243,7 @@ public class IMAPServer extends 
AbstractConfigurableAsyncServer implements ImapC
 @Override
 public void initChannel(Channel channel) {
 ChannelPipeline pipeline = channel.pipeline();
+channel.config().setWriteBufferWaterMark(writeBufferWaterMark);
 pipeline.addLast(TIMEOUT_HANDLER, new 
ImapIdleStateHandler(timeout));
 
 connectionLimitUpstreamHandler.ifPresent(handler -> 
pipeline.addLast(HandlerConstants.CONNECTION_LIMIT_HANDLER, handler));
diff --git 
a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 
b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
index 7f2f3338cd..f66c7d9da0 100644
--- 
a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
+++ 
b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
@@ -48,6 +48,7 @@ import 
org.apache.james.protocols.netty.AbstractChannelPipelineFactory;
 import org.apache.james.protocols.netty.AbstractSSLAwareChannelPipelineFactory;
 import org.apache.james.protocols.netty.ChannelHandlerFactory;
 imp

(james-project) branch master updated (effc90e222 -> 6e7bc6be51)

2024-03-26 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 effc90e222 [FIX] Avoid a worring error log upon state not found (#2155)
 new e4fb4c6984 [ENHANCEMENT] Allow James to use native Netty Epoll
 new 45e53c306a [ENHANCEMENT] Netty Epoll transport for Cassandra driver
 new 6e7bc6be51 [ENHANCEMENT] IMAP configuration for netty high/low write 
buffer watermarks

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:
 backends-common/cassandra/pom.xml  |  4 
 pom.xml|  5 
 protocols/netty/pom.xml|  4 
 .../james/protocols/netty/AbstractAsyncServer.java | 28 ++
 .../docs/modules/ROOT/pages/configure/imap.adoc| 12 ++
 .../docs/modules/ROOT/pages/configure/pop3.adoc|  6 +
 .../docs/modules/ROOT/pages/configure/smtp.adoc|  6 +
 .../apache/james/imapserver/netty/IMAPServer.java  |  1 +
 .../lib/netty/AbstractConfigurableAsyncServer.java | 14 +++
 src/site/xdoc/server/config-imap4.xml  | 11 +
 src/site/xdoc/server/config-pop3.xml   |  7 ++
 src/site/xdoc/server/config-smtp-lmtp.xml  |  6 +
 12 files changed, 99 insertions(+), 5 deletions(-)


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



(james-project) 02/03: [ENHANCEMENT] Netty Epoll transport for Cassandra driver

2024-03-26 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 45e53c306a08b8d751d35eab6efa3b1992939d6c
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 16:52:40 2024 +0100

[ENHANCEMENT] Netty Epoll transport for Cassandra driver
---
 backends-common/cassandra/pom.xml | 4 
 1 file changed, 4 insertions(+)

diff --git a/backends-common/cassandra/pom.xml 
b/backends-common/cassandra/pom.xml
index c3c9de4a38..e6a7e324a8 100644
--- a/backends-common/cassandra/pom.xml
+++ b/backends-common/cassandra/pom.xml
@@ -85,6 +85,10 @@
 commons-codec
 test
 
+
+io.netty
+netty-transport-native-epoll
+
 
 io.projectreactor
 reactor-core


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



(james-project) 01/03: [ENHANCEMENT] Allow James to use native Netty Epoll

2024-03-26 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 e4fb4c6984824e6e4bd581642ff146198e8f28e1
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 15:26:01 2024 +0100

[ENHANCEMENT] Allow James to use native Netty Epoll
---
 pom.xml|  5 +
 protocols/netty/pom.xml|  4 
 .../james/protocols/netty/AbstractAsyncServer.java | 22 +-
 .../docs/modules/ROOT/pages/configure/imap.adoc|  6 ++
 .../docs/modules/ROOT/pages/configure/pop3.adoc|  6 ++
 .../docs/modules/ROOT/pages/configure/smtp.adoc|  6 ++
 .../lib/netty/AbstractConfigurableAsyncServer.java |  1 +
 src/site/xdoc/server/config-imap4.xml  |  7 +++
 src/site/xdoc/server/config-pop3.xml   |  7 +++
 src/site/xdoc/server/config-smtp-lmtp.xml  |  6 ++
 10 files changed, 65 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index f6f64705da..7f00a56b60 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2462,6 +2462,11 @@
 netty-transport
 ${netty.version}
 
+
+io.netty
+netty-transport-native-epoll
+${netty.version}
+
 
 io.projectreactor
 reactor-bom
diff --git a/protocols/netty/pom.xml b/protocols/netty/pom.xml
index 34a036950b..1e821b95a1 100644
--- a/protocols/netty/pom.xml
+++ b/protocols/netty/pom.xml
@@ -58,6 +58,10 @@
 io.netty
 netty-handler
 
+
+io.netty
+netty-transport-native-epoll
+
 
 org.mockito
 mockito-core
diff --git 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
index 93036043a4..1a7c09c76f 100644
--- 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
+++ 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
@@ -34,6 +34,8 @@ import io.netty.channel.Channel;
 import io.netty.channel.ChannelInitializer;
 import io.netty.channel.ChannelOption;
 import io.netty.channel.EventLoopGroup;
+import io.netty.channel.epoll.EpollEventLoopGroup;
+import io.netty.channel.epoll.EpollServerSocketChannel;
 import io.netty.channel.group.ChannelGroup;
 import io.netty.channel.group.DefaultChannelGroup;
 import io.netty.channel.nio.NioEventLoopGroup;
@@ -70,7 +72,8 @@ public abstract class AbstractAsyncServer implements 
ProtocolServer {
 protected String jmxName;
 
 private boolean gracefulShutdown = true;
-
+private boolean useEpoll = false;
+
 public synchronized void setListenAddresses(InetSocketAddress... 
addresses) {
 if (started) {
 throw new IllegalStateException("Can only be set when the server 
is not running");
@@ -82,6 +85,10 @@ public abstract class AbstractAsyncServer implements 
ProtocolServer {
 this.gracefulShutdown = gracefulShutdown;
 }
 
+public void setUseEpoll(boolean useEpoll) {
+this.useEpoll = useEpoll;
+}
+
 /**
  * Set the IO-worker thread count to use.
  *
@@ -121,10 +128,15 @@ public abstract class AbstractAsyncServer implements 
ProtocolServer {
 }
 
 ServerBootstrap bootstrap = new ServerBootstrap();
-bootstrap.channel(NioServerSocketChannel.class);
-
-bossGroup = bossWorker.map(count -> new NioEventLoopGroup(count, 
NamedThreadFactory.withName(jmxName + "-boss")));
-workerGroup = new NioEventLoopGroup(ioWorker, 
NamedThreadFactory.withName(jmxName + "-io"));
+if (useEpoll) {
+bootstrap.channel(EpollServerSocketChannel.class);
+bossGroup = bossWorker.map(count -> new EpollEventLoopGroup(count, 
NamedThreadFactory.withName(jmxName + "-boss")));
+workerGroup = new EpollEventLoopGroup(ioWorker, 
NamedThreadFactory.withName(jmxName + "-io"));
+} else {
+bootstrap.channel(NioServerSocketChannel.class);
+bossGroup = bossWorker.map(count -> new NioEventLoopGroup(count, 
NamedThreadFactory.withName(jmxName + "-boss")));
+workerGroup = new NioEventLoopGroup(ioWorker, 
NamedThreadFactory.withName(jmxName + "-io"));
+}
 
 bossGroup.map(boss -> () -> bootstrap.group(boss, 
workerGroup))
 .orElse(() -> bootstrap.group(workerGroup))
diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/imap.adoc 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/imap.adoc
index f99b27ef74..72352f0fa2 100644
--- a/server/apps/distributed-app/do

(james-project) branch master updated: [FIX] Avoid a worring error log upon state not found (#2155)

2024-03-26 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 effc90e222 [FIX] Avoid a worring error log upon state not found (#2155)
effc90e222 is described below

commit effc90e2227fb3671902ae9cc1fa5664fee929d6
Author: Benoit TELLIER 
AuthorDate: Tue Mar 26 08:49:07 2024 +0100

[FIX] Avoid a worring error log upon state not found (#2155)
---
 .../main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala| 2 ++
 .../main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala  | 2 ++
 2 files changed, 4 insertions(+)

diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
index c4e7f8fc0e..6d3af0de3a 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/EmailChangesMethod.scala
@@ -22,6 +22,7 @@ package org.apache.james.jmap.method
 import eu.timepit.refined.auto._
 import jakarta.inject.Inject
 import org.apache.james.jmap.api.change.{CanNotCalculateChangesException, 
EmailChangeRepository, EmailChanges, State => JavaState}
+import org.apache.james.jmap.api.exception.ChangeNotFoundException
 import org.apache.james.jmap.api.model.{AccountId => JavaAccountId}
 import org.apache.james.jmap.core.CapabilityIdentifier.{CapabilityIdentifier, 
JAMES_SHARES, JMAP_MAIL}
 import org.apache.james.jmap.core.Invocation.{Arguments, MethodName}
@@ -61,6 +62,7 @@ class EmailChangesMethod @Inject()(val metricFactory: 
MetricFactory,
 processingContext = invocation.processingContext))
   .onErrorResume {
 case e: CanNotCalculateChangesException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
+case e: ChangeNotFoundException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
 case e => SMono.error(e)
   }
 
diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
index 1ab96c2c5f..482c8c6658 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxChangesMethod.scala
@@ -22,6 +22,7 @@ package org.apache.james.jmap.method
 import eu.timepit.refined.auto._
 import jakarta.inject.Inject
 import org.apache.james.jmap.api.change.{CanNotCalculateChangesException, 
MailboxChangeRepository, MailboxChanges, State => JavaState}
+import org.apache.james.jmap.api.exception.ChangeNotFoundException
 import org.apache.james.jmap.api.model.{AccountId => JavaAccountId}
 import org.apache.james.jmap.core.CapabilityIdentifier.{CapabilityIdentifier, 
JMAP_MAIL}
 import org.apache.james.jmap.core.Invocation.{Arguments, MethodName}
@@ -68,6 +69,7 @@ class MailboxChangesMethod @Inject()(mailboxSerializer: 
MailboxSerializer,
 processingContext = invocation.processingContext))
   .onErrorResume {
 case e: CanNotCalculateChangesException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
+case e: ChangeNotFoundException => 
SMono.just(InvocationWithContext(Invocation.error(ErrorCode.CannotCalculateChanges,
 e.getMessage, invocation.invocation.methodCallId), 
invocation.processingContext))
 case e => SMono.error(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: [FIX] Filter too big values for Cassandra TTLs (#2156)

2024-03-26 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 de80310717 [FIX] Filter too big values for Cassandra TTLs (#2156)
de80310717 is described below

commit de80310717b00db3552db44d1a489919a9600e50
Author: Benoit TELLIER 
AuthorDate: Tue Mar 26 08:48:32 2024 +0100

[FIX] Filter too big values for Cassandra TTLs (#2156)
---
 .../james/vacation/api/NotificationRegistryContract.java | 16 
 .../cassandra/CassandraNotificationRegistryDAO.java  |  3 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git 
a/server/data/data-api/src/test/java/org/apache/james/vacation/api/NotificationRegistryContract.java
 
b/server/data/data-api/src/test/java/org/apache/james/vacation/api/NotificationRegistryContract.java
index 77ec6fe5c6..e443673e62 100644
--- 
a/server/data/data-api/src/test/java/org/apache/james/vacation/api/NotificationRegistryContract.java
+++ 
b/server/data/data-api/src/test/java/org/apache/james/vacation/api/NotificationRegistryContract.java
@@ -62,6 +62,22 @@ public interface NotificationRegistryContract {
 assertThat(notificationRegistry().isRegistered(ACCOUNT_ID, 
recipientId()).block()).isTrue();
 }
 
+@Test
+default void registerShouldWorkWithExpiracyDateInTheFarFuture() {
+when(zonedDateTimeProvider.get()).thenReturn(ZONED_DATE_TIME);
+notificationRegistry().register(ACCOUNT_ID, recipientId(), 
Optional.of(ZonedDateTime.parse("2050-04-03T02:01:05+07:00[Asia/Vientiane]"))).block();
+
+assertThat(notificationRegistry().isRegistered(ACCOUNT_ID, 
recipientId()).block()).isTrue();
+}
+
+@Test
+default void registerShouldWorkWithExpiracyDateInTheFarFarFuture() {
+when(zonedDateTimeProvider.get()).thenReturn(ZONED_DATE_TIME);
+notificationRegistry().register(ACCOUNT_ID, recipientId(), 
Optional.of(ZonedDateTime.parse("2120-04-03T02:01:05+07:00[Asia/Vientiane]"))).block();
+
+assertThat(notificationRegistry().isRegistered(ACCOUNT_ID, 
recipientId()).block()).isTrue();
+}
+
 @Test
 default void registerShouldExpireAfterExpiracyDate() {
 when(zonedDateTimeProvider.get()).thenReturn(ZONED_DATE_TIME);
diff --git 
a/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryDAO.java
 
b/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryDAO.java
index ec498ee800..3f6b8b80c8 100644
--- 
a/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryDAO.java
+++ 
b/server/data/data-cassandra/src/main/java/org/apache/james/vacation/cassandra/CassandraNotificationRegistryDAO.java
@@ -76,7 +76,8 @@ public class CassandraNotificationRegistryDAO {
 
 public Mono register(AccountId accountId, RecipientId recipientId, 
Optional ttl) {
 return cassandraAsyncExecutor.executeVoid(
-ttl.map(value -> registerWithTTLStatement.bind().setInt(TTL, 
value))
+ttl.filter(value -> value <= 63072) // Maximum value for 
Cassandra's TTL
+.map(value -> registerWithTTLStatement.bind().setInt(TTL, 
value))
 .orElse(registerStatement.bind())
 .setString(CassandraNotificationTable.ACCOUNT_ID, 
accountId.getIdentifier())
 .setString(CassandraNotificationTable.RECIPIENT_ID, 
recipientId.getAsString()));


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



(james-project) branch master updated (f3f9f24805 -> 288e25c2df)

2024-03-26 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 f3f9f24805 JAMES-3961 data-file RRT test should not fail unstable test 
phase
 add 288e25c2df [CHANGELOG] Changelog update (25/03/2024) (#2153)

No new revisions were added by this update.

Summary of changes:
 CHANGELOG.md| 81 -
 upgrade-instructions.md | 29 ++
 2 files changed, 109 insertions(+), 1 deletion(-)


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



(james-project) branch dtm-workqueue updated (ea55fca4d0 -> a32eb317f4)

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

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


omit ea55fca4d0 fixup! fixup! fixup! fixup! fixup! [ENHANCEMENT] Workqueue 
for the deleted message vault
omit 93903ded0e fixup! fixup! fixup! fixup! [ENHANCEMENT] Workqueue for the 
deleted message vault
omit f9a3eb5402 fixup! fixup! fixup! [ENHANCEMENT] Workqueue for the 
deleted message vault
omit 2791137c91 fixup! fixup! [ENHANCEMENT] Workqueue for the deleted 
message vault
omit 3ee3a6299f fixup! [ENHANCEMENT] Workqueue for the deleted message vault
omit 7082160d7a [ENHANCEMENT] Workqueue for the deleted message vault
 add 8c7fe1ef73 [Fixup] Fix imap and smtp deployment test after mime4j 
upgrade to 0.8.11
 add 14f28d2dc6 JAMES-3961 Switch to Java 21
 add 454d82ea11 JAMES-3961 Upgrade maven-plugin-plugin in order to work 
with Java 21
 add d496df7104 JAMES-3961 Enfoce Maven 3.8.1+ usage
 add b56204abb6 JAMES-3961 Upgrade mockito: 5.2.0 -> 5.10.0
 add 7995f1dcaa JAMES-3961 Update xbean-asm9 to make JPA work with Java 21
 add 99d1d0432d JAMES-3961 Fix LeakAware test suite
 add 7f2fca77ed JAMES-3961 Relax Java modules
 add 8dab7eb842 JAMES-3691 Exception message change with Java 21
 add fdc9fbb9ec JAMES-3691 Update Cucumber to 7.15.0
 add 7c471f0967 JAMES-3961 AssertJ bean introspection
 add 6ea766d82a JAMES-3961 Mockito can no longer Mock EnumSet
 add 021cc5df44 JAMES-3961 Java 21 error message change
 add 65acac3d2c JAMES-3961 Cucumber update for JMAP draft integration tests
 add f659e241ae JAMES-3961 Fix PushSubscriptionSetMethodContract for Java 21
 add f0a7aeaf88 JAMES-3961 README: Java 11 -> 21
 add e63283960f JAMES-3961 Adopt eclipse-temurin:21-jre-jammy as a base 
docker image
 add 0f5d30525d JAMES-3961 Target jdk 11 for JPA modules
 add 1afab21248 JAMES-3961 Cucumber tests should not fail the unstable test 
phase
 add 69a2c04144 [FIX] IMAP APPEND file leak
 add c41e9fde43 [ENHANCEMENT] JMAP: limit parallel read in case of fastView 
miss
 add 6243bf7d4e JAMES-3977 Test for backpressure
 add 0d576d8123 JAMES-2586 Fix 
EmailSetMethod.emailGetShouldReturnUncheckedMailAddressValueWhenDraftEmail test
 add fe67473bd2 JAMES-3534 Update IdentityGetContract - fix failing when 
running with Distributed test
 add f5e8bc24ee JAMES-2586 Create AttachmentIdFactory (#2133)
 add a482e80738 [FIX] S3BlobStoreDAO::readReactive is blocking on the 
driver thread
 add f038aa737d Bump org.apache.commons:commons-configuration2 from 2.9.0 
to 2.10.1 (#2147)
 add 4e2bb0b57b [FIX] Avoid sending bounce when reprocessing (#2139)
 add 11646b05bb [UPDATE] more javax APIs migrated to jakarta (#2141)
 add 9fb9faf026 [FIX] Solve weave/rest-smtp-sink: Docker image manifest v2 
schema 1 deprecation issue (#2152)
 add a32eb317f4 [ENHANCEMENT] Workqueue for the deleted message vault

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ea55fca4d0)
\
 N -- N -- N   refs/heads/dtm-workqueue (a32eb317f4)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 Jenkinsfile|   2 +-
 backends-common/cassandra/pom.xml  |   8 +-
 .../components/CassandraQuotaCurrentValueDao.java  |   2 +-
 .../components/CassandraQuotaLimitDao.java |   2 +-
 .../cassandra/init/CassandraTableManager.java  |   2 +-
 .../cassandra/init/CassandraTypesProvider.java |   2 +-
 .../cassandra/init/ResilientClusterProvider.java   |   8 +-
 .../init/SessionWithInitializedTablesFactory.java  |   8 +-
 .../migration/CassandraMigrationService.java   |   4 +-
 .../migration/CassandraSchemaTransitions.java  |   2 +-
 .../cassandra/migration/MigrationTask.java |   2 +-
 .../cassandra/utils/CassandraAsyncExecutor.java|   2 +-
 .../cassandra/utils/CassandraHealthCheck.java  |   2 +-
 .../versions/CassandraSchemaVersionDAO.java|   2 +-
 .../versions/CassandraSchemaVersionManager.java|   2 +-
 backends-common/jpa/pom.xml|  12 +-
 .../james/backends/jpa/EntityManagerUtils.java |   2 +-
 .../james/backends/jpa/TransactionRunner.java  |   8 +-
 .../apache/james/backends/jpa/JpaTestCluster.java  |   4 +-
 

(james-project) branch master updated: [FIX] Solve weave/rest-smtp-sink: Docker image manifest v2 schema 1 deprecation issue (#2152)

2024-03-25 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 9fb9faf026 [FIX] Solve weave/rest-smtp-sink: Docker image manifest v2 
schema 1 deprecation issue (#2152)
9fb9faf026 is described below

commit 9fb9faf026a9883b20f9638e2a5d63a73b3fa519
Author: Trần Hồng Quân <55171818+quantranhong1...@users.noreply.github.com>
AuthorDate: Mon Mar 25 21:20:42 2024 +0700

[FIX] Solve weave/rest-smtp-sink: Docker image manifest v2 schema 1 
deprecation issue (#2152)

cf: 
https://docs.docker.com/engine/deprecated/#pushing-and-pulling-with-image-manifest-v2-schema-1

Use a rebuilt image would be the trick.
---
 server/testing/src/main/java/org/apache/james/util/docker/Images.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/server/testing/src/main/java/org/apache/james/util/docker/Images.java 
b/server/testing/src/main/java/org/apache/james/util/docker/Images.java
index 8e8ff45097..43787e505c 100644
--- a/server/testing/src/main/java/org/apache/james/util/docker/Images.java
+++ b/server/testing/src/main/java/org/apache/james/util/docker/Images.java
@@ -20,7 +20,7 @@
 package org.apache.james.util.docker;
 
 public interface Images {
-String FAKE_SMTP = "weave/rest-smtp-sink:latest";
+String FAKE_SMTP = "quanth99/rest-smtp-sink:1.0"; // Original Dockerfile: 
https://github.com/ambled/rest-smtp-sink/blob/master/Dockerfile
 String RABBITMQ = "rabbitmq:3.12.1-management";
 String ELASTICSEARCH_2 = "elasticsearch:2.4.6";
 String ELASTICSEARCH_6 = 
"docker.elastic.co/elasticsearch/elasticsearch:6.3.2";


-
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] Avoid sending bounce when reprocessing (#2139)

2024-03-22 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 4e2bb0b57b [FIX] Avoid sending bounce when reprocessing (#2139)
4e2bb0b57b is described below

commit 4e2bb0b57bd949709a92978ba312bdfb87a04727
Author: Benoit TELLIER 
AuthorDate: Fri Mar 22 14:55:42 2024 +0100

[FIX] Avoid sending bounce when reprocessing (#2139)
---
 server/apps/cassandra-app/sample-configuration/mailetcontainer.xml  | 5 -
 .../apps/distributed-app/sample-configuration/mailetcontainer.xml   | 5 -
 server/apps/distributed-app/src/test/resources/mailetcontainer.xml  | 5 -
 .../distributed-pop3-app/sample-configuration/mailetcontainer.xml   | 5 -
 .../distributed-pop3-app/src/test/resources/mailetcontainer.xml | 5 -
 server/apps/jpa-app/sample-configuration/mailetcontainer.xml| 5 -
 server/apps/jpa-app/src/test/resources/mailetcontainer.xml  | 5 -
 server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml   | 5 -
 server/apps/jpa-smtp-app/src/test/resources/mailetcontainer.xml | 5 -
 server/apps/memory-app/sample-configuration/mailetcontainer.xml | 5 -
 server/apps/memory-app/src/test/resources/mailetcontainer.xml   | 5 -
 .../scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml| 5 -
 .../apps/scaling-pulsar-smtp/src/test/resources/mailetcontainer.xml | 5 -
 server/apps/spring-app/src/main/resources/mailetcontainer.xml   | 6 +-
 14 files changed, 57 insertions(+), 14 deletions(-)

diff --git a/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml 
b/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml
index f9c62031f0..bcd4a99f11 100644
--- a/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml
@@ -46,10 +46,13 @@
 
 
 
+
+
+
 
 mailetContainerErrors
 
-
+
 ignore
 
 
diff --git 
a/server/apps/distributed-app/sample-configuration/mailetcontainer.xml 
b/server/apps/distributed-app/sample-configuration/mailetcontainer.xml
index f9c62031f0..7885ff1796 100644
--- a/server/apps/distributed-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/distributed-app/sample-configuration/mailetcontainer.xml
@@ -46,10 +46,13 @@
 
 
 
+
+
+
 
 mailetContainerErrors
 
-
+
 ignore
 
 
diff --git a/server/apps/distributed-app/src/test/resources/mailetcontainer.xml 
b/server/apps/distributed-app/src/test/resources/mailetcontainer.xml
index 62a33ce870..119f0f89c1 100644
--- a/server/apps/distributed-app/src/test/resources/mailetcontainer.xml
+++ b/server/apps/distributed-app/src/test/resources/mailetcontainer.xml
@@ -40,7 +40,10 @@
 
 
 
-
+
+
+
+
 ignore
 
 
diff --git 
a/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml 
b/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml
index 945deba91f..19a839cdc1 100644
--- a/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml
@@ -46,10 +46,13 @@
 
 
 
+
+
+
 
 mailetContainerErrors
 
-
+
 ignore
 
 
diff --git 
a/server/apps/distributed-pop3-app/src/test/resources/mailetcontainer.xml 
b/server/apps/distributed-pop3-app/src/test/resources/mailetcontainer.xml
index 16cf49b911..cb0a08af66 100644
--- a/server/apps/distributed-pop3-app/src/test/resources/mailetcontainer.xml
+++ b/server/apps/distributed-pop3-app/src/test/resources/mailetcontainer.xml
@@ -40,7 +40,10 @@
 
 
 
-
+
+
+
+
 ignore
 
 
diff --git a/server/apps/jpa-app/sample-configuration/mailetcontainer.xml 
b/server/apps/jpa-app/sample-configuration/mailetcontainer.xml
index 90cbcedef1..55e84ba625 100644
--- a/server/apps/jpa-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/jpa-app/sample-configuration/mailetcontainer.xml
@@ -46,10 +46,13 @@
 
 
 
+
+
+
 
 mailetContainerErrors
 
-
+
 ignore
 
 
diff

(james-project) branch master updated: Bump org.apache.commons:commons-configuration2 from 2.9.0 to 2.10.1 (#2147)

2024-03-22 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 f038aa737d Bump org.apache.commons:commons-configuration2 from 2.9.0 
to 2.10.1 (#2147)
f038aa737d is described below

commit f038aa737d58d4581d1a3f90df81684ff1ab3ec0
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Fri Mar 22 14:55:00 2024 +0100

Bump org.apache.commons:commons-configuration2 from 2.9.0 to 2.10.1 (#2147)

Bumps org.apache.commons:commons-configuration2 from 2.9.0 to 2.10.1.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-configuration2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index cad9398faf..be1301d2b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2585,7 +2585,7 @@
 
 org.apache.commons
 commons-configuration2
-2.9.0
+2.10.1
 
 
 commons-logging


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



(james-project) branch dtm-workqueue updated (93903ded0e -> ea55fca4d0)

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

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


from 93903ded0e fixup! fixup! fixup! fixup! [ENHANCEMENT] Workqueue for the 
deleted message vault
 add ea55fca4d0 fixup! fixup! fixup! fixup! fixup! [ENHANCEMENT] Workqueue 
for the deleted message vault

No new revisions were added by this update.

Summary of changes:
 .../james/modules/mailbox/DistributedDeletedMessageVaultModule.java| 3 ---
 1 file changed, 3 deletions(-)


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



(james-project) branch dtm-workqueue updated (7082160d7a -> 93903ded0e)

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

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


from 7082160d7a [ENHANCEMENT] Workqueue for the deleted message vault
 add 3ee3a6299f fixup! [ENHANCEMENT] Workqueue for the deleted message vault
 add 2791137c91 fixup! fixup! [ENHANCEMENT] Workqueue for the deleted 
message vault
 add f9a3eb5402 fixup! fixup! fixup! [ENHANCEMENT] Workqueue for the 
deleted message vault
 add 93903ded0e fixup! fixup! fixup! fixup! [ENHANCEMENT] Workqueue for the 
deleted message vault

No new revisions were added by this update.

Summary of changes:
 .../mailbox/cassandra/DeleteMessageListener.java   | 13 +++--
 .../DeletedMessageVaultDeletionCallback.java   |  2 +-
 .../org/apache/james/vault/VaultConfiguration.java | 22 --
 .../apache/james/vault/VaultConfigurationTest.java | 12 ++--
 .../james/CassandraRabbitMQJamesServerMain.java|  8 +++-
 .../james/DistributedPOP3JamesServerMain.java  |  8 +++-
 ...ributedDeletedMessageVaultDeletionCallback.java | 13 -
 .../DistributedDeletedMessageVaultModule.java  | 12 
 ...EnabledDeletedMessageVaultIntegrationTest.java} |  4 ++--
 9 files changed, 66 insertions(+), 28 deletions(-)
 copy 
server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/vault/{RabbitMQDeletedMessageVaultIntegrationTest.java
 => WorkQueueEnabledDeletedMessageVaultIntegrationTest.java} (95%)


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



(james-project) 10/18: JAMES-3961 AssertJ bean introspection

2024-03-19 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 7c471f0967a869059f4b28bba2e5c369562cd0b6
Author: Benoit TELLIER 
AuthorDate: Thu Jan 11 13:25:35 2024 +0100

JAMES-3961 AssertJ bean introspection
---
 .../apache/james/JsonSerializationVerifier.java| 22 -
 ...omputeMailboxCountersTaskSerializationTest.java |  4 +++-
 .../SolveMailboxInconsistenciesServiceTest.java|  5 +++-
 ...essageInconsistenciesTaskSerializationTest.java |  8 +--
 mailbox/jpa/pom.xml|  6 +
 mailbox/memory/pom.xml |  6 +
 ...rorRecoveryIndexationTaskSerializationTest.java |  7 --
 .../FullReindexingTaskSerializationTest.java   |  7 --
 ...ngleMailboxReindexingTaskSerializationTest.java |  7 --
 .../UserReindexingTaskSerializationTest.java   |  8 ---
 .../RecomputeCurrentQuotasServiceContract.java |  5 +++-
 ...ecomputeCurrentQuotasTaskSerializationTest.java |  7 --
 .../BlobGCTaskAdditionalInformationDTOTest.java|  4 +++-
 .../deduplication/BlobGCTaskSerializationTest.java |  5 ++--
 .../james/jmap/cassandra/filtering/DTOTest.java| 28 +++---
 .../change/StateChangeEventSerializerTest.scala|  5 
 ...sandraMappingsSolveInconsistenciesTaskTest.java | 15 +++-
 ...ctionItemsTaskAdditionalInformationDTOTest.java |  5 ++--
 ...stViewProjectionItemsTaskSerializationTest.java |  4 +++-
 ...ctionItemsTaskAdditionalInformationDTOTest.java |  4 +++-
 ...stViewProjectionItemsTaskSerializationTest.java |  4 +++-
 .../service/ReprocessingAllMailsTaskTest.java  | 16 +
 .../service/ReprocessingOneMailTaskTest.java   |  8 ---
 23 files changed, 147 insertions(+), 43 deletions(-)

diff --git a/json/src/test/java/org/apache/james/JsonSerializationVerifier.java 
b/json/src/test/java/org/apache/james/JsonSerializationVerifier.java
index 09cf2a8934..19c965b4ab 100644
--- a/json/src/test/java/org/apache/james/JsonSerializationVerifier.java
+++ b/json/src/test/java/org/apache/james/JsonSerializationVerifier.java
@@ -23,19 +23,38 @@ import static 
net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
+import java.util.Comparator;
 import java.util.List;
 import java.util.Optional;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.BiConsumer;
+import java.util.function.BiPredicate;
+import java.util.regex.Pattern;
 
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.james.json.DTO;
 import org.apache.james.json.DTOModule;
 import org.apache.james.json.JsonGenericSerializer;
+import 
org.assertj.core.api.recursive.comparison.RecursiveComparisonConfiguration;
 
 import com.github.fge.lambdas.Throwing;
 import com.google.common.collect.ImmutableList;
 
 public class JsonSerializationVerifier {
+
+public static final RecursiveComparisonConfiguration 
recursiveComparisonConfiguration = new RecursiveComparisonConfiguration();
+
+static {
+
recursiveComparisonConfiguration.registerComparatorForType(Comparator.comparingInt(AtomicInteger::get),
 AtomicInteger.class);
+
recursiveComparisonConfiguration.registerComparatorForType(Comparator.comparingLong(AtomicLong::get),
 AtomicLong.class);
+recursiveComparisonConfiguration.registerEqualsForType((o, o2) -> 
o.get() == o2.get(), AtomicInteger.class);
+recursiveComparisonConfiguration.registerEqualsForType((o, o2) -> 
o.get() == o2.get(), AtomicLong.class);
+recursiveComparisonConfiguration.registerEqualsForType((o, o2) -> 
o.get() == o2.get(), AtomicBoolean.class);
+recursiveComparisonConfiguration.registerEqualsForType((o, o2) -> 
o.toString().equalsIgnoreCase(o2.toString()), Pattern.class);
+}
+
 @FunctionalInterface
 public interface RequireJson {
 JsonSerializationVerifier json(String json);
@@ -61,7 +80,8 @@ public class JsonSerializationVerifier {
 private static  EqualityTester defaultEqualityTester() {
 return (a, b) -> assertThat(a)
 .describedAs("Deserialization test [" + b + "]")
-.isEqualToComparingFieldByFieldRecursively(b);
+.usingRecursiveComparison(recursiveComparisonConfiguration)
+.isEqualTo(b);
 }
 
 private final List> testValues;
diff --git 
a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/task/RecomputeMailboxCountersTaskSerializationTest.java
 
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/task/RecomputeMailboxCountersTaskSerializationTest.java
index 948471073e..948ad9bf86 100644
--- 
a/mailbox/cassandra/

(james-project) 18/18: JAMES-3961 Cucumber tests should not fail the unstable test phase

2024-03-19 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 1afab2124813fd5c11d337fe35e7c6ac7b8990c3
Author: Quan Tran 
AuthorDate: Wed Jan 31 13:23:03 2024 +0700

JAMES-3961 Cucumber tests should not fail the unstable test phase

Actually, the Cucumber tests already run in the stable test phase.
But with the `@Suite` annotation, the `maven-surefire-plugin` pulled the 
Cucumber tests into the unstable tests phase as well. Somehow during the 
unstable tests phase, the maven plugin could not detect any cucumber tests and 
failed the entire unstable test phase.
---
 .../src/test/java/org/apache/james/rrt/cassandra/RewriteTablesTest.java | 2 +-
 .../src/test/java/org/apache/james/rrt/jpa/RewriteTablesTest.java   | 2 +-
 .../src/test/java/org/apache/james/rrt/memory/RewriteTablesTest.java| 2 +-
 .../james/jmap/memory/cucumber/MemoryDownloadEnpointCucumberTest.java   | 2 +-
 .../james/jmap/memory/cucumber/MemoryDownloadGetCucumberTest.java   | 2 +-
 .../james/jmap/memory/cucumber/MemoryDownloadPostCucumberTest.java  | 2 +-
 .../apache/james/jmap/memory/cucumber/MemoryGetMessagesMethodTest.java  | 2 +-
 .../jmap/memory/cucumber/MemoryIMAPKeywordsInconsistenciesTest.java | 2 +-
 .../jmap/memory/cucumber/MemoryIMAPSetMessagesCompatibilityTest.java| 2 +-
 .../jmap/memory/cucumber/MemorySetMailboxesMethodCucumberTest.java  | 2 +-
 .../james/jmap/memory/cucumber/MemorySetMessagesMethodCucumberTest.java | 2 +-
 .../java/org/apache/james/jmap/memory/cucumber/MemorySharingTest.java   | 2 +-
 .../org/apache/james/jmap/memory/cucumber/MemoryUploadCucumberTest.java | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git 
a/server/data/data-cassandra/src/test/java/org/apache/james/rrt/cassandra/RewriteTablesTest.java
 
b/server/data/data-cassandra/src/test/java/org/apache/james/rrt/cassandra/RewriteTablesTest.java
index 5223d5e5bf..a23f8bc61e 100644
--- 
a/server/data/data-cassandra/src/test/java/org/apache/james/rrt/cassandra/RewriteTablesTest.java
+++ 
b/server/data/data-cassandra/src/test/java/org/apache/james/rrt/cassandra/RewriteTablesTest.java
@@ -25,7 +25,7 @@ import org.junit.platform.suite.api.IncludeEngines;
 import org.junit.platform.suite.api.SelectClasspathResource;
 import org.junit.platform.suite.api.Suite;
 
-@Suite
+@Suite(failIfNoTests = false)
 @IncludeEngines("cucumber")
 @SelectClasspathResource("cucumber")
 @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = 
"org.apache.james.rrt.lib,org.apache.james.rrt.cassandra")
diff --git 
a/server/data/data-jpa/src/test/java/org/apache/james/rrt/jpa/RewriteTablesTest.java
 
b/server/data/data-jpa/src/test/java/org/apache/james/rrt/jpa/RewriteTablesTest.java
index 35fcc586b4..a4269d3e40 100644
--- 
a/server/data/data-jpa/src/test/java/org/apache/james/rrt/jpa/RewriteTablesTest.java
+++ 
b/server/data/data-jpa/src/test/java/org/apache/james/rrt/jpa/RewriteTablesTest.java
@@ -25,7 +25,7 @@ import org.junit.platform.suite.api.IncludeEngines;
 import org.junit.platform.suite.api.SelectClasspathResource;
 import org.junit.platform.suite.api.Suite;
 
-@Suite
+@Suite(failIfNoTests = false)
 @IncludeEngines("cucumber")
 @SelectClasspathResource("cucumber")
 @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = 
"org.apache.james.rrt.lib,org.apache.james.rrt.jpa")
diff --git 
a/server/data/data-memory/src/test/java/org/apache/james/rrt/memory/RewriteTablesTest.java
 
b/server/data/data-memory/src/test/java/org/apache/james/rrt/memory/RewriteTablesTest.java
index aba5dc7f3d..ad9e3a7e57 100644
--- 
a/server/data/data-memory/src/test/java/org/apache/james/rrt/memory/RewriteTablesTest.java
+++ 
b/server/data/data-memory/src/test/java/org/apache/james/rrt/memory/RewriteTablesTest.java
@@ -25,7 +25,7 @@ import org.junit.platform.suite.api.IncludeEngines;
 import org.junit.platform.suite.api.SelectClasspathResource;
 import org.junit.platform.suite.api.Suite;
 
-@Suite
+@Suite(failIfNoTests = false)
 @IncludeEngines("cucumber")
 @SelectClasspathResource("cucumber")
 @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = 
"org.apache.james.rrt.lib,org.apache.james.rrt.memory")
diff --git 
a/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryDownloadEnpointCucumberTest.java
 
b/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryDownloadEnpointCucumberTest.java
index 59b62c5c50..f47529bc1c 100644
--- 
a/server/protocols/jmap-draft-integration-testing/memory-jmap-draft-integration-testing/src/test/java/org/apache/james/jmap/memory/cucumber/MemoryDownloadEnpointCucumberTest.java
+++ 
b/server/protocols/jmap-draft-int

(james-project) 13/18: JAMES-3961 Cucumber update for JMAP draft integration tests

2024-03-19 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 65acac3d2ce1e7bbbae7fa2017e52a5d458d63b4
Author: Benoit TELLIER 
AuthorDate: Tue Jan 16 11:36:12 2024 +0100

JAMES-3961 Cucumber update for JMAP draft integration tests
---
 pom.xml|   6 +-
 server/data/data-cassandra/pom.xml |   5 +
 server/data/data-jpa/pom.xml   |   5 +
 server/data/data-library/pom.xml   |   5 +
 server/data/data-memory/pom.xml|   5 +
 .../cucumber/GetMessageListMethodStepdefs.java |  13 ++-
 .../cucumber/GetMessagesMethodStepdefs.java|  72 +++-
 .../cucumber/SetMessagesMethodStepdefs.java|  15 +--
 .../methods/integration/cucumber/UserStepdefs.java |   9 +-
 .../resources/cucumber/DownloadEndpoint.feature|   2 +-
 .../test/resources/cucumber/DownloadGet.feature|   2 +-
 .../test/resources/cucumber/GetMessages.feature| 110 +--
 .../cucumber/ImapKeywordsConsistency.feature   |   8 +-
 .../cucumber/sharing/CopyAndSharing.feature|   2 +-
 .../cucumber/sharing/DownloadAndSharing.feature|   2 +-
 .../cucumber/sharing/GetMessageAndSharing.feature  |   8 +-
 .../KeywordsConsistencyOnDelegationMailbox.feature |  26 ++---
 .../sharing/MailboxCreationAndSharing.feature  |   2 +-
 .../cucumber/sharing/MoveMailboxAndSharing.feature |   2 +-
 .../cucumber/sharing/MoveMessageAndSharing.feature |   2 +-
 .../sharing/RenamingMailboxAndSharing.feature  |   2 +-
 .../cucumber/sharing/SetFlagAndSharing.feature |   2 +-
 .../sharing/SetMessagesOnSharedMailbox.feature |   2 +-
 ...ringParentMailboxWithAndWithoutChildren.feature |  12 +-
 ...java => MemoryDownloadEnpointCucumberTest.java} |   4 +-
 .../cucumber/MemoryDownloadGetCucumberTest.java}   |  13 +--
 .../cucumber/MemoryDownloadPostCucumberTest.java}  |  13 +--
 .../MemorySetMailboxesMethodCucumberTest.java  |   2 +-
 .../cucumber/awss3/CucumberAwsS3Singleton.java |  27 -
 .../cucumber/awss3/CucumberCassandraSingleton.java |  27 -
 .../awss3/CucumberOpenSearchSingleton.java |  27 -
 .../cucumber/awss3/CucumberRabbitMQSingleton.java  |  26 -
 .../cucumber/awss3/RabbitMQAwsS3Stepdefs.java  | 121 -
 .../awss3/RabbitMQDownloadCucumberTest.java|  40 ---
 .../awss3/RabbitMQGetMessagesMethodTest.java   |  40 ---
 .../RabbitMQSetMailboxesMethodCucumberTest.java|  40 ---
 .../RabbitMQSetMessagesMethodCucumberTest.java |  40 ---
 .../cucumber/awss3/RabbitMQSharingTest.java|  40 ---
 .../cucumber/awss3/RabbitMQUploadCucumberTest.java |  40 ---
 39 files changed, 193 insertions(+), 626 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2000ff18f8..cad9398faf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2350,12 +2350,16 @@
 cucumber-junit-platform-engine
 ${cucumber.version}
 
-
 
 io.cucumber
 cucumber-picocontainer
 ${cucumber.version}
 
+
+io.cucumber
+messages
+22.0.0
+
 
 io.dropwizard.metrics
 metrics-core
diff --git a/server/data/data-cassandra/pom.xml 
b/server/data/data-cassandra/pom.xml
index c5199c86dd..801ccb2017 100644
--- a/server/data/data-cassandra/pom.xml
+++ b/server/data/data-cassandra/pom.xml
@@ -115,6 +115,11 @@
 cucumber-picocontainer
 test
 
+
+io.cucumber
+messages
+test
+
 
 net.javacrumbs.json-unit
 json-unit-assertj
diff --git a/server/data/data-jpa/pom.xml b/server/data/data-jpa/pom.xml
index 00656337b8..dbd51824d8 100644
--- a/server/data/data-jpa/pom.xml
+++ b/server/data/data-jpa/pom.xml
@@ -119,6 +119,11 @@
 cucumber-picocontainer
 test
 
+
+io.cucumber
+messages
+test
+
 
 org.apache.commons
 commons-configuration2
diff --git a/server/data/data-library/pom.xml b/server/data/data-library/pom.xml
index 5f984c7ec9..5170eacf17 100644
--- a/server/data/data-library/pom.xml
+++ b/server/data/data-library/pom.xml
@@ -91,6 +91,11 @@
 cucumber-junit
 test
 
+
+io.cucumber
+messages
+test
+
 
 javax.annotation
 javax.annotation-api
diff --git a/server/data/data-memory/pom.xml b/server/data/data-memory/pom.xml
index b2e99fefab..a5aa36887b 100644
--- a/server/data/data-memory/pom.xml
+++ b/server/data/data-memory/pom.xml
@@ -93,6 +93,11 @@
 cucumber-picocontai

(james-project) 04/18: JAMES-3961 Upgrade mockito: 5.2.0 -> 5.10.0

2024-03-19 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 b56204abb60131aaa193b2ee30b9d152ab987238
Author: Benoit TELLIER 
AuthorDate: Fri Dec 1 20:56:21 2023 +0100

JAMES-3961 Upgrade mockito: 5.2.0 -> 5.10.0

This allows mockito to run with Java 21.
mockito-inline was unused btw.
---
 pom.xml| 7 +--
 server/protocols/webadmin/webadmin-http-client/pom.xml | 5 -
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/pom.xml b/pom.xml
index c92e108a0c..54a911858b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -658,7 +658,7 @@
 ${scala.base}.11
 5.0.0
 none
-5.2.0
+5.10.0
 0.8.9
 2.38.0
 
@@ -2826,11 +2826,6 @@
 mockito-core
 ${mockito.version}
 
-
-org.mockito
-mockito-inline
-${mockito.version}
-
 
 org.scala-lang
 scala-library
diff --git a/server/protocols/webadmin/webadmin-http-client/pom.xml 
b/server/protocols/webadmin/webadmin-http-client/pom.xml
index 36819869b8..77d7fb56f3 100644
--- a/server/protocols/webadmin/webadmin-http-client/pom.xml
+++ b/server/protocols/webadmin/webadmin-http-client/pom.xml
@@ -58,11 +58,6 @@
 mockito-core
 test
 
-
-org.mockito
-mockito-inline
-test
-
 
 
 


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



(james-project) 12/18: JAMES-3961 Java 21 error message change

2024-03-19 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 021cc5df448ed84da7a2870eaaa7acb3c0866c44
Author: Benoit TELLIER 
AuthorDate: Mon Jan 15 10:35:25 2024 +0100

JAMES-3961 Java 21 error message change
---
 .../james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
index 6e3e4a883d..054f6bdf38 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
@@ -1577,7 +1577,7 @@ trait PushSubscriptionSetMethodContract {
|"notCreated": {
|"4f29": {
|"type": "invalidArguments",
-   |"description": 
"java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: 
IOException: null"
+   |"description": 
"java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: 
IOException: Unable to decode key"
|}
|}
|},


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



(james-project) 16/18: JAMES-3961 Adopt eclipse-temurin:21-jre-jammy as a base docker image

2024-03-19 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 e63283960fc90b676a3f16a5e79818f9df79a046
Author: Benoit TELLIER 
AuthorDate: Mon Jan 22 11:53:20 2024 +0100

JAMES-3961 Adopt eclipse-temurin:21-jre-jammy as a base docker image
---
 server/apps/cassandra-app/pom.xml| 2 +-
 server/apps/distributed-app/pom.xml  | 2 +-
 server/apps/distributed-pop3-app/pom.xml | 2 +-
 server/apps/jpa-app/pom.xml  | 2 +-
 server/apps/jpa-smtp-app/pom.xml | 2 +-
 server/apps/memory-app/pom.xml   | 2 +-
 server/apps/scaling-pulsar-smtp/pom.xml  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/server/apps/cassandra-app/pom.xml 
b/server/apps/cassandra-app/pom.xml
index 10e4349ce2..4db4acd599 100644
--- a/server/apps/cassandra-app/pom.xml
+++ b/server/apps/cassandra-app/pom.xml
@@ -340,7 +340,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-jammy
+eclipse-temurin:21-jre-jammy
 
 
 apache/james
diff --git a/server/apps/distributed-app/pom.xml 
b/server/apps/distributed-app/pom.xml
index de10240467..aedc125853 100644
--- a/server/apps/distributed-app/pom.xml
+++ b/server/apps/distributed-app/pom.xml
@@ -410,7 +410,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-jammy
+eclipse-temurin:21-jre-jammy
 
 
 apache/james
diff --git a/server/apps/distributed-pop3-app/pom.xml 
b/server/apps/distributed-pop3-app/pom.xml
index 4d4e1390f3..c5e4d9a949 100644
--- a/server/apps/distributed-pop3-app/pom.xml
+++ b/server/apps/distributed-pop3-app/pom.xml
@@ -392,7 +392,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-jammy
+eclipse-temurin:21-jre-jammy
 
 
 apache/james
diff --git a/server/apps/jpa-app/pom.xml b/server/apps/jpa-app/pom.xml
index 46dc45246b..6a74c36310 100644
--- a/server/apps/jpa-app/pom.xml
+++ b/server/apps/jpa-app/pom.xml
@@ -272,7 +272,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-jammy
+eclipse-temurin:21-jre-jammy
 
 
 apache/james
diff --git a/server/apps/jpa-smtp-app/pom.xml b/server/apps/jpa-smtp-app/pom.xml
index fdad84848d..aee8124781 100644
--- a/server/apps/jpa-smtp-app/pom.xml
+++ b/server/apps/jpa-smtp-app/pom.xml
@@ -255,7 +255,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-jammy
+eclipse-temurin:21-jre-jammy
 
 
 apache/james
diff --git a/server/apps/memory-app/pom.xml b/server/apps/memory-app/pom.xml
index 578902bf25..57574fb4f3 100644
--- a/server/apps/memory-app/pom.xml
+++ b/server/apps/memory-app/pom.xml
@@ -283,7 +283,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-jammy
+eclipse-temurin:21-jre-jammy
 
 
 apache/james
diff --git a/server/apps/scaling-pulsar-smtp/pom.xml 
b/server/apps/scaling-pulsar-smtp/pom.xml
index 22b43d0368..aa6890660d 100644
--- a/server/apps/scaling-pulsar-smtp/pom.xml
+++ b/server/apps/scaling-pulsar-smtp/pom.xml
@@ -283,7 +283,7 @@
 jib-maven-plugin
 
 
-eclipse-temurin:11-jre-focal
+eclipse-temurin:21-jre-jammy
 
 
 apache/james


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



(james-project) 15/18: JAMES-3961 README: Java 11 -> 21

2024-03-19 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 f0a7aeaf886c4cd144ec2fa8b0878771ed25f666
Author: Benoit TELLIER 
AuthorDate: Mon Jan 22 11:49:33 2024 +0100

JAMES-3961 README: Java 11 -> 21
---
 server/apps/cassandra-app/README.adoc| 2 +-
 server/apps/distributed-app/README.adoc  | 2 +-
 server/apps/distributed-pop3-app/README.adoc | 2 +-
 server/apps/jpa-app/README.adoc  | 2 +-
 server/apps/jpa-smtp-app/README.adoc | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/server/apps/cassandra-app/README.adoc 
b/server/apps/cassandra-app/README.adoc
index ebfd24df93..8cf26021d0 100644
--- a/server/apps/cassandra-app/README.adoc
+++ b/server/apps/cassandra-app/README.adoc
@@ -13,7 +13,7 @@ alternatives (namely S3 compatible BlobStores backed by for 
instance S3, MinIO o
 
 == Requirements
 
- * Java 11 SDK
+ * Java 21 SDK
 
 Firstly, create your own user network on Docker for the James environment:
 
diff --git a/server/apps/distributed-app/README.adoc 
b/server/apps/distributed-app/README.adoc
index 8906871e82..35318ea9fd 100644
--- a/server/apps/distributed-app/README.adoc
+++ b/server/apps/distributed-app/README.adoc
@@ -2,7 +2,7 @@
 
 == Requirements
 
- * Java 11 SDK
+ * Java 21 SDK
 
 Firstly, create your own user network on Docker for the James environment:
 
diff --git a/server/apps/distributed-pop3-app/README.adoc 
b/server/apps/distributed-pop3-app/README.adoc
index 40b034460b..89696773f5 100644
--- a/server/apps/distributed-pop3-app/README.adoc
+++ b/server/apps/distributed-pop3-app/README.adoc
@@ -5,7 +5,7 @@ thus is multi-datacenter friendly, however comes with a reduced 
feature set (onl
 
 == Requirements
 
- * Java 11 SDK
+ * Java 21 SDK
 
 Firstly, create your own user network on Docker for the James environment:
 
diff --git a/server/apps/jpa-app/README.adoc b/server/apps/jpa-app/README.adoc
index ee4555c2a0..5fd2733ef5 100644
--- a/server/apps/jpa-app/README.adoc
+++ b/server/apps/jpa-app/README.adoc
@@ -4,7 +4,7 @@ This server target single node James deployments. By default, 
the derby database
 
 == Requirements
 
- * Java 11 SDK
+ * Java 21 SDK
 
 == Running
 
diff --git a/server/apps/jpa-smtp-app/README.adoc 
b/server/apps/jpa-smtp-app/README.adoc
index bace0ae490..8f99c3f29f 100644
--- a/server/apps/jpa-smtp-app/README.adoc
+++ b/server/apps/jpa-smtp-app/README.adoc
@@ -6,7 +6,7 @@ This server acts as a Mail Transfer Agent and do not embed the 
mailbox component
 
 == Requirements
 
-* Java 11 SDK
+* Java 21 SDK
 
 == Running
 


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



(james-project) branch master updated (8c7fe1ef73 -> 1afab21248)

2024-03-19 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 8c7fe1ef73 [Fixup] Fix imap and smtp deployment test after mime4j 
upgrade to 0.8.11
 new 14f28d2dc6 JAMES-3961 Switch to Java 21
 new 454d82ea11 JAMES-3961 Upgrade maven-plugin-plugin in order to work 
with Java 21
 new d496df7104 JAMES-3961 Enfoce Maven 3.8.1+ usage
 new b56204abb6 JAMES-3961 Upgrade mockito: 5.2.0 -> 5.10.0
 new 7995f1dcaa JAMES-3961 Update xbean-asm9 to make JPA work with Java 21
 new 99d1d0432d JAMES-3961 Fix LeakAware test suite
 new 7f2fca77ed JAMES-3961 Relax Java modules
 new 8dab7eb842 JAMES-3691 Exception message change with Java 21
 new fdc9fbb9ec JAMES-3691 Update Cucumber to 7.15.0
 new 7c471f0967 JAMES-3961 AssertJ bean introspection
 new 6ea766d82a JAMES-3961 Mockito can no longer Mock EnumSet
 new 021cc5df44 JAMES-3961 Java 21 error message change
 new 65acac3d2c JAMES-3961 Cucumber update for JMAP draft integration tests
 new f659e241ae JAMES-3961 Fix PushSubscriptionSetMethodContract for Java 21
 new f0a7aeaf88 JAMES-3961 README: Java 11 -> 21
 new e63283960f JAMES-3961 Adopt eclipse-temurin:21-jre-jammy as a base 
docker image
 new 0f5d30525d JAMES-3961 Target jdk 11 for JPA modules
 new 1afab21248 JAMES-3961 Cucumber tests should not fail the unstable test 
phase

The 18 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|   2 +-
 .../rabbitmq/RabbitMQConnectionFactoryTest.java|   4 +-
 .../apache/james/JsonSerializationVerifier.java|  22 +++-
 ...omputeMailboxCountersTaskSerializationTest.java |   4 +-
 .../SolveMailboxInconsistenciesServiceTest.java|   5 +-
 ...essageInconsistenciesTaskSerializationTest.java |   8 +-
 mailbox/jpa/pom.xml|  17 +++
 mailbox/memory/pom.xml |   6 +
 ...rorRecoveryIndexationTaskSerializationTest.java |   7 +-
 .../FullReindexingTaskSerializationTest.java   |   7 +-
 ...ngleMailboxReindexingTaskSerializationTest.java |   7 +-
 .../UserReindexingTaskSerializationTest.java   |   8 +-
 .../RecomputeCurrentQuotasServiceContract.java |   5 +-
 ...ecomputeCurrentQuotasTaskSerializationTest.java |   7 +-
 pom.xml|  41 +--
 server/apps/cassandra-app/README.adoc  |   2 +-
 server/apps/cassandra-app/pom.xml  |   2 +-
 server/apps/distributed-app/README.adoc|   2 +-
 server/apps/distributed-app/pom.xml|   2 +-
 server/apps/distributed-pop3-app/README.adoc   |   2 +-
 server/apps/distributed-pop3-app/pom.xml   |   2 +-
 server/apps/jpa-app/README.adoc|   2 +-
 server/apps/jpa-app/pom.xml|   2 +-
 server/apps/jpa-smtp-app/README.adoc   |   2 +-
 server/apps/jpa-smtp-app/pom.xml   |   2 +-
 server/apps/memory-app/pom.xml |   2 +-
 server/apps/scaling-pulsar-smtp/pom.xml|   2 +-
 .../BlobGCTaskAdditionalInformationDTOTest.java|   4 +-
 .../deduplication/BlobGCTaskSerializationTest.java |   5 +-
 .../apache/james/jmap/draft/JMAPModuleTest.java|  42 +++
 .../org/apache/james/lifecycle/api/Disposable.java |   2 +-
 .../apache/james/lifecycle/api/LeakAwareTest.java  |  33 ++
 server/data/data-cassandra/pom.xml |  12 +-
 .../james/rrt/cassandra/CassandraStepdefs.java |   4 +-
 .../james/rrt/cassandra/RewriteTablesTest.java |  17 +--
 server/data/data-file/pom.xml  |   7 +-
 .../apache/james/rrt/file/RewriteTablesTest.java   |  20 ++--
 .../org/apache/james/rrt/file/XMLStepdefs.java |   2 +-
 .../james/jmap/cassandra/filtering/DTOTest.java|  28 +++--
 server/data/data-jpa/pom.xml   |  16 ++-
 .../java/org/apache/james/rrt/jpa/JPAStepdefs.java |   5 +-
 .../apache/james/rrt/jpa/RewriteTablesTest.java|  17 +--
 server/data/data-library/pom.xml   |   5 +
 .../james/rrt/lib/RewriteTablesStepdefs.java   |  83 --
 server/data/data-memory/pom.xml|  12 +-
 .../apache/james/rrt/memory/InMemoryStepdefs.java  |   2 +-
 .../apache/james/rrt/memory/RewriteTablesTest.java |  17 +--
 .../integration/cucumber/DownloadStepdefs.java |   8 +-
 .../cucumber/GetMailboxesMethodStepdefs.java   |   8 +-
 .../cucumber/GetMessageListMethodStepdefs.java |  19 ++--
 .../cucumber/GetMessagesMethodStepdefs.java|  82 +-
 .../methods/integration/cucumber/ImapStepdefs.java |   8 +-
 .../me

(james-project) 06/18: JAMES-3961 Fix LeakAware test suite

2024-03-19 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 99d1d0432d116a3cd5e88a54beb321d2ae9c7a2e
Author: Benoit TELLIER 
AuthorDate: Sat Dec 2 19:31:00 2023 +0100

JAMES-3961 Fix LeakAware test suite
---
 .../org/apache/james/lifecycle/api/Disposable.java |  2 +-
 .../apache/james/lifecycle/api/LeakAwareTest.java  | 33 --
 2 files changed, 13 insertions(+), 22 deletions(-)

diff --git 
a/server/container/lifecycle-api/src/main/java/org/apache/james/lifecycle/api/Disposable.java
 
b/server/container/lifecycle-api/src/main/java/org/apache/james/lifecycle/api/Disposable.java
index aa9d97194b..68da201d4b 100644
--- 
a/server/container/lifecycle-api/src/main/java/org/apache/james/lifecycle/api/Disposable.java
+++ 
b/server/container/lifecycle-api/src/main/java/org/apache/james/lifecycle/api/Disposable.java
@@ -86,7 +86,7 @@ public interface Disposable {
 
 public static final ReferenceQueue> REFERENCE_QUEUE = new 
ReferenceQueue<>();
 public static final ConcurrentHashMap 
REFERENCES_IN_USE = new ConcurrentHashMap<>();
-public static final Level LEVEL = 
Optional.ofNullable(System.getProperty("james.lifecycle.leak.detection.mode"))
+static Level LEVEL = 
Optional.ofNullable(System.getProperty("james.lifecycle.leak.detection.mode"))
 .map(Level::parse).orElse(Level.SIMPLE);
 
 public static void track() {
diff --git 
a/server/container/lifecycle-api/src/test/java/org/apache/james/lifecycle/api/LeakAwareTest.java
 
b/server/container/lifecycle-api/src/test/java/org/apache/james/lifecycle/api/LeakAwareTest.java
index f235c3caf2..bc5ddb0a1d 100644
--- 
a/server/container/lifecycle-api/src/test/java/org/apache/james/lifecycle/api/LeakAwareTest.java
+++ 
b/server/container/lifecycle-api/src/test/java/org/apache/james/lifecycle/api/LeakAwareTest.java
@@ -19,19 +19,16 @@
 
 package org.apache.james.lifecycle.api;
 
+import static org.apache.james.lifecycle.api.Disposable.LeakAware;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS;
 import static org.awaitility.Durations.TEN_SECONDS;
-import static org.apache.james.lifecycle.api.Disposable.LeakAware;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.awaitility.Awaitility;
 import org.awaitility.core.ConditionFactory;
-
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
@@ -76,22 +73,16 @@ class LeakAwareTest {
 return loggingEventListAppender;
 }
 
-private void forceChangeLevel(String level) throws NoSuchFieldException, 
IllegalAccessException {
-forceChangeLevel(LeakAware.Level.parse(level));
+private void forceChangeLevel(String level) {
+LeakAware.LEVEL = LeakAware.Level.parse(level);
 }
 
-// using reflect to change LeakAware.LEVEL value
-private static void forceChangeLevel(LeakAware.Level level) throws 
NoSuchFieldException, IllegalAccessException {
-final Field field = LeakAware.class.getDeclaredField("LEVEL");
-field.setAccessible(true);
-final Field modifiersField = Field.class.getDeclaredField("modifiers");
-modifiersField.setAccessible(true);
-modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
-field.set(null, level);
+private static void forceChangeLevel(LeakAware.Level level) {
+LeakAware.LEVEL = level;
 }
 
 @Test
-void leakDetectionShouldCloseUnclosedResources() throws 
NoSuchFieldException, IllegalAccessException {
+void leakDetectionShouldCloseUnclosedResources() {
 forceChangeLevel(LeakAware.Level.SIMPLE);
 AtomicBoolean atomicBoolean = new AtomicBoolean(false);
 LeakResourceSample resourceSample = 
LeakResourceSample.create(atomicBoolean);
@@ -105,7 +96,7 @@ class LeakAwareTest {
 }
 
 @Test
-void leakDetectionShouldNotReportClosedObjects() throws 
NoSuchFieldException, IllegalAccessException {
+void leakDetectionShouldNotReportClosedObjects() {
 forceChangeLevel(LeakAware.Level.SIMPLE);
 AtomicBoolean atomicBoolean = new AtomicBoolean(false);
 LeakResourceSample resourceSample = 
LeakResourceSample.create(atomicBoolean);
@@ -121,7 +112,7 @@ class LeakAwareTest {
 }
 
 @Test
-void resourceShouldNotBeDetectedLeakWhenLevelIsNone() throws 
InterruptedException, NoSuchFieldException, IllegalAccessException {
+void resourceShouldNotBeDetectedLeakWhenLevelIsNone() throws 
InterruptedException {
 forceChangeLevel(LeakAware.Level.NONE);
   

(james-project) 09/18: JAMES-3691 Update Cucumber to 7.15.0

2024-03-19 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 fdc9fbb9ec05874b85860ee0a2ca5dc2150f09b6
Author: Benoit TELLIER 
AuthorDate: Mon Dec 4 14:51:42 2023 +0100

JAMES-3691 Update Cucumber to 7.15.0

Version 2.4.0 does not support Java 21.
The updates do the trick.
---
 pom.xml| 13 +++-
 server/data/data-cassandra/pom.xml |  7 +-
 .../james/rrt/cassandra/CassandraStepdefs.java |  4 +-
 .../james/rrt/cassandra/RewriteTablesTest.java | 17 ++---
 server/data/data-file/pom.xml  |  7 +-
 .../apache/james/rrt/file/RewriteTablesTest.java   | 20 +++---
 .../org/apache/james/rrt/file/XMLStepdefs.java |  2 +-
 server/data/data-jpa/pom.xml   |  7 +-
 .../java/org/apache/james/rrt/jpa/JPAStepdefs.java |  5 +-
 .../apache/james/rrt/jpa/RewriteTablesTest.java| 17 ++---
 .../james/rrt/lib/RewriteTablesStepdefs.java   | 83 ++
 server/data/data-memory/pom.xml|  7 +-
 .../apache/james/rrt/memory/InMemoryStepdefs.java  |  2 +-
 .../apache/james/rrt/memory/RewriteTablesTest.java | 17 ++---
 .../integration/cucumber/DownloadStepdefs.java |  8 +--
 .../cucumber/GetMailboxesMethodStepdefs.java   |  8 +--
 .../cucumber/GetMessageListMethodStepdefs.java |  6 +-
 .../cucumber/GetMessagesMethodStepdefs.java| 10 +--
 .../methods/integration/cucumber/ImapStepdefs.java |  8 +--
 .../methods/integration/cucumber/MainStepdefs.java |  2 +-
 .../integration/cucumber/MessageIdStepdefs.java|  2 +-
 .../cucumber/SetMailboxesMethodStepdefs.java   |  8 +--
 .../cucumber/SetMessagesMethodStepdefs.java|  8 +--
 .../integration/cucumber/UploadStepdefs.java   |  9 ++-
 .../methods/integration/cucumber/UserStepdefs.java |  4 +-
 .../memory-jmap-draft-integration-testing/pom.xml  |  7 +-
 .../cucumber/MemoryDownloadCucumberTest.java   | 19 ++---
 .../cucumber/MemoryGetMessagesMethodTest.java  | 18 +++--
 .../MemoryIMAPKeywordsInconsistenciesTest.java | 18 +++--
 .../MemoryIMAPSetMessagesCompatibilityTest.java| 18 +++--
 .../MemorySetMailboxesMethodCucumberTest.java  | 18 +++--
 .../MemorySetMessagesMethodCucumberTest.java   | 18 +++--
 .../jmap/memory/cucumber/MemorySharingTest.java| 34 +++--
 .../james/jmap/memory/cucumber/MemoryStepdefs.java |  8 +--
 .../memory/cucumber/MemoryUploadCucumberTest.java  | 19 ++---
 .../pom.xml|  7 +-
 .../cucumber/awss3/RabbitMQAwsS3Stepdefs.java  |  6 +-
 .../awss3/RabbitMQDownloadCucumberTest.java| 21 +++---
 .../awss3/RabbitMQGetMessagesMethodTest.java   | 21 +++---
 .../RabbitMQIMAPKeywordsInconsistenciesTest.java   | 21 +++---
 .../RabbitMQIMAPSetMessagesCompatibilityTest.java  | 21 +++---
 .../cucumber/awss3/RabbitMQMailboxSharingTest.java | 44 
 .../cucumber/awss3/RabbitMQMessageSharingTest.java | 45 
 .../RabbitMQSetMailboxesMethodCucumberTest.java| 21 +++---
 .../RabbitMQSetMessagesMethodCucumberTest.java | 21 +++---
 ...dCucumberTest.java => RabbitMQSharingTest.java} | 25 ---
 .../cucumber/awss3/RabbitMQUploadCucumberTest.java | 21 +++---
 47 files changed, 372 insertions(+), 360 deletions(-)

diff --git a/pom.xml b/pom.xml
index 534f8b1c4d..2000ff18f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -620,7 +620,7 @@
 1.3.4
 4.21
 4.1.101.Final
-2.4.0
+7.15.0
 
 1.6.4
 2.15.2
@@ -2345,6 +2345,12 @@
 cucumber-junit
 ${cucumber.version}
 
+
+io.cucumber
+cucumber-junit-platform-engine
+${cucumber.version}
+
+
 
 io.cucumber
 cucumber-picocontainer
@@ -2801,6 +2807,11 @@
 junit-platform-launcher
 ${junit.platform.version}
 
+
+org.junit.platform
+junit-platform-suite
+1.9.3
+
 
 org.junit.vintage
 junit-vintage-engine
diff --git a/server/data/data-cassandra/pom.xml 
b/server/data/data-cassandra/pom.xml
index fea44f95b0..c5199c86dd 100644
--- a/server/data/data-cassandra/pom.xml
+++ b/server/data/data-cassandra/pom.xml
@@ -107,7 +107,7 @@
 
 
 io.cucumber
-cucumber-junit
+cucumber-junit-platform-engine
 test
 
 
@@ -129,6 +129,11 @@
 awaitility
 test
 
+
+org.junit.platform
+junit-platform-suite
+test
+
 
 org.mockito
 mockito-core
diff --git 
a/server/data/data-cassandra/src/test/java/org/apa

(james-project) 14/18: JAMES-3961 Fix PushSubscriptionSetMethodContract for Java 21

2024-03-19 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 f659e241aef7afe51bac88a2f2422c8cdafe7a99
Author: Benoit TELLIER 
AuthorDate: Tue Jan 16 15:32:38 2024 +0100

JAMES-3961 Fix PushSubscriptionSetMethodContract for Java 21
---
 .../james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
index 054f6bdf38..fcf062a210 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/PushSubscriptionSetMethodContract.scala
@@ -1577,7 +1577,7 @@ trait PushSubscriptionSetMethodContract {
|"notCreated": {
|"4f29": {
|"type": "invalidArguments",
-   |"description": 
"java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: 
IOException: Unable to decode key"
+   |"description": 
"java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: 
Unable to decode key"
|}
|}
|},


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



(james-project) 17/18: JAMES-3961 Target jdk 11 for JPA modules

2024-03-19 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 0f5d30525dbfa33f32ef79a66a7a78ced363d256
Author: Quan Tran 
AuthorDate: Tue Jan 30 11:14:08 2024 +0700

JAMES-3961 Target jdk 11 for JPA modules

As `openjpa-maven-plugin` has been outdated for a while and does not 
support Java 21 yet...
---
 mailbox/jpa/pom.xml  | 4 
 server/data/data-jpa/pom.xml | 4 
 2 files changed, 8 insertions(+)

diff --git a/mailbox/jpa/pom.xml b/mailbox/jpa/pom.xml
index 9125639b59..a09fc35263 100644
--- a/mailbox/jpa/pom.xml
+++ b/mailbox/jpa/pom.xml
@@ -31,6 +31,10 @@
 jar
 Apache James :: Mailbox :: JPA
 
+
+11
+
+
 
 
 ${james.groupId}
diff --git a/server/data/data-jpa/pom.xml b/server/data/data-jpa/pom.xml
index dbd51824d8..bef4926339 100644
--- a/server/data/data-jpa/pom.xml
+++ b/server/data/data-jpa/pom.xml
@@ -32,6 +32,10 @@
 
 Apache James :: Server :: Data :: JPA Persistence
 
+
+11
+
+
 
 
 ${james.groupId}


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



(james-project) 08/18: JAMES-3691 Exception message change with Java 21

2024-03-19 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 8dab7eb842b3cda1f47f7f7e2564d809dbf221c9
Author: Benoit TELLIER 
AuthorDate: Mon Dec 4 08:55:47 2023 +0100

JAMES-3691 Exception message change with Java 21
---
 .../apache/james/backends/rabbitmq/RabbitMQConnectionFactoryTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactoryTest.java
 
b/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactoryTest.java
index 208f181ce9..7e1210ad2c 100644
--- 
a/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactoryTest.java
+++ 
b/backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConnectionFactoryTest.java
@@ -106,7 +106,7 @@ class RabbitMQConnectionFactoryTest {
 
 assertThatThrownBy(() -> new 
RabbitMQConnectionFactory(rabbitMQConfiguration))
 .isInstanceOf(RuntimeException.class)
-.hasCause(new IOException("Short read of DER length"));
+.hasCause(new IOException("Tag number over 30 is not 
supported"));
 }
 
 @Test
@@ -151,7 +151,7 @@ class RabbitMQConnectionFactoryTest {
 
 assertThatThrownBy(() -> new 
RabbitMQConnectionFactory(rabbitMQConfiguration))
 .isInstanceOf(RuntimeException.class)
-.hasCause(new IOException("Short read of DER length"));
+.hasCause(new IOException("Tag number over 30 is not 
supported"));
 }
 
 @Test


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



(james-project) 11/18: JAMES-3961 Mockito can no longer Mock EnumSet

2024-03-19 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 6ea766d82aa5342f6a5aba903bce09876da43064
Author: Benoit TELLIER 
AuthorDate: Thu Jan 11 18:07:39 2024 +0100

JAMES-3961 Mockito can no longer Mock EnumSet
---
 .../apache/james/jmap/draft/JMAPModuleTest.java| 42 ++
 1 file changed, 18 insertions(+), 24 deletions(-)

diff --git 
a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java
 
b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java
index 0375d6ed6a..970da77e7a 100644
--- 
a/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java
+++ 
b/server/container/guice/protocols/jmap/src/test/java/org/apache/james/jmap/draft/JMAPModuleTest.java
@@ -39,19 +39,11 @@ class JMAPModuleTest {
 
 private RequiredCapabilitiesStartUpCheck testee;
 private MailboxManager mockMailboxManager;
-private EnumSet 
mockMessageCapabilities;
-private EnumSet 
mockSearchCapabilities;
 
 @SuppressWarnings("unchecked")
 @BeforeEach
 void beforeEach() {
 mockMailboxManager = mock(MailboxManager.class);
-mockMessageCapabilities = 
(EnumSet) mock(EnumSet.class);
-mockSearchCapabilities = 
(EnumSet) mock(EnumSet.class);
-when(mockMailboxManager.getSupportedMessageCapabilities())
-.thenReturn(mockMessageCapabilities);
-when(mockMailboxManager.getSupportedSearchCapabilities())
-.thenReturn(mockSearchCapabilities);
 
 testee = new RequiredCapabilitiesStartUpCheck(mockMailboxManager);
 }
@@ -60,10 +52,12 @@ class JMAPModuleTest {
 void checkShouldReturnGoodWhenAllChecksSatisfy() {
 when(mockMailboxManager.hasCapability(any()))
 .thenReturn(true);
-
when(mockMessageCapabilities.contains(any(MailboxManager.MessageCapabilities.class)))
-.thenReturn(true);
-
when(mockSearchCapabilities.contains(any(MailboxManager.SearchCapabilities.class)))
-.thenReturn(true);
+
+
+when(mockMailboxManager.getSupportedMessageCapabilities())
+
.thenReturn(EnumSet.allOf(MailboxManager.MessageCapabilities.class));
+when(mockMailboxManager.getSupportedSearchCapabilities())
+
.thenReturn(EnumSet.allOf(MailboxManager.SearchCapabilities.class));
 
 assertThat(testee.check().isGood())
 .isTrue();
@@ -73,10 +67,10 @@ class JMAPModuleTest {
 void checkShouldReturnBadWhenMailboxManagerDoesntHaveCapabilities() {
 when(mockMailboxManager.hasCapability(any()))
 .thenReturn(false);
-
when(mockMessageCapabilities.contains(any(MailboxManager.MessageCapabilities.class)))
-.thenReturn(true);
-
when(mockSearchCapabilities.contains(any(MailboxManager.SearchCapabilities.class)))
-.thenReturn(true);
+when(mockMailboxManager.getSupportedMessageCapabilities())
+
.thenReturn(EnumSet.allOf(MailboxManager.MessageCapabilities.class));
+when(mockMailboxManager.getSupportedSearchCapabilities())
+
.thenReturn(EnumSet.allOf(MailboxManager.SearchCapabilities.class));
 
 assertThat(testee.check().isBad())
 .isTrue();
@@ -86,10 +80,10 @@ class JMAPModuleTest {
 void 
checkShouldReturnBadWhenMailboxManagerDoesntHaveMessagesCapabilities() {
 when(mockMailboxManager.hasCapability(any()))
 .thenReturn(true);
-
when(mockMessageCapabilities.contains(any(MailboxManager.MessageCapabilities.class)))
-.thenReturn(false);
-
when(mockSearchCapabilities.contains(any(MailboxManager.SearchCapabilities.class)))
-.thenReturn(true);
+when(mockMailboxManager.getSupportedMessageCapabilities())
+
.thenReturn(EnumSet.noneOf(MailboxManager.MessageCapabilities.class));
+when(mockMailboxManager.getSupportedSearchCapabilities())
+
.thenReturn(EnumSet.allOf(MailboxManager.SearchCapabilities.class));
 
 assertThat(testee.check().isBad())
 .isTrue();
@@ -99,10 +93,10 @@ class JMAPModuleTest {
 void 
checkShouldReturnBadWhenMailboxManagerDoesntHaveSearchCapabilities() {
 when(mockMailboxManager.hasCapability(any()))
 .thenReturn(true);
-
when(mockMessageCapabilities.contains(any(MailboxManager.MessageCapabilities.class)))
-.thenReturn(true);
-
when(mockSearchCapabilities.contains(any(MailboxManager.SearchCapabilities.class)))
-.thenRe

(james-project) 03/18: JAMES-3961 Enfoce Maven 3.8.1+ usage

2024-03-19 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 d496df710450f4c86d0d41d8b6f5be518425d245
Author: Benoit TELLIER 
AuthorDate: Fri Dec 1 20:44:07 2023 +0100

JAMES-3961 Enfoce Maven 3.8.1+ usage

Required by OpenJPA 34.0-SNAPSHOT
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 27ef5a02fa..c92e108a0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3542,7 +3542,7 @@
 
 
 
-3.6.0
+3.8.1
 
 
 


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



(james-project) 05/18: JAMES-3961 Update xbean-asm9 to make JPA work with Java 21

2024-03-19 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 7995f1dcaacc86ca532033bca7c9647e05d42b16
Author: Benoit TELLIER 
AuthorDate: Sat Dec 2 08:24:22 2023 +0100

JAMES-3961 Update xbean-asm9 to make JPA work with Java 21
---
 mailbox/jpa/pom.xml | 7 +++
 pom.xml | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/mailbox/jpa/pom.xml b/mailbox/jpa/pom.xml
index 018b4741ac..3ed2a82e83 100644
--- a/mailbox/jpa/pom.xml
+++ b/mailbox/jpa/pom.xml
@@ -155,6 +155,13 @@
 
true
 
${basedir}/src/test/resources/persistence.xml
 
+
+
+org.apache.xbean
+xbean-asm9-shaded
+4.23
+
+
 
 
 enhancer
diff --git a/pom.xml b/pom.xml
index 54a911858b..7c3e3e2b52 100644
--- a/pom.xml
+++ b/pom.xml
@@ -600,7 +600,7 @@
 
${james.groupId}.protocols
 5.18.3
 0.8.11
-3.2.0
+3.2.2
 10.14.2.0
 2.20.0
 1


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



(james-project) 07/18: JAMES-3961 Relax Java modules

2024-03-19 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 7f2fca77eda7eb65a059b0eceaa7c226288fffe6
Author: Benoit TELLIER 
AuthorDate: Sat Dec 2 20:41:40 2023 +0100

JAMES-3961 Relax Java modules
---
 pom.xml | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 7c3e3e2b52..534f8b1c4d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3341,7 +3341,14 @@
 
 -Djava.library.path=
 
-javaagent:"${settings.localRepository}"/org/jacoco/org.jacoco.agent/${jacoco-maven-plugin.version}/org.jacoco.agent-${jacoco-maven-plugin.version}-runtime.jar=destfile=${basedir}/target/jacoco.exec
--Xms512m -Xmx1024m
+-Xms512m -Xmx1024m --illegal-access=permit
+--add-opens java.base/java.lang=ALL-UNNAMED
+--add-opens java.base/java.math=ALL-UNNAMED
+--add-opens java.base/java.net=ALL-UNNAMED
+--add-opens java.base/java.text=ALL-UNNAMED
+--add-opens 
java.base/java.util.concurrent.atomic=ALL-UNNAMED
+--add-opens 
java.base/java.util.concurrent=ALL-UNNAMED
+--add-opens 
java.base/java.util=ALL-UNNAMED
 true
 
 
1800


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



(james-project) 02/18: JAMES-3961 Upgrade maven-plugin-plugin in order to work with Java 21

2024-03-19 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 454d82ea1130334626783bc28529da8159efe70c
Author: Benoit TELLIER 
AuthorDate: Fri Dec 1 15:23:32 2023 +0100

JAMES-3961 Upgrade maven-plugin-plugin in order to work with Java 21
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index eee23a76b3..27ef5a02fa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3263,7 +3263,7 @@
 
 org.apache.maven.plugins
 maven-plugin-plugin
-3.6.4
+3.11.0
 
 
 org.apache.maven.plugins


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



(james-project) 01/18: JAMES-3961 Switch to Java 21

2024-03-19 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 14f28d2dc6e278bb5813d1cf53a98e97ea960469
Author: Benoit TELLIER 
AuthorDate: Fri Dec 1 15:07:10 2023 +0100

JAMES-3961 Switch to Java 21
---
 Jenkinsfile | 2 +-
 pom.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index c133a478f8..74eee5cbff 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,7 @@
  */
 
 def AGENT_LABEL = env.AGENT_LABEL ?: 'ubuntu && !ephemeral'
-def JDK_NAME = env.JDK_NAME ?: 'jdk_11_latest'
+def JDK_NAME = env.JDK_NAME ?: 'jdk_21_latest'
 
 pipeline {
 
diff --git a/pom.xml b/pom.xml
index bc00166f59..eee23a76b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -588,7 +588,7 @@
 otherwise the set values are used by default.
 -->
 UTF-8
-11
+21
 1.9-SNAPSHOT
 

(james-project) 01/01: [ENHANCEMENT] Workqueue for the deleted message vault

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

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

commit 7082160d7a6f95fc143e32efed21539eac3f4a80
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 22:07:05 2024 +0100

[ENHANCEMENT] Workqueue for the deleted message vault

Deleted message vault copy can be long, doing it
asynchronously would make the feature more reliable.
---
 .../mailbox/cassandra/DeleteMessageListener.java   |  67 +-
 .../DeletedMessageVaultDeletionCallback.java   |  24 +-
 .../james/CassandraRabbitMQJamesServerMain.java|   4 +-
 .../james/DistributedPOP3JamesServerMain.java  |   4 +-
 ...ributedDeletedMessageVaultDeletionCallback.java | 262 +
 .../DistributedDeletedMessageVaultModule.java  |  69 ++
 6 files changed, 412 insertions(+), 18 deletions(-)

diff --git 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/DeleteMessageListener.java
 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/DeleteMessageListener.java
index 504b07c2f5..0b091ba330 100644
--- 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/DeleteMessageListener.java
+++ 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/DeleteMessageListener.java
@@ -23,6 +23,7 @@ import static 
org.apache.james.backends.cassandra.init.configuration.JamesExecut
 import static 
org.apache.james.backends.cassandra.init.configuration.JamesExecutionProfiles.ConsistencyChoice.WEAK;
 import static org.apache.james.util.FunctionalUtils.negate;
 
+import java.util.Date;
 import java.util.Optional;
 import java.util.Set;
 
@@ -30,6 +31,7 @@ import javax.inject.Inject;
 
 import 
org.apache.james.backends.cassandra.init.configuration.CassandraConfiguration;
 import 
org.apache.james.backends.cassandra.init.configuration.JamesExecutionProfiles;
+import org.apache.james.blob.api.BlobId;
 import org.apache.james.blob.api.BlobStore;
 import org.apache.james.core.Username;
 import org.apache.james.events.Event;
@@ -59,6 +61,7 @@ import 
org.apache.james.mailbox.model.ComposedMessageIdWithMetaData;
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.model.MessageMetaData;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.store.mail.MessageMapper;
@@ -86,9 +89,71 @@ public class DeleteMessageListener implements 
EventListener.ReactiveGroupEventLi
 
 }
 
+public static class DelectedMessageCopyCommand {
+public static DelectedMessageCopyCommand of(MessageRepresentation 
message, MailboxId mailboxId, Username owner) {
+return new DelectedMessageCopyCommand(message.getMessageId(), 
mailboxId, owner, message.getInternalDate(),
+message.getSize(), !message.getAttachments().isEmpty(), 
message.getHeaderId(), message.getBodyId());
+}
+
+private final MessageId messageId;
+private final MailboxId mailboxId;
+private final Username owner;
+private final Date internalDate;
+private final long size;
+private final boolean hasAttachments;
+private final BlobId headerId;
+private final BlobId bodyId;
+
+public DelectedMessageCopyCommand(MessageId messageId, MailboxId 
mailboxId, Username owner, Date internalDate, long size, boolean 
hasAttachments, BlobId headerId, BlobId bodyId) {
+this.messageId = messageId;
+this.mailboxId = mailboxId;
+this.owner = owner;
+this.internalDate = internalDate;
+this.size = size;
+this.hasAttachments = hasAttachments;
+this.headerId = headerId;
+this.bodyId = bodyId;
+}
+
+public Username getOwner() {
+return owner;
+}
+
+public MessageId getMessageId() {
+return messageId;
+}
+
+public MailboxId getMailboxId() {
+return mailboxId;
+}
+
+public Date getInternalDate() {
+return internalDate;
+}
+
+public long getSize() {
+return size;
+}
+
+public boolean hasAttachments() {
+return hasAttachments;
+}
+
+public BlobId getHeaderId() {
+return headerId;
+}
+
+public BlobId getBodyId() {
+return bodyId;
+}
+}
+
 @FunctionalInterface
 public interface DeletionCallback {
-Mono forMessage(MessageRepresentation message, MailboxId 
mailboxId, Username owner);
+default Mono forMessage(MessageRepresentation message, MailboxId 
mailboxId, Username owner) {
+return forMessage(DelectedMessageCopyCommand.of(message, 
mailboxId, owner

(james-project) branch dtm-workqueue created (now 7082160d7a)

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

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


  at 7082160d7a [ENHANCEMENT] Workqueue for the deleted message vault

This branch includes the following new commits:

 new 7082160d7a [ENHANCEMENT] Workqueue for the deleted message vault

The 1 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.



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



(james-project) 01/04: [FIX] IMAP linearization can be simplified

2024-03-18 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 77d195f8a552f702370543e6f7da906c2a399aa4
Author: Benoit TELLIER 
AuthorDate: Sat Mar 16 08:27:43 2024 +0100

[FIX] IMAP linearization can be simplified

Handle the queuing and linearization within netty channel,
not into reactor.

This avoids complex signalling at the REACTOR level...
---
 .../netty/ImapChannelUpstreamHandler.java  | 33 --
 .../james/imapserver/netty/Linearalizer.java   | 71 --
 .../james/imapserver/netty/NettyConstants.java |  2 +-
 .../james/imapserver/netty/LinearalizerTest.java   | 71 --
 4 files changed, 30 insertions(+), 147 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
index 934a5d4483..094d0284e3 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
@@ -29,6 +29,8 @@ import java.time.Duration;
 import java.util.NoSuchElementException;
 import java.util.Optional;
 import java.util.Set;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.net.ssl.SSLHandshakeException;
 
@@ -156,6 +158,11 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 }
 }
 
+static class ImapLinerarizer {
+private final AtomicBoolean isExecutingRequest = new 
AtomicBoolean(false);
+private final ConcurrentLinkedQueue throttled = new 
ConcurrentLinkedQueue<>();
+}
+
 public static ImapChannelUpstreamHandlerBuilder builder() {
 return new ImapChannelUpstreamHandlerBuilder();
 }
@@ -200,7 +207,7 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 authenticationConfiguration.isPlainAuthEnabled(), sessionId,
 authenticationConfiguration.getOidcSASLConfiguration());
 ctx.channel().attr(IMAP_SESSION_ATTRIBUTE_KEY).set(imapsession);
-ctx.channel().attr(LINEARALIZER_ATTRIBUTE_KEY).set(new Linearalizer());
+ctx.channel().attr(LINEARIZER_ATTRIBUTE_KEY).set(new 
ImapLinerarizer());
 MDCBuilder boundMDC = IMAPMDCContext.boundMDC(ctx)
 .addToContext(MDCBuilder.SESSION_ID, sessionId.asString());
 imapsession.setAttribute(MDC_KEY, boundMDC);
@@ -375,8 +382,17 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 public void channelRead(ChannelHandlerContext ctx, Object msg) {
 imapCommandsMetric.increment();
 ImapSession session = 
ctx.channel().attr(IMAP_SESSION_ATTRIBUTE_KEY).get();
-Linearalizer linearalizer = 
ctx.channel().attr(LINEARALIZER_ATTRIBUTE_KEY).get();
 Attribute disposableAttribute = 
ctx.channel().attr(REQUEST_IN_FLIGHT_ATTRIBUTE_KEY);
+
+ImapLinerarizer linearalizer = 
ctx.channel().attr(LINEARIZER_ATTRIBUTE_KEY).get();
+synchronized (linearalizer) {
+if (linearalizer.isExecutingRequest.get()) {
+linearalizer.throttled.add(msg);
+return;
+}
+linearalizer.isExecutingRequest.set(true);
+}
+
 ChannelImapResponseWriter writer = new 
ChannelImapResponseWriter(ctx.channel());
 ImapResponseComposerImpl response = new 
ImapResponseComposerImpl(writer);
 writer.setFlushCallback(response::flush);
@@ -384,8 +400,7 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 
 beforeIDLEUponProcessing(ctx);
 ResponseEncoder responseEncoder = new ResponseEncoder(encoder, 
response);
-Disposable disposable = reactiveThrottler.throttle(
-linearalizer.execute(processor.processReactive(message, 
responseEncoder, session))
+Disposable disposable = 
reactiveThrottler.throttle(processor.processReactive(message, responseEncoder, 
session)
 .doOnEach(Throwing.consumer(signal -> {
 if (session.getState() == ImapSessionState.LOGOUT) {
 // Make sure we close the channel after all the 
buffers were flushed out
@@ -407,6 +422,11 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 ctx.fireExceptionCaught(failure);
 }
 }
+Object waitingMessage;
+synchronized (linearalizer) {
+linearalizer.isExecutingRequest.

(james-project) 02/04: [FIX] IMAP FETCH backpressure propagate cancel

2024-03-18 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 f5d1b7355927cd4b82e4efd09d0e5fd320b1941d
Author: Benoit TELLIER 
AuthorDate: Sat Mar 16 08:44:44 2024 +0100

[FIX] IMAP FETCH backpressure propagate cancel
---
 .../james/imap/processor/fetch/FetchProcessor.java  | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
index 2caf9a0e7d..83578d358b 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
@@ -121,7 +121,11 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 }
 
 public Mono completionMono() {
-return sink.asMono();
+return sink.asMono()
+.doOnCancel(() -> {
+
Optional.ofNullable(subscription.get()).ifPresent(Subscription::cancel);
+subscription.set(null);
+});
 }
 }
 
@@ -234,19 +238,18 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 .doOnNext(responder::respond)
 .then();
 } else {
-return Flux.fromIterable(consolidate(selected, ranges, fetch))
+FetchSubscriber fetchSubscriber = new FetchSubscriber(imapSession, 
responder);
+Flux.fromIterable(consolidate(selected, ranges, fetch))
 .concatMap(range -> {
-FetchSubscriber fetchSubscriber = new 
FetchSubscriber(imapSession, responder);
 auditTrail(mailbox, mailboxSession, resultToFetch, range);
 
-Flux.from(mailbox.getMessagesReactive(range, 
resultToFetch, mailboxSession))
+return Flux.from(mailbox.getMessagesReactive(range, 
resultToFetch, mailboxSession))
 .filter(ids -> !fetch.contains(Item.MODSEQ) || 
ids.getModSeq().asLong() > fetch.getChangedSince())
-.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, builder, selected, result))
-.subscribe(fetchSubscriber);
-
-return fetchSubscriber.completionMono();
+.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, builder, selected, result));
 })
-.then();
+.subscribe(fetchSubscriber);
+
+return fetchSubscriber.completionMono();
 }
 }
 


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



(james-project) 03/04: [FIX] FETCH: do not reuse FetchResponseBuilder

2024-03-18 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 a9c9f02ac5171b3d9f7351ec99e85a87d0eebbff
Author: Benoit TELLIER 
AuthorDate: Sat Mar 16 22:11:29 2024 +0100

[FIX] FETCH: do not reuse FetchResponseBuilder
---
 .../apache/james/imap/processor/fetch/FetchProcessor.java   | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
index 83578d358b..db2c99fb90 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
@@ -227,14 +227,13 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
  * {@link org.apache.james.imap.api.process.ImapProcessor.Responder}
  */
 private Mono processMessageRanges(SelectedMailbox selected, 
MessageManager mailbox, List ranges, FetchData fetch, 
MailboxSession mailboxSession, Responder responder, ImapSession imapSession) {
-FetchResponseBuilder builder = new FetchResponseBuilder(new 
EnvelopeBuilder());
 FetchGroup resultToFetch = FetchDataConverter.getFetchGroup(fetch);
 
 if (fetch.isOnlyFlags()) {
 return Flux.fromIterable(consolidate(selected, ranges, fetch))
 .concatMap(range -> 
Flux.from(mailbox.listMessagesMetadata(range, mailboxSession)))
 .filter(ids -> !fetch.contains(Item.MODSEQ) || 
ids.getModSeq().asLong() > fetch.getChangedSince())
-.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, builder, selected, result))
+.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, selected, result))
 .doOnNext(responder::respond)
 .then();
 } else {
@@ -245,7 +244,7 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 
 return Flux.from(mailbox.getMessagesReactive(range, 
resultToFetch, mailboxSession))
 .filter(ids -> !fetch.contains(Item.MODSEQ) || 
ids.getModSeq().asLong() > fetch.getChangedSince())
-.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, builder, selected, result));
+.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, selected, result));
 })
 .subscribe(fetchSubscriber);
 
@@ -266,9 +265,9 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 return 
MessageRange.toRanges(filter.longStream().mapToObj(MessageUid::of).collect(ImmutableList.toImmutableList()));
 }
 
-private Mono toResponse(MessageManager mailbox, FetchData 
fetch, MailboxSession mailboxSession, FetchResponseBuilder builder, 
SelectedMailbox selected, 
org.apache.james.mailbox.model.ComposedMessageIdWithMetaData result) {
+private Mono toResponse(MessageManager mailbox, FetchData 
fetch, MailboxSession mailboxSession, SelectedMailbox selected, 
org.apache.james.mailbox.model.ComposedMessageIdWithMetaData result) {
 try {
-return builder.build(fetch, result, mailbox, selected, 
mailboxSession);
+return new FetchResponseBuilder(new 
EnvelopeBuilder()).build(fetch, result, mailbox, selected, mailboxSession);
 } catch (MessageRangeException e) {
 // we can't for whatever reason find the message so
 // just skip it and log it to debug
@@ -285,9 +284,9 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 }
 }
 
-private Mono toResponse(MessageManager mailbox, FetchData 
fetch, MailboxSession mailboxSession, FetchResponseBuilder builder, 
SelectedMailbox selected, MessageResult result) {
+private Mono toResponse(MessageManager mailbox, FetchData 
fetch, MailboxSession mailboxSession, SelectedMailbox selected, MessageResult 
result) {
 try {
-return builder.build(fetch, result, mailbox, selected, 
mailboxSession);
+return new FetchResponseBuilder(new 
EnvelopeBuilder()).build(fetch, result, mailbox, selected, mailboxSession);
 } catch (MessageRangeException e) {
 // we can't for whatever reason find the message so
 // just skip it and log it to debug


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



(james-project) branch master updated (7222019643 -> 019dabb517)

2024-03-18 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 7222019643 JAMES-4020 Fully comply with RFC-3501 Section 6.4.5 (#2123)
 new 77d195f8a5 [FIX] IMAP linearization can be simplified
 new f5d1b73559 [FIX] IMAP FETCH backpressure propagate cancel
 new a9c9f02ac5 [FIX] FETCH: do not reuse FetchResponseBuilder
 new 019dabb517 [FIX] FETCH: flatten reactor operations

The 4 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:
 .../james/imap/processor/fetch/FetchProcessor.java | 37 ++-
 .../netty/ImapChannelUpstreamHandler.java  | 33 --
 .../james/imapserver/netty/Linearalizer.java   | 71 --
 .../james/imapserver/netty/NettyConstants.java |  2 +-
 .../james/imapserver/netty/LinearalizerTest.java   | 71 --
 5 files changed, 48 insertions(+), 166 deletions(-)
 delete mode 100644 
server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/Linearalizer.java
 delete mode 100644 
server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/LinearalizerTest.java


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



(james-project) 04/04: [FIX] FETCH: flatten reactor operations

2024-03-18 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 019dabb51789fb1fccc5e342aec77a34b48478e3
Author: Benoit TELLIER 
AuthorDate: Sat Mar 16 22:12:09 2024 +0100

[FIX] FETCH: flatten reactor operations
---
 .../org/apache/james/imap/processor/fetch/FetchProcessor.java | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
index db2c99fb90..7878c19162 100644
--- 
a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
+++ 
b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
@@ -239,13 +239,10 @@ public class FetchProcessor extends 
AbstractMailboxProcessor {
 } else {
 FetchSubscriber fetchSubscriber = new FetchSubscriber(imapSession, 
responder);
 Flux.fromIterable(consolidate(selected, ranges, fetch))
-.concatMap(range -> {
-auditTrail(mailbox, mailboxSession, resultToFetch, range);
-
-return Flux.from(mailbox.getMessagesReactive(range, 
resultToFetch, mailboxSession))
-.filter(ids -> !fetch.contains(Item.MODSEQ) || 
ids.getModSeq().asLong() > fetch.getChangedSince())
-.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, selected, result));
-})
+.doOnNext(range -> auditTrail(mailbox, mailboxSession, 
resultToFetch, range))
+.concatMap(range -> 
Flux.from(mailbox.getMessagesReactive(range, resultToFetch, mailboxSession)))
+.filter(ids -> !fetch.contains(Item.MODSEQ) || 
ids.getModSeq().asLong() > fetch.getChangedSince())
+.concatMap(result -> toResponse(mailbox, fetch, 
mailboxSession, selected, result))
 .subscribe(fetchSubscriber);
 
 return fetchSubscriber.completionMono();


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



(james-project) branch master updated (482ac366e3 -> 7222019643)

2024-03-17 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 482ac366e3 [LOGGING] Aborting JMAP upload is too verbose (#2125)
 add 7222019643 JAMES-4020 Fully comply with RFC-3501 Section 6.4.5 (#2123)

No new revisions were added by this update.

Summary of changes:
 .../apache/james/mailbox/store/ResultUtils.java| 33 +-
 .../james/imap/scripts/FetchRFC822Header.test  | 52 ++
 2 files changed, 84 insertions(+), 1 deletion(-)


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



(james-project) branch master updated: [LOGGING] Aborting JMAP upload is too verbose (#2125)

2024-03-17 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 482ac366e3 [LOGGING] Aborting JMAP upload is too verbose (#2125)
482ac366e3 is described below

commit 482ac366e34e700e42b42eca701314bceea78e00
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 06:20:18 2024 +0100

[LOGGING] Aborting JMAP upload is too verbose (#2125)
---
 .../src/main/scala/org/apache/james/jmap/core/ProblemDetails.scala| 4 
 .../org/apache/james/jmap/method/MailboxSetCreatePerformer.scala  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/ProblemDetails.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/ProblemDetails.scala
index fc75a52d72..226fe7e32a 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/ProblemDetails.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/core/ProblemDetails.scala
@@ -25,6 +25,7 @@ import 
org.apache.james.jmap.core.RequestLevelErrorType.{DEFAULT_ERROR_TYPE, Err
 import org.apache.james.jmap.exceptions.UnauthorizedException
 import org.apache.james.jmap.routes.UnsupportedCapabilitiesException
 import org.slf4j.{Logger, LoggerFactory}
+import reactor.netty.channel.AbortedException
 
 /**
  * Problem Details for HTTP APIs within the JMAP context
@@ -40,6 +41,9 @@ object ProblemDetails {
   val LOGGER: Logger = LoggerFactory.getLogger(classOf[ProblemDetails])
 
   def forThrowable(throwable: Throwable): ProblemDetails = throwable match {
+case exception: AbortedException =>
+  LOGGER.info("The connection was aborted: {}", exception.getMessage)
+  ProblemDetails(status = INTERNAL_SERVER_ERROR, detail = 
exception.getMessage)
 case exception: IllegalArgumentException =>
   LOGGER.info("The request was successfully parsed as JSON but did not 
match the type signature of the Request object: {}", exception.getMessage)
   notRequestProblem(
diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetCreatePerformer.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetCreatePerformer.scala
index 5aae0b99d4..3eacaf1a4b 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetCreatePerformer.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/method/MailboxSetCreatePerformer.scala
@@ -40,7 +40,7 @@ import reactor.core.scala.publisher.{SFlux, SMono}
 import scala.util.Try
 
 object MailboxSetCreatePerformer {
-  private val LOGGER = 
LoggerFactory.getLogger(classOf[EmailSetCreatePerformer])
+  private val LOGGER = 
LoggerFactory.getLogger(classOf[MailboxSetCreatePerformer])
   sealed trait MailboxCreationResult {
 def mailboxCreationId: MailboxCreationId
   }


-
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 + DOCUMENTATION Performance / reliability setting for RabbitMQ quorum queues (#2121)

2024-03-15 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 15b0b0fffa ENHANCEMENT + DOCUMENTATION Performance / reliability 
setting for RabbitMQ quorum queues (#2121)
15b0b0fffa is described below

commit 15b0b0fffac0bcbb460687cee23d108aaba179df
Author: Benoit TELLIER 
AuthorDate: Fri Mar 15 14:29:33 2024 +0100

ENHANCEMENT + DOCUMENTATION Performance / reliability setting for RabbitMQ 
quorum queues (#2121)

* [ENHANCEMENT] Rabbit Quorum queue: set delivery limits

Setting a delivery limit can prevent RabbitMQ outage if
message processing fails.
Read https://www.rabbitmq.com/docs/quorum-queues#poison-message-handling

* [ENHANCEMENT] Rabbit Quorum queue: document performance setting

Was advised on gitter
-

Co-authored-by: Rene Cordier 
---
 .../james/backends/rabbitmq/QueueArguments.java|  5 
 .../backends/rabbitmq/RabbitMQConfiguration.java   | 29 --
 .../modules/ROOT/pages/configure/rabbitmq.adoc | 19 ++
 src/site/xdoc/server/config-rabbitmq.xml   | 18 ++
 4 files changed, 69 insertions(+), 2 deletions(-)

diff --git 
a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/QueueArguments.java
 
b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/QueueArguments.java
index 62a7c86e70..5d782d059a 100644
--- 
a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/QueueArguments.java
+++ 
b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/QueueArguments.java
@@ -65,6 +65,11 @@ public class QueueArguments {
 return this;
 }
 
+public Builder deliveryLimit(long deliveryLimit) {
+arguments.put("x-delivery-limit", deliveryLimit);
+return this;
+}
+
 public ImmutableMap build() {
 return arguments.build();
 }
diff --git 
a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java
 
b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java
index c7963e27d0..092804891e 100644
--- 
a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java
+++ 
b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java
@@ -307,6 +307,7 @@ public class RabbitMQConfiguration {
 private static final String SSL_KEY_STORE_PATH = "ssl.keystore";
 private static final String SSL_KEY_STORE_PASSWORD = 
"ssl.keystore.password";
 private static final String QUEUE_TTL = "notification.queue.ttl";
+private static final String QUEUE_DELIVERY_LIMIT = 
"quorum.queues.delivery.limit";
 private static final String EVENT_BUS_NOTIFICATION_DURABILITY_ENABLED = 
"event.bus.notification.durability.enabled";
 private static final String EVENT_BUS_PUBLISH_CONFIRM_ENABLED = 
"event.bus.publish.confirm.enabled";
 private static final String TASK_QUEUE_CONSUMER_TIMEOUT = 
"task.queue.consumer.timeout";
@@ -403,6 +404,7 @@ public class RabbitMQConfiguration {
 private Optional useSsl;
 private Optional useSslManagement;
 private Optional useQuorumQueues;
+private Optional quorumQueueDeliveryLimit;
 private Optional quorumQueueReplicationFactor;
 private Optional sslConfiguration;
 private Optional queueTTL;
@@ -426,6 +428,7 @@ public class RabbitMQConfiguration {
 this.useSslManagement = Optional.empty();
 this.sslConfiguration = Optional.empty();
 this.useQuorumQueues = Optional.empty();
+this.quorumQueueDeliveryLimit = Optional.empty();
 this.quorumQueueReplicationFactor = Optional.empty();
 this.hosts = ImmutableList.builder();
 this.queueTTL = Optional.empty();
@@ -445,6 +448,17 @@ public class RabbitMQConfiguration {
 return this;
 }
 
+public Builder quorumQueueDeliveryLimit(int limit) {
+Preconditions.checkArgument(limit > 0, "'quorumQueueDeliveryLimit' 
should be strictly positive");
+this.quorumQueueDeliveryLimit = Optional.of(limit);
+return this;
+}
+
+public Builder quorumQueueDeliveryLimit(Optional limit) {
+limit.ifPresent(this::quorumQueueDeliveryLimit);
+return this;
+}
+
 public Builder connectionTimeoutInMs(int connectionTimeout) {
 this.connectionTimeoutInMs = Optional.of(connectionTimeout);
 return this;
@@ -551,6 +565,7 @@ public class RabbitMQConfiguration {

(james-project) branch master updated: [FIX] AbstractValidRcptHandler fix error handling on invalid username (#2122)

2024-03-15 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 950134a56f [FIX] AbstractValidRcptHandler fix error handling on 
invalid username (#2122)
950134a56f is described below

commit 950134a56f4a07c017a2ca709ee9705f4eb7db5b
Author: Benoit TELLIER 
AuthorDate: Fri Mar 15 09:01:08 2024 +0100

[FIX] AbstractValidRcptHandler fix error handling on invalid username 
(#2122)

Syntactically valid email address but invalid username.
The best is to advertise "no such person here".
---
 .../protocols/smtp/core/fastfail/AbstractValidRcptHandler.java| 8 
 .../java/org/apache/james/smtpserver/ValidRcptHandlerTest.java| 8 
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractValidRcptHandler.java
 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractValidRcptHandler.java
index 8f9a043372..7709157dc9 100644
--- 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractValidRcptHandler.java
+++ 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/AbstractValidRcptHandler.java
@@ -47,12 +47,12 @@ public abstract class AbstractValidRcptHandler implements 
RcptHook {
 return reject(rcpt);
 }
 return HookResult.DECLINED;
-} catch (IllegalAccessException e) {
-LOGGER.warn("Encounter an error upon RCPT validation ({}), 
deny-soft", rcpt.asString());
+} catch (IllegalArgumentException e) {
+LOGGER.info("Encounter an error upon RCPT validation ({}), deny", 
rcpt.asString());
 return HookResult.builder()
 .hookReturnCode(HookReturnCode.deny())
-.smtpReturnCode(SMTPRetCode.SYNTAX_ERROR_ARGUMENTS)
-.smtpDescription(DSNStatus.getStatus(DSNStatus.PERMANENT, 
DSNStatus.DELIVERY_SYNTAX) + " Unexpected error for " + rcpt.asString())
+.smtpReturnCode(SMTPRetCode.MAILBOX_PERM_UNAVAILABLE)
+.smtpDescription(DSNStatus.getStatus(DSNStatus.PERMANENT, 
DSNStatus.ADDRESS_MAILBOX) + " Unknown user: " + rcpt.asString())
 .build();
 } catch (Exception e) {
 LOGGER.error("Encounter an error upon RCPT validation ({}), 
deny-soft", rcpt.asString(), e);
diff --git 
a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
 
b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
index 378650caef..7536077d74 100644
--- 
a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
+++ 
b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/ValidRcptHandlerTest.java
@@ -236,4 +236,12 @@ class ValidRcptHandlerTest {
 assertThat(rCode).isEqualTo(HookReturnCode.denySoft());
 }
 
+@Test
+void doRcptShouldReturnDeclineWhenInvalidUsername() throws Exception {
+SMTPSession session = setupMockedSMTPSession(!RELAYING_ALLOWED);
+
+HookReturnCode rCode = handler.doRcpt(session, MAYBE_SENDER, new 
MailAddress("\"abc@\"@localhost")).getResult();
+
+assertThat(rCode).isEqualTo(HookReturnCode.deny());
+}
 }


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



(james-project) branch master updated: [UPDATE] MIME4J 0.8.10 -> 0.8.11 (#2120)

2024-03-15 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 96288d51c7 [UPDATE] MIME4J 0.8.10 -> 0.8.11 (#2120)
96288d51c7 is described below

commit 96288d51c7e94bc9678aa7dedbe5c806a81de0f2
Author: Benoit TELLIER 
AuthorDate: Fri Mar 15 09:00:55 2024 +0100

[UPDATE] MIME4J 0.8.10 -> 0.8.11 (#2120)
---
 .../apache/james/imap/scripts/FetchMultipartBodyStructure.test| 2 +-
 .../org/apache/james/imap/scripts/FetchSimpleBodyStructure.test   | 2 +-
 .../org/apache/james/imap/scripts/FetchStructureComplex.test  | 8 
 .../org/apache/james/imap/scripts/FetchStructureEmbedded.test | 2 +-
 pom.xml   | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
index 8a7b4a8429..290c84c954 100644
--- 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
+++ 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchMultipartBodyStructure.test
@@ -683,7 +683,7 @@ S: \* 1 FETCH \(BODY\[4\.2\.2\.2\] \{0\}
 S: \)
 S: A26 OK FETCH completed\.
 C: A27 FETCH 1:* (BODY BODYSTRUCTURE)
-S: \* 1 FETCH \(BODY \(\("TEXT" "PLAIN" \("charset" "us-ascii"\) NIL NIL 
"7BIT" 781 17\)\("IMAGE" "PNG" \("name" "blob\.png"\) NIL NIL "BASE64" 
492\)\("IMAGE" "PNG" \("name" "blob\.png"\) NIL NIL "BASE64" 492\)\("TEXT" 
"PLAIN" \("charset" "us-ascii" "name" "rhubarb\.txt"\) NIL NIL 
"QUOTED-PRINTABLE" 3193 41\) "MIXED"\) BODYSTRUCTURE \(\("TEXT" "PLAIN" 
\("charset" "us-ascii"\) NIL NIL "7BIT" 781 17 NIL NIL NIL 
"relative/license.txt"\)\("IMAGE" "PNG" \("name" "blob\.png"\) NIL NIL "BASE64" 
[...]
+S: \* 1 FETCH \(BODY \(\("TEXT" "PLAIN" \("charset" "US-ASCII"\) NIL NIL 
"7BIT" 781 17\)\("IMAGE" "PNG" \("name" "blob\.png"\) NIL NIL "BASE64" 
492\)\("IMAGE" "PNG" \("name" "blob\.png"\) NIL NIL "BASE64" 492\)\("TEXT" 
"PLAIN" \("charset" "us-ascii" "name" "rhubarb\.txt"\) NIL NIL 
"QUOTED-PRINTABLE" 3193 41\) "MIXED"\) BODYSTRUCTURE \(\("TEXT" "PLAIN" 
\("charset" "US-ASCII"\) NIL NIL "7BIT" 781 17 NIL NIL NIL 
"relative/license.txt"\)\("IMAGE" "PNG" \("name" "blob\.png"\) NIL NIL "BASE64" 
[...]
 S: \* 2 FETCH \(BODY \(\("TEXT" "PLAIN" \("charset" "US-ASCII"\) NIL NIL 
"7BIT" 15 1\)\("TEXT" "PLAIN" \("charset" "US-ASCII"\) NIL NIL "7BIT" 18 
1\)\("TEXT" "PLAIN" \("charset" "US-ASCII"\) NIL NIL "7BIT" 16 1\) 
"ALTERNATIVE"\) BODYSTRUCTURE \(\("TEXT" "PLAIN" \("charset" "US-ASCII"\) NIL 
NIL "7BIT" 15 1 NIL NIL \("en" "en-US" "en-CA"\) NIL\)\("TEXT" "PLAIN" 
\("charset" "US-ASCII"\) NIL NIL "7BIT" 18 1 NIL NIL \("fr" "fr-Latn-CA"\) 
NIL\)\("TEXT" "PLAIN" \("charset" "US-ASCII"\) NIL NIL  [...]
 S: A27 OK FETCH completed\.
 C: A28 DELETE testmailbox
diff --git 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
index 0f5fe7f81a..d58a3f7610 100644
--- 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
+++ 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/FetchSimpleBodyStructure.test
@@ -205,7 +205,7 @@ S: \* 1 FETCH \(BODY\[4\.2\.2\.2\] \{0\}
 S: \)
 S: A27 OK FETCH completed\.
 C: A28 FETCH 1:* (BODY BODYSTRUCTURE)
-S: \* 1 FETCH \(BODY \("TEXT" "PLAIN" \("charset" "us-ascii"\) NIL NIL "7BIT" 
8 0\) BODYSTRUCTURE \("TEXT" "PLAIN&qu

(james-project) 01/02: [FIX] OpenSearchListeningMessageSearchIndex should not fail on missing mailbox

2024-03-14 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 29111de9430062f6313f48618e3cc5504958de25
Author: Benoit TELLIER 
AuthorDate: Wed Mar 13 15:20:59 2024 +0100

[FIX] OpenSearchListeningMessageSearchIndex should not fail on missing 
mailbox
---
 .../events/OpenSearchListeningMessageSearchIndex.java  |  7 ++-
 .../events/OpenSearchListeningMessageSearchIndexTest.java  | 14 ++
 .../mailbox/store/search/ListeningMessageSearchIndex.java  | 11 ++-
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git 
a/mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndex.java
 
b/mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndex.java
index 056b533ad2..c321de6424 100644
--- 
a/mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndex.java
+++ 
b/mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndex.java
@@ -53,6 +53,7 @@ import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.SessionProvider;
 import org.apache.james.mailbox.events.MailboxEvents;
+import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.model.Mailbox;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MessageId;
@@ -300,7 +301,11 @@ public class OpenSearchListeningMessageSearchIndex extends 
ListeningMessageSearc
 private Mono processAddedEvent(MailboxSession session, 
MailboxEvents.Added addedEvent, MailboxId mailboxId) {
 return factory.getMailboxMapper(session)
 .findMailboxById(mailboxId)
-.flatMap(mailbox -> handleAdded(session, mailbox, addedEvent, 
chooseFetchType()));
+.flatMap(mailbox -> handleAdded(session, mailbox, addedEvent, 
chooseFetchType()))
+.onErrorResume(MailboxNotFoundException.class, e -> {
+LOGGER.info("Added event skipped for deleted mailbox {}", 
mailboxId.serialize());
+return Mono.empty();
+});
 }
 
 private FetchType chooseFetchType() {
diff --git 
a/mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndexTest.java
 
b/mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndexTest.java
index 2ac5fa71e9..0bdd95383b 100644
--- 
a/mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndexTest.java
+++ 
b/mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/events/OpenSearchListeningMessageSearchIndexTest.java
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS;
+import static org.mockito.Mockito.mock;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -33,6 +34,7 @@ import java.time.Instant;
 import java.time.ZoneId;
 import java.util.Date;
 import java.util.Optional;
+import java.util.UUID;
 
 import jakarta.mail.Flags;
 
@@ -395,6 +397,18 @@ class OpenSearchListeningMessageSearchIndexTest {
 .isEmpty();
 }
 
+@Test
+void addShouldNotFailWhenMailboxHadBeenDeleted() {
+mapperFactory.getMailboxMapper(session)
+.delete(mailbox)
+.block();
+
+assertThatCode(() -> testee.event(new 
MailboxEvents.Added(MailboxSession.SessionId.of(36), BOB, 
mailbox.generateAssociatedPath(),
+mailbox.getMailboxId(), ImmutableSortedMap.of(MESSAGE_UID_1, 
mock(MessageMetaData.class)), Event.EventId.of(UUID.randomUUID()),
+!IS_DELIVERY, IS_APPENDED, Optional.empty(
+.doesNotThrowAnyException();
+}
+
 @Test
 void deleteShouldBeIdempotent() throws Exception {
 testee.add(session, mailbox, MESSAGE_1).block();
diff --git 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
index 8b38c21893..b2f1e3a174 100644
--- 
a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
+++ 
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
@@ -35,6 +35,7 @@ import 
org.apache.james.mailbox.events.MailboxEvents.FlagsUpdated;
 import org.apache.james.mailbox.events.MailboxEvents.Ma

(james-project) branch master updated (4c0c565b04 -> 3a493d38a0)

2024-03-14 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 4c0c565b04 [SITE] MIME4J 0.8.11 blog post
 new 29111de943 [FIX] OpenSearchListeningMessageSearchIndex should not fail 
on missing mailbox
 new 3a493d38a0 [FIX] MailboxChangeListener should not warn on deleted 
mailbox

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:
 .../events/OpenSearchListeningMessageSearchIndex.java  |  7 ++-
 .../events/OpenSearchListeningMessageSearchIndexTest.java  | 14 ++
 .../mailbox/store/search/ListeningMessageSearchIndex.java  | 11 ++-
 .../apache/james/jmap/change/MailboxChangeListener.scala   | 11 ---
 4 files changed, 38 insertions(+), 5 deletions(-)


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



(james-project) 02/02: [FIX] MailboxChangeListener should not warn on deleted mailbox

2024-03-14 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 3a493d38a0452d35e3c7754c70e1f656770d758a
Author: Benoit TELLIER 
AuthorDate: Wed Mar 13 15:39:45 2024 +0100

[FIX] MailboxChangeListener should not warn on deleted mailbox
---
 .../org/apache/james/jmap/change/MailboxChangeListener.scala  | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/change/MailboxChangeListener.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/change/MailboxChangeListener.scala
index e12adfd57b..bc08e089c9 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/change/MailboxChangeListener.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/change/MailboxChangeListener.scala
@@ -34,6 +34,7 @@ import org.apache.james.jmap.core.UuidState
 import org.apache.james.mailbox.MailboxManager
 import org.apache.james.mailbox.events.MailboxEvents
 import org.apache.james.mailbox.events.MailboxEvents.{Added, Expunged, 
FlagsUpdated, MailboxACLUpdated, MailboxAdded, MailboxDeletion, MailboxEvent, 
MailboxRenamed}
+import org.apache.james.mailbox.exception.{MailboxException, 
MailboxNotFoundException}
 import org.apache.james.mailbox.model.{MailboxACL, MailboxId}
 import org.apache.james.util.ReactorUtils.DEFAULT_CONCURRENCY
 import org.reactivestreams.Publisher
@@ -117,9 +118,13 @@ case class MailboxChangeListener @Inject() 
(@Named(InjectionKeys.JMAP) eventBus:
 .map(_.getName)
 .map(AccountId.fromString)
 .toList)
-  .onErrorResume(e => {
-LOGGER.warn("Could not get sharees for mailbox [%s] when listening to 
change events", mailboxId, e)
-SMono.just(List.empty)
+  .onErrorResume({
+case e: MailboxNotFoundException =>
+  LOGGER.warn("Could not get sharees for mailbox {} as the mailbox was 
deleted", mailboxId)
+  SMono.just(List.empty)
+case e =>
+  LOGGER.warn("Could not get sharees for mailbox {} when listening to 
change events", mailboxId, e)
+  SMono.just(List.empty)
   })
   }
 


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



(james-project) branch master updated (d413f8fcc4 -> 4c0c565b04)

2024-03-14 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 d413f8fcc4 [FIX] JMAP: Set configurable limits for /get /set objects 
(#2096)
 new cc5332158a [SITE] MIME4J 0.8.10 => 0.8.11
 new 4c0c565b04 [SITE] MIME4J 0.8.11 blog post

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:
 markdown => 2024-03-05-mime4j-0.8.11.markdown} |  8 +++---
 src/site/xdoc/download.xml | 32 +++---
 2 files changed, 20 insertions(+), 20 deletions(-)
 copy src/homepage/_posts/{2024-01-08-mime4j-0.8.10.markdown => 
2024-03-05-mime4j-0.8.11.markdown} (69%)


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



(james-project) 01/02: [SITE] MIME4J 0.8.10 => 0.8.11

2024-03-14 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 cc5332158ae227006225ed65b226c92143d4cdfb
Author: Benoit TELLIER 
AuthorDate: Tue Mar 5 16:30:49 2024 +0100

[SITE] MIME4J 0.8.10 => 0.8.11
---
 src/site/xdoc/download.xml | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/site/xdoc/download.xml b/src/site/xdoc/download.xml
index 8227f72324..1ced5cd2d4 100644
--- a/src/site/xdoc/download.xml
+++ b/src/site/xdoc/download.xml
@@ -147,12 +147,12 @@
 
   
   
-Apache Mime4J 0.8.10 is the latest stable version.
+Apache Mime4J 0.8.11 is the latest stable version.
 
 Sources:
-  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.10/james-mime4j-sources-0.8.10.zip;>(Zip)
-  [https://downloads.apache.org/james/mime4j/0.8.10/james-mime4j-sources-0.8.10.zip.sha512;>SHA-512]
-  [https://downloads.apache.org/james/mime4j/0.8.10/james-mime4j-sources-0.8.10.zip.asc;>PGP]
+  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip;>(Zip)
+  [https://downloads.apache.org/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip.sha512;>SHA-512]
+  [https://downloads.apache.org/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip.asc;>PGP]
 
 
 You can directly use the core library with maven:
@@ -162,15 +162,15 @@
   dependency
 groupIdorg.apache.james/groupId
 artifactIdapache-mime4j-core/artifactId
-version0.8.10/version
+version0.8.11/version
   /dependency
  
 
 
 Direct download link:
-  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.10/apache-mime4j-core-0.8.10.jar;>(Jar)
-  [https://downloads.apache.org/james/mime4j/0.8.10/apache-mime4j-core-0.8.10.jar.sha512;>SHA-512]
-  [https://downloads.apache.org/james/mime4j/0.8.10/apache-mime4j-core-0.8.10.jar.asc;>PGP]
+  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar;>(Jar)
+  [https://downloads.apache.org/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.sha512;>SHA-512]
+  [https://downloads.apache.org/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.asc;>PGP]
   
 
 In order to use Mime-4j DOM:
@@ -180,15 +180,15 @@
   dependency
 groupIdorg.apache.james/groupId
 artifactIdapache-mime4j-dom/artifactId
-version0.8.10/version
+version0.8.11/version
   /dependency
  
 
 
 Direct download link:
-  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.10/apache-mime4j-dom-0.8.10.jar;>(Jar)
-  [https://downloads.apache.org/james/mime4j/0.8.10/apache-mime4j-dom-0.8.10.jar.sha512;>SHA-512]
-  [https://downloads.apache.org/james/mime4j/0.8.10/apache-mime4j-dom-0.8.10.jar.asc;>PGP]
+  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar;>(Jar)
+  [https://downloads.apache.org/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.sha512;>SHA-512]
+  [https://downloads.apache.org/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.asc;>PGP]
 
 
 An aggregator project is also available:
@@ -198,15 +198,15 @@
   dependency
 groupIdorg.apache.james/groupId
 artifactIdapache-mime4j/artifactId
-version0.8.10/version
+version0.8.11/version
   /dependency
  
 
 
 Direct download link:
-  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip;>(Zip)
-  [https://downloads.apache.org/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.sha512;>SHA-512]
-  [https://downloads.apache.org/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.asc;>PGP]
+  https://www.apache.org/dyn/closer.lua/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip;>(Zip)
+  [https://downloads.apache.org/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.sha512;>SHA-512]
+  [https://downloads.apache.org/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.asc;>PGP]
 
   
   


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



(james-project) 02/02: [SITE] MIME4J 0.8.11 blog post

2024-03-14 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 4c0c565b049a9369b8c3eee7fa3624e7ca63bcd2
Author: Benoit TELLIER 
AuthorDate: Tue Mar 5 16:32:38 2024 +0100

[SITE] MIME4J 0.8.11 blog post
---
 .../_posts/2024-03-05-mime4j-0.8.11.markdown | 20 
 1 file changed, 20 insertions(+)

diff --git a/src/homepage/_posts/2024-03-05-mime4j-0.8.11.markdown 
b/src/homepage/_posts/2024-03-05-mime4j-0.8.11.markdown
new file mode 100644
index 00..7186f79290
--- /dev/null
+++ b/src/homepage/_posts/2024-03-05-mime4j-0.8.11.markdown
@@ -0,0 +1,20 @@
+---
+layout: post
+title:  "Apache James MIME4J 0.8.11"
+date:   2024-03-05  03:16:30 +0200
+categories: james update
+---
+
+The Apache James developers are pleased to announce the 0.8.11 release of the 
MIME4J library.
+
+Early adopters can [download it][download], any issue can be reported on our 
issue [tracker][tracker].
+
+The full changes included in this release can be seen in the 
[CHANGELOG][CHANGELOG].
+
+This release fixes a minor regression of the 0.8.10 release regarding invalid 
encoding in email headers.
+
+The Apache James PMC would like to thanks all contributors who made this 
release possible!
+
+[CHANGELOG]: https://github.com/apache/james-mime4j/blob/master/CHANGELOG.md
+[tracker]: https://issues.apache.org/jira/browse/MIME4J
+[download]: https://james.apache.org/download.cgi#Apache_Mime4J


-
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] JMAP: Set configurable limits for /get /set objects (#2096)

2024-03-11 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 d413f8fcc4 [FIX] JMAP: Set configurable limits for /get /set objects 
(#2096)
d413f8fcc4 is described below

commit d413f8fcc4030af6952a90b47f2041eebfd0c94b
Author: Benoit TELLIER 
AuthorDate: Tue Mar 12 06:57:58 2024 +0100

[FIX] JMAP: Set configurable limits for /get /set objects (#2096)
---
 .../docs/modules/ROOT/pages/configure/jmap.adoc|  6 
 .../org/apache/james/jmap/draft/JMAPModule.java|  2 +-
 .../org/apache/james/jmap/core/Capabilities.scala  |  2 +-
 .../org/apache/james/jmap/core/Capability.scala|  8 ++---
 .../james/jmap/core/JmapRfc8621Configuration.scala | 14 -
 .../james/jmap/core/PushSubscriptionGet.scala  |  6 ++--
 .../james/jmap/core/PushSubscriptionSet.scala  |  6 ++--
 .../apache/james/jmap/delegation/DelegateGet.scala |  6 ++--
 .../apache/james/jmap/delegation/DelegateSet.scala |  6 ++--
 .../jmap/delegation/DelegatedAccountGet.scala  |  6 ++--
 .../jmap/delegation/DelegatedAccountSet.scala  |  6 ++--
 .../scala/org/apache/james/jmap/mail/Email.scala   | 11 ++-
 .../org/apache/james/jmap/mail/EmailGet.scala  | 20 +++--
 .../org/apache/james/jmap/mail/EmailImport.scala   | 14 +++--
 .../org/apache/james/jmap/mail/EmailParse.scala| 14 +++--
 .../org/apache/james/jmap/mail/EmailSet.scala  |  6 ++--
 .../james/jmap/mail/EmailSubmissionSet.scala   | 27 +
 .../org/apache/james/jmap/mail/IdentityGet.scala   |  6 ++--
 .../org/apache/james/jmap/mail/IdentitySet.scala   |  6 ++--
 .../org/apache/james/jmap/mail/MDNParse.scala  | 10 +++
 .../scala/org/apache/james/jmap/mail/MDNSend.scala | 12 +---
 .../org/apache/james/jmap/mail/MailboxGet.scala|  6 ++--
 .../org/apache/james/jmap/mail/MailboxSet.scala|  6 ++--
 .../scala/org/apache/james/jmap/mail/Quotas.scala  |  6 ++--
 .../scala/org/apache/james/jmap/mail/Thread.scala  |  6 ++--
 .../james/jmap/method/DelegateGetMethod.scala  |  4 ++-
 .../james/jmap/method/DelegateSetMethod.scala  |  4 ++-
 .../jmap/method/DelegatedAccountGetMethod.scala|  4 ++-
 .../jmap/method/DelegatedAccountSetMethod.scala|  4 ++-
 .../apache/james/jmap/method/EmailGetMethod.scala  | 29 +-
 .../james/jmap/method/EmailImportMethod.scala  |  8 +++--
 .../james/jmap/method/EmailParseMethod.scala   |  7 +++--
 .../apache/james/jmap/method/EmailSetMethod.scala  |  6 ++--
 .../jmap/method/EmailSubmissionSetMethod.scala |  7 +++--
 .../james/jmap/method/IdentityGetMethod.scala  |  4 ++-
 .../james/jmap/method/IdentitySetMethod.scala  |  5 +++-
 .../apache/james/jmap/method/MDNParseMethod.scala  |  8 +++--
 .../apache/james/jmap/method/MDNSendMethod.scala   |  5 ++--
 .../james/jmap/method/MailboxGetMethod.scala   |  6 ++--
 .../james/jmap/method/MailboxSetMethod.scala   |  6 ++--
 .../org/apache/james/jmap/method/Method.scala  | 35 +-
 .../jmap/method/PushSubscriptionGetMethod.scala|  6 ++--
 .../jmap/method/PushSubscriptionSetMethod.scala|  4 ++-
 .../apache/james/jmap/method/QuotaGetMethod.scala  |  4 ++-
 .../apache/james/jmap/method/ThreadGetMethod.scala |  6 ++--
 .../jmap/method/VacationResponseGetMethod.scala|  6 ++--
 .../jmap/method/VacationResponseSetMethod.scala|  6 ++--
 .../james/jmap/vacation/VacationResponseGet.scala  |  6 ++--
 .../james/jmap/vacation/VacationResponseSet.scala  |  7 +++--
 src/site/xdoc/server/config-jmap.xml   |  6 
 50 files changed, 291 insertions(+), 120 deletions(-)

diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
index 4297eb1ad3..a1775ae4e5 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
@@ -105,6 +105,12 @@ This allows to prevent users from using some specific JMAP 
extensions.
 
 | email.get.full.max.size
 | Optional, default value is 5. The max number of items for EmailGet full 
reads.
+
+| get.max.size
+| Optional, default value is 500. The max number of items for /get methods.
+
+| set.max.size
+| Optional, default value is 500. The max number of items for /set methods.
 |===
 
 == Wire tapping
diff --git 
a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPModule.java
 
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPModule.java
index 151c86e751..b4339445f7 100644
--- 
a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/JMAPModule.java
+++ 
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft

(james-project) branch master updated: JAMES-4019 ReactiveThrottler should handle better cancellation (#2104)

2024-03-11 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 9c4a58d5e7 JAMES-4019 ReactiveThrottler should handle better 
cancellation (#2104)
9c4a58d5e7 is described below

commit 9c4a58d5e73877e28570f138b7199b32b1b6b461
Author: Benoit TELLIER 
AuthorDate: Tue Mar 12 06:57:27 2024 +0100

JAMES-4019 ReactiveThrottler should handle better cancellation (#2104)
---
 .../james/imapserver/netty/ReactiveThrottler.java  | 46 ---
 .../imapserver/netty/ReactiveThrottlerTest.java| 67 ++
 2 files changed, 106 insertions(+), 7 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ReactiveThrottler.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ReactiveThrottler.java
index 05998122ae..09b1b9d01d 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ReactiveThrottler.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ReactiveThrottler.java
@@ -19,18 +19,31 @@
 
 package org.apache.james.imapserver.netty;
 
+import java.util.Optional;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.metrics.api.GaugeRegistry;
 import org.reactivestreams.Publisher;
 
+import reactor.core.Disposable;
 import reactor.core.publisher.Mono;
 import reactor.core.publisher.Sinks;
 
 public class ReactiveThrottler {
+private static class TaskHolder {
+private final Publisher task;
+private final AtomicReference disposable = new 
AtomicReference<>();
+
+private TaskHolder(Publisher task) {
+this.task = task;
+}
+}
+
 public static class RejectedException extends RuntimeException {
 private final ImapMessage imapMessage;
 
@@ -48,7 +61,7 @@ public class ReactiveThrottler {
 private final int maxQueueSize;
 // In flight + executing
 private final AtomicInteger concurrentRequests = new AtomicInteger(0);
-private final Queue> queue = new ConcurrentLinkedQueue<>();
+private final Queue queue = new ConcurrentLinkedQueue<>();
 
 public ReactiveThrottler(GaugeRegistry gaugeRegistry, int 
maxConcurrentRequests, int maxQueueSize) {
 gaugeRegistry.register("imap.request.queue.size", () -> 
Math.max(concurrentRequests.get() - maxConcurrentRequests, 0));
@@ -69,11 +82,27 @@ public class ReactiveThrottler {
 .doFinally(any -> onRequestDone());
 } else if (requestNumber <= maxQueueSize + maxConcurrentRequests) {
 // Queue the request for later
+AtomicBoolean cancelled = new AtomicBoolean(false);
 Sinks.One one = Sinks.one();
-queue.add(Mono.from(task)
+TaskHolder taskHolder = new 
TaskHolder(Mono.fromCallable(cancelled::get)
+.flatMap(cancel -> {
+if (cancel) {
+return Mono.empty();
+}
+return Mono.from(task);
+})
 .then(Mono.fromRunnable(() -> 
one.emitEmpty(Sinks.EmitFailureHandler.FAIL_FAST;
+queue.add(taskHolder);
 // Let the caller await task completion
-return one.asMono();
+return one.asMono()
+.doOnCancel(() -> {
+cancelled.set(true);
+
Optional.ofNullable(taskHolder.disposable.get()).ifPresent(Disposable::dispose);
+boolean removed = queue.remove(taskHolder);
+if (removed) {
+concurrentRequests.decrementAndGet();
+}
+});
 } else {
 concurrentRequests.decrementAndGet();
 
@@ -86,12 +115,15 @@ public class ReactiveThrottler {
 }
 
 private void onRequestDone() {
-concurrentRequests.decrementAndGet();
-Publisher throttled = queue.poll();
+concurrentRequests.getAndDecrement();
+TaskHolder throttled = queue.poll();
 if (throttled != null) {
-Mono.from(throttled)
-.doFinally(any -> onRequestDone())
+Disposable disposable = Mono.from(throttled.task)
+.doFinally(any -> {
+onRequestDone();
+})
 .subscribe();
+throttled.disposable.set(disposable);
 }
 }
 }
diff --git 
a/server/protocols/protocols-imap4/src/test/java/org/apache/james

(james-project) branch master updated (b8ddca505c -> ded3f58851)

2024-03-11 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 b8ddca505c [ENHANCEMENT] Decrease log level for "NotSslRecordException"
 add 0b313a0dde [REFACTORING] Improve AuthCmdHandler code style
 add 96c87d0d67 [REFACTORING] AuthCmdHandler: INFO logs on invalid input
 add 71c2faf7d9 [REFACTORING] AuthCmdHandler: Use isEmpty()
 add f8ddb7a7a5 [REFACTORING] AuthCmdHandler: LineHandler line is never null
 add f14a1ecb69 [REFACTORING] AuthCmdHandler: Avoid returning null
 add ded3f58851 [REFACTORING] AuthCmdHandler: Add a missing diagnostic log

No new revisions were added by this update.

Summary of changes:
 .../protocols/smtp/core/esmtp/AuthCmdHandler.java  | 83 +-
 1 file changed, 34 insertions(+), 49 deletions(-)


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



(james-project) branch postgresql updated (29c85f3fe2 -> 3d69dc9fdc)

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

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


from 29c85f3fe2 JAMES 2586 PostgresPushSubscriptionRepository: rely on 
Postgres unique constraint for deviceClientId (#2094)
 add 3d69dc9fdc JAMES-2586 [Postgres] FIXUP when query with IN - should 
pre-check collection size (#2103)

No new revisions were added by this update.

Summary of changes:
 .../postgres/mail/dao/PostgresMailboxMessageDAO.java  | 15 +++
 .../mailbox/postgres/mail/dao/PostgresThreadDAO.java  |  3 +++
 .../apache/james/blob/postgres/PostgresBlobStoreDAO.java  |  3 +++
 .../jmap/postgres/identity/PostgresCustomIdentityDAO.java |  3 +++
 .../pushsubscription/PostgresPushSubscriptionDAO.java |  3 +++
 5 files changed, 27 insertions(+)


-
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] Ship mail over web webadmin routes into more apps (#2099)

2024-03-11 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 17a2857b75 [FIX] Ship mail over web webadmin routes into more apps 
(#2099)
17a2857b75 is described below

commit 17a2857b759f14a314987b870b3a3cb1ab32ba97
Author: Benoit TELLIER 
AuthorDate: Mon Mar 11 07:40:41 2024 +0100

[FIX] Ship mail over web webadmin routes into more apps (#2099)
---
 server/apps/jpa-app/pom.xml|  4 ++
 .../java/org/apache/james/JPAJamesServerMain.java  |  4 +-
 server/apps/jpa-smtp-app/pom.xml   |  4 ++
 .../java/org/apache/james/JPAJamesServerMain.java  |  4 +-
 server/apps/memory-app/pom.xml |  4 ++
 .../org/apache/james/MemoryJamesServerMain.java|  4 +-
 server/apps/scaling-pulsar-smtp/pom.xml|  4 ++
 .../src/main/java/org/apache/james/Main.java   | 75 ++
 8 files changed, 60 insertions(+), 43 deletions(-)

diff --git a/server/apps/jpa-app/pom.xml b/server/apps/jpa-app/pom.xml
index 5d8e063e74..46dc45246b 100644
--- a/server/apps/jpa-app/pom.xml
+++ b/server/apps/jpa-app/pom.xml
@@ -140,6 +140,10 @@
 ${james.groupId}
 james-server-guice-webadmin-data
 
+
+${james.groupId}
+james-server-guice-webadmin-mail-over-web
+
 
 ${james.groupId}
 james-server-guice-webadmin-mailbox
diff --git 
a/server/apps/jpa-app/src/main/java/org/apache/james/JPAJamesServerMain.java 
b/server/apps/jpa-app/src/main/java/org/apache/james/JPAJamesServerMain.java
index 47f53c63ae..54d764c5d8 100644
--- a/server/apps/jpa-app/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ b/server/apps/jpa-app/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -49,6 +49,7 @@ import 
org.apache.james.modules.server.RawPostDequeueDecoratorModule;
 import org.apache.james.modules.server.ReIndexingModule;
 import org.apache.james.modules.server.SieveRoutesModule;
 import org.apache.james.modules.server.TaskManagerModule;
+import org.apache.james.modules.server.WebAdminMailOverWebModule;
 import 
org.apache.james.modules.server.WebAdminReIndexingTaskSerializationModule;
 import org.apache.james.modules.server.WebAdminServerModule;
 
@@ -66,7 +67,8 @@ public class JPAJamesServerMain implements JamesServerMain {
 new MailRepositoriesRoutesModule(),
 new ReIndexingModule(),
 new SieveRoutesModule(),
-new WebAdminReIndexingTaskSerializationModule());
+new WebAdminReIndexingTaskSerializationModule(),
+new WebAdminMailOverWebModule());
 
 private static final Module PROTOCOLS = Modules.combine(
 new IMAPServerModule(),
diff --git a/server/apps/jpa-smtp-app/pom.xml b/server/apps/jpa-smtp-app/pom.xml
index df665c36d2..fdad84848d 100644
--- a/server/apps/jpa-smtp-app/pom.xml
+++ b/server/apps/jpa-smtp-app/pom.xml
@@ -100,6 +100,10 @@
 ${james.groupId}
 james-server-guice-webadmin-data
 
+
+${james.groupId}
+james-server-guice-webadmin-mail-over-web
+
 
 ${james.groupId}
 james-server-guice-webadmin-mailqueue
diff --git 
a/server/apps/jpa-smtp-app/src/main/java/org/apache/james/JPAJamesServerMain.java
 
b/server/apps/jpa-smtp-app/src/main/java/org/apache/james/JPAJamesServerMain.java
index adf064ef82..7c517d2cc8 100644
--- 
a/server/apps/jpa-smtp-app/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ 
b/server/apps/jpa-smtp-app/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -37,6 +37,7 @@ import 
org.apache.james.modules.server.MailRepositoriesRoutesModule;
 import org.apache.james.modules.server.NoJwtModule;
 import org.apache.james.modules.server.RawPostDequeueDecoratorModule;
 import org.apache.james.modules.server.TaskManagerModule;
+import org.apache.james.modules.server.WebAdminMailOverWebModule;
 import org.apache.james.modules.server.WebAdminServerModule;
 
 import com.google.inject.Module;
@@ -53,7 +54,8 @@ public class JPAJamesServerMain implements JamesServerMain {
 new MailQueueRoutesModule(),
 new NoJwtModule(),
 new DefaultProcessorsConfigurationProviderModule(),
-new TaskManagerModule());
+new TaskManagerModule(),
+new WebAdminMailOverWebModule());
 
 private static final Module JPA_SERVER_MODULE = Modules.combine(
 new NaiveDelegationStoreModule(),
diff --git a/server/apps/memory-app/pom.xml b/server/apps/memory-app/pom.xml
index 3096f52cff..578902bf25 100644
--- a/server/apps/memory-app/pom.xml
+++ b/server/apps/memory-app/pom.xml
@@ -154,6 +154,10 @@
 ${james.groupId}
 james-server-guice-webadmin-jmap
 
+
+${james.groupId}
+james-server-guice

(james-project) branch postgresql updated: JAMES 2586 PostgresPushSubscriptionRepository: rely on Postgres unique constraint for deviceClientId (#2094)

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

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


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

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

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

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

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

svn commit: r67736 - /release/james/mime4j/0.8.11/

2024-03-05 Thread btellier
Author: btellier
Date: Tue Mar  5 15:38:59 2024
New Revision: 67736

Log:
MIME4J 0.8.11

Added:
release/james/mime4j/0.8.11/
release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip   (with props)
release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.asc   (with props)
release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.sha512
release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar   (with props)
release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.asc   (with props)
release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.sha512
release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar   (with props)
release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.asc   (with props)
release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.sha512
release/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip   (with props)
release/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip.asc   (with 
props)
release/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip.sha512

Added: release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip
==
Binary file - no diff available.

Propchange: release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip
--
svn:mime-type = application/octet-stream

Added: release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.asc
==
Binary file - no diff available.

Propchange: release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.asc
--
svn:mime-type = application/octet-stream

Added: release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.sha512
==
--- release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.sha512 (added)
+++ release/james/mime4j/0.8.11/apache-mime4j-0.8.11-bin.zip.sha512 Tue Mar  5 
15:38:59 2024
@@ -0,0 +1 @@
+37bd9dfa20bc38c2fa97c5957261faf395c71f76dde12f80bb42980e441f552dd2b1f271b1791a8b12a3f6533f2f448dd6c1b454d64695bd9ae43cb97871e029
  apache-mime4j-0.8.11-bin.zip

Added: release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar
==
Binary file - no diff available.

Propchange: release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar
--
svn:mime-type = application/octet-stream

Added: release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.asc
==
Binary file - no diff available.

Propchange: release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.asc
--
svn:mime-type = application/octet-stream

Added: release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.sha512
==
--- release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.sha512 (added)
+++ release/james/mime4j/0.8.11/apache-mime4j-core-0.8.11.jar.sha512 Tue Mar  5 
15:38:59 2024
@@ -0,0 +1 @@
+e5a43c0c6bad3ddd17af14b8da26a84a597fccbe92c13d0de0bb8376c92a70f6a407d2997f9f06696a2ef398debf58e86b40f2fa3823896e890faf3df35e3ac8
  apache-mime4j-core-0.8.11.jar

Added: release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar
==
Binary file - no diff available.

Propchange: release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar
--
svn:mime-type = application/octet-stream

Added: release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.asc
==
Binary file - no diff available.

Propchange: release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.asc
--
svn:mime-type = application/octet-stream

Added: release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.sha512
==
--- release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.sha512 (added)
+++ release/james/mime4j/0.8.11/apache-mime4j-dom-0.8.11.jar.sha512 Tue Mar  5 
15:38:59 2024
@@ -0,0 +1 @@
+9bf6b3dca2ed9696a7ebd7afcbbc4a6d580971b8f1c54301fb15dc6b3795b6865ba94470d59ee4412c04632f35100cf6f037b5b7f12b0dfde51c9f659fb012bf
  apache-mime4j-dom-0.8.11.jar

Added: release/james/mime4j/0.8.11/james-mime4j-sources-0.8.11.zip
==
Binary file - no diff available.

Propchange: release/james/mime4j

svn commit: r67735 - /release/james/mime4j/0.8.9/

2024-03-05 Thread btellier
Author: btellier
Date: Tue Mar  5 15:29:10 2024
New Revision: 67735

Log:
Archive MIME4J 0.8.9

Removed:
release/james/mime4j/0.8.9/


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



(james-project) branch master updated: [FIX] Modified server set identities may not be deletes (#2083)

2024-03-05 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 1dcfac3332 [FIX] Modified server set identities may not be deletes 
(#2083)
1dcfac3332 is described below

commit 1dcfac3332a2d6f868aa8c9c525b89434c1e3be9
Author: Benoit TELLIER 
AuthorDate: Tue Mar 5 11:49:51 2024 +0100

[FIX] Modified server set identities may not be deletes (#2083)
---
 .../org/apache/james/jmap/api/identity/CustomIdentityDAO.scala  | 4 ++--
 .../org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala | 6 +++---
 .../apache/james/jmap/rfc8621/contract/IdentitySetContract.scala| 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/server/data/data-jmap/src/main/scala/org/apache/james/jmap/api/identity/CustomIdentityDAO.scala
 
b/server/data/data-jmap/src/main/scala/org/apache/james/jmap/api/identity/CustomIdentityDAO.scala
index f68d3cc092..8aa0f2bc5d 100644
--- 
a/server/data/data-jmap/src/main/scala/org/apache/james/jmap/api/identity/CustomIdentityDAO.scala
+++ 
b/server/data/data-jmap/src/main/scala/org/apache/james/jmap/api/identity/CustomIdentityDAO.scala
@@ -259,13 +259,13 @@ object IdentityWithOrigin {
   case class CustomIdentityOrigin(inputIdentity: Identity) extends 
IdentityWithOrigin {
 override def identity: Identity = inputIdentity
 
-override def merge(other: IdentityWithOrigin): IdentityWithOrigin = this
+override def merge(other: IdentityWithOrigin): IdentityWithOrigin = 
CustomIdentityOrigin(identity.copy(mayDelete = MayDeleteIdentity(false)))
   }
 
   case class ServerSetIdentityOrigin(inputIdentity: Identity) extends 
IdentityWithOrigin {
 override def identity: Identity = inputIdentity
 
-override def merge(other: IdentityWithOrigin): IdentityWithOrigin = other
+override def merge(other: IdentityWithOrigin): IdentityWithOrigin = 
CustomIdentityOrigin(other.identity.copy(mayDelete = MayDeleteIdentity(false)))
   }
 
   def fromCustom(identity: Identity): IdentityWithOrigin = 
CustomIdentityOrigin(identity)
diff --git 
a/server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
 
b/server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
index 075f1abf92..a5d28c2336 100644
--- 
a/server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
+++ 
b/server/data/data-jmap/src/test/scala/org/apache/james/jmap/api/identity/IdentityRepositoryTest.scala
@@ -112,7 +112,7 @@ class IdentityRepositoryTest {
 
when(identityFactory.listIdentities(BOB)).thenReturn(List(differentIdentityWithSameId))
 
 
assertThat(SFlux.fromPublisher(testee.list(BOB)).collectSeq().block().asJava)
-  .containsExactlyInAnyOrder(customIdentity)
+  .containsExactlyInAnyOrder(customIdentity.copy(mayDelete = 
MayDeleteIdentity(false)))
   }
 
   @Test
@@ -191,7 +191,7 @@ class IdentityRepositoryTest {
 bcc = Some(List(EmailAddress(Some(EmailerName("My Boss 2 (updated)")), 
new MailAddress("boss-update...@domain.tld",
 textSignature = TextSignature("text 2 signature"),
 htmlSignature = HtmlSignature("html 2 signature"),
-mayDelete = MayDeleteIdentity(true)))
+mayDelete = MayDeleteIdentity(false)))
   }
 
   @Test
@@ -213,7 +213,7 @@ class IdentityRepositoryTest {
 bcc = Some(List(EmailAddress(Some(EmailerName("My Boss 2 (updated)")), 
new MailAddress("boss-update...@domain.tld",
 textSignature = TextSignature("text 2 signature"),
 htmlSignature = HtmlSignature("html 2 signature"),
-mayDelete = MayDeleteIdentity(true)))
+mayDelete = MayDeleteIdentity(false)))
   }
 
   @Test
diff --git 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
index f83d45a1c9..9dceb93306 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
@@ -1963,7 +1963,7 @@ trait IdentitySetContract {
|],
|"textSignature": "Difference text 
signature",
|"htmlSignature": "Difference html 
signatu

(james-mime4j) branch MIME4J-326 updated: [maven-release-plugin] prepare for next development iteration

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

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


The following commit(s) were added to refs/heads/MIME4J-326 by this push:
 new ae66a12b [maven-release-plugin] prepare for next development iteration
ae66a12b is described below

commit ae66a12b393f1ac44efdd6036600358da1cbb855
Author: Benoit TELLIER 
AuthorDate: Tue Mar 5 10:58:03 2024 +0100

[maven-release-plugin] prepare for next development iteration
---
 assemble/pom.xml| 2 +-
 benchmark/pom.xml   | 2 +-
 core/pom.xml| 2 +-
 dom/pom.xml | 2 +-
 examples/pom.xml| 2 +-
 james-utils/pom.xml | 2 +-
 mbox/pom.xml| 2 +-
 pom.xml | 4 ++--
 storage/pom.xml | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/assemble/pom.xml b/assemble/pom.xml
index 7ae96d5b..2d5b4ccd 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 57716130..ded770bf 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index c4ee5f4a..ef896b7c 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index b644f9c4..969f3e18 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index b907f598..31f5079c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 61fe3b32..1517f7fa 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 4274b41b..955e5d58 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index fcc9180f..b36e45d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.11
+0.8.12-SNAPSHOT
 pom
 
 Apache James :: Mime4j :: Project
@@ -52,7 +52,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/james-mime4j.git
 
scm:git:ssh://g...@github.com/apache/james-mime4j.git
 https://git-wip-us.apache.org/repos/asf/james-mime4j.git
-  apache-mime4j-project-0.8.11
+  HEAD
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index d6d88730..43be4ea8 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11
+0.8.12-SNAPSHOT
 ../pom.xml
 
 


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



(james-mime4j) annotated tag apache-mime4j-project-0.8.11 updated (8da9c06b -> ed980739)

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

btellier pushed a change to annotated tag apache-mime4j-project-0.8.11
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git


*** WARNING: tag apache-mime4j-project-0.8.11 was modified! ***

from 8da9c06b (commit)
  to ed980739 (tag)
 tagging 8da9c06b2ae1303107305e21bd60acb999b45075 (commit)
 replaces apache-mime4j-project-0.8.9
  by Benoit TELLIER
  on Tue Mar 5 10:58:01 2024 +0100

- Log -
[maven-release-plugin] copy for tag apache-mime4j-project-0.8.11
---


No new revisions were added by this update.

Summary of changes:


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



(james-mime4j) branch MIME4J-326 created (now 8da9c06b)

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

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


  at 8da9c06b [maven-release-plugin] prepare release 
apache-mime4j-project-0.8.11

This branch includes the following new commits:

 new 8da9c06b [maven-release-plugin] prepare release 
apache-mime4j-project-0.8.11

The 1 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.



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



(james-mime4j) 01/01: [maven-release-plugin] prepare release apache-mime4j-project-0.8.11

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

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

commit 8da9c06b2ae1303107305e21bd60acb999b45075
Author: Benoit TELLIER 
AuthorDate: Tue Mar 5 10:57:47 2024 +0100

[maven-release-plugin] prepare release apache-mime4j-project-0.8.11
---
 assemble/pom.xml| 2 +-
 benchmark/pom.xml   | 2 +-
 core/pom.xml| 2 +-
 dom/pom.xml | 2 +-
 examples/pom.xml| 2 +-
 james-utils/pom.xml | 2 +-
 mbox/pom.xml| 2 +-
 pom.xml | 4 ++--
 storage/pom.xml | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/assemble/pom.xml b/assemble/pom.xml
index 8a7607b5..7ae96d5b 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index f612b5a5..57716130 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index d7a7fa1e..c4ee5f4a 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index d2cba7bc..b644f9c4 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 2d02382d..b907f598 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index d5c69bd7..61fe3b32 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index d55c0e0d..4274b41b 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index 60ef7b43..fcc9180f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.11-SNAPSHOT
+0.8.11
 pom
 
 Apache James :: Mime4j :: Project
@@ -52,7 +52,7 @@
 
scm:git:http://git-wip-us.apache.org/repos/asf/james-mime4j.git
 
scm:git:ssh://g...@github.com/apache/james-mime4j.git
 https://git-wip-us.apache.org/repos/asf/james-mime4j.git
-  HEAD
+  apache-mime4j-project-0.8.11
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index 84c5b817..d6d88730 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.11-SNAPSHOT
+0.8.11
 ../pom.xml
 
 


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-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



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

(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



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

(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 

(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



(james-project) branch master updated: JAMES-4012 Lenient MDN parsing for human readable part (#2057)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new a63d257f2c JAMES-4012 Lenient MDN parsing for human readable part 
(#2057)
a63d257f2c is described below

commit a63d257f2c87fb20ed30bbdc55ce1e49564eecc0
Author: Benoit TELLIER 
AuthorDate: Wed Feb 28 08:39:25 2024 +0100

JAMES-4012 Lenient MDN parsing for human readable part (#2057)
---
 mdn/src/main/java/org/apache/james/mdn/MDN.java| 65 +---
 .../test/java/org/apache/james/mdn/MDNTest.java| 88 --
 2 files changed, 117 insertions(+), 36 deletions(-)

diff --git a/mdn/src/main/java/org/apache/james/mdn/MDN.java 
b/mdn/src/main/java/org/apache/james/mdn/MDN.java
index 737ec1cb25..a884239628 100644
--- a/mdn/src/main/java/org/apache/james/mdn/MDN.java
+++ b/mdn/src/main/java/org/apache/james/mdn/MDN.java
@@ -87,7 +87,6 @@ public class MDN {
 public MDN build() {
 Preconditions.checkState(report != null);
 Preconditions.checkState(humanReadableText != null);
-Preconditions.checkState(!humanReadableText.trim().isEmpty());
 
 return new MDN(humanReadableText, report, message);
 }
@@ -130,15 +129,17 @@ public class MDN {
 throw new MDNParseBodyPartInvalidException("MDN Message must 
contain at least two parts");
 }
 try {
-var humanReadableTextEntity = bodyParts.get(0);
-return extractHumanReadableText(humanReadableTextEntity)
-.flatMap(humanReadableText -> 
extractMDNReport(bodyParts.get(1))
-.map(report -> MDN.builder()
+return extractMDNReport(bodyParts)
+.map(Throwing.function(report -> {
+String humanReadableText = 
extractHumanReadableText(bodyParts)
+.orElse("");
+return MDN.builder()
 .humanReadableText(humanReadableText)
 .report(report)
 .message(extractOriginalMessage(bodyParts))
-.build()))
-.orElseThrow(() -> new MDNParseException("MDN can not extract. 
Body part is invalid"));
+.build();
+}))
+.orElseThrow(() -> new MDNParseException("MDN can not extract. 
Report body part is invalid"));
 } catch (MDNParseException e) {
 throw e;
 } catch (Exception e) {
@@ -156,29 +157,37 @@ public class MDN {
 .map(Message.class::cast);
 }
 
-public static Optional extractHumanReadableText(Entity 
humanReadableTextEntity) throws IOException {
-if (humanReadableTextEntity.getMimeType().equals("text/plain")) {
-try (InputStream inputStream = ((SingleBody) 
humanReadableTextEntity.getBody()).getInputStream()) {
-return Optional.of(IOUtils.toString(inputStream, 
humanReadableTextEntity.getCharset()));
-}
-}
-return Optional.empty();
+public static Optional extractHumanReadableText(List 
entities) throws IOException {
+return entities.stream()
+.filter(entity -> entity.getMimeType().equals("text/plain"))
+.findAny()
+.map(Throwing.function(entity -> {
+try (InputStream inputStream = ((SingleBody) 
entity.getBody()).getInputStream()) {
+return IOUtils.toString(inputStream, entity.getCharset());
+}
+}).sneakyThrow());
 }
 
-public static Optional extractMDNReport(Entity reportEntity) {
-if (!reportEntity.getMimeType().startsWith(DISPOSITION_CONTENT_TYPE)) {
-return Optional.empty();
-}
-try (InputStream inputStream = ((SingleBody) 
reportEntity.getBody()).getInputStream()) {
-Try result = MDNReportParser.parse(inputStream, 
reportEntity.getCharset());
-if (result.isSuccess()) {
-return Optional.of(result.get());
-} else {
-return Optional.empty();
-}
-} catch (IOException e) {
-return Optional.empty();
-}
+public static Optional extractMDNReport(List entities) {
+return entities.stream()
+.filter(entity -> 
entity.getMimeType().startsWith(DISPOSITION_CONTENT_TYPE))
+.findAny()
+.flatMap(entity -> {
+try (InputStream inputStream = ((SingleBody) 
entity.getBody()).getInputStream()) {
+Try result = MDNReportParser.parse(inputStream, 
entity.getCharset());
+if (result.isSuccess()) {
+return Optional.of(resu

(james-jsieve) branch master updated: Bump org.apache.james:apache-mime4j-core from 0.8.7 to 0.8.10 (#28)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 9c9bb93  Bump org.apache.james:apache-mime4j-core from 0.8.7 to 0.8.10 
(#28)
9c9bb93 is described below

commit 9c9bb93bdefb56a40a129f9b216034cf5c0c0202
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Feb 28 07:30:29 2024 +0100

Bump org.apache.james:apache-mime4j-core from 0.8.7 to 0.8.10 (#28)

Bumps org.apache.james:apache-mime4j-core from 0.8.7 to 0.8.10.

---
updated-dependencies:
- dependency-name: org.apache.james:apache-mime4j-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 8344c9e..630eae6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
 3.0.0
 3.23.1
 32.0.0-jre
-0.8.7
+0.8.10
 2.0.3
 
 


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



(james-jdkim) branch master updated: Bump org.apache.james:apache-mime4j-core from 0.8.3 to 0.8.10 (#16)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 289b8ef  Bump org.apache.james:apache-mime4j-core from 0.8.3 to 0.8.10 
(#16)
289b8ef is described below

commit 289b8ef520a5c447122ddb451c1480d1fa2f734e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Wed Feb 28 07:30:20 2024 +0100

Bump org.apache.james:apache-mime4j-core from 0.8.3 to 0.8.10 (#16)

Bumps org.apache.james:apache-mime4j-core from 0.8.3 to 0.8.10.

---
updated-dependencies:
- dependency-name: org.apache.james:apache-mime4j-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d61d71c..561d413 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,7 @@
 
 
 
-0.8.3
+0.8.10
 1.15
 1.2
 3.4.1


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



(james-project) 01/01: [BUILD] RemoteDeliveryErrorHandlingTest was unstable

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

btellier pushed a commit to branch build-stability-27-02-20204
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 95b736e7825311e128e42818e41129e8268aa8c2
Author: Benoit TELLIER 
AuthorDate: Tue Feb 27 22:31:29 2024 +0100

[BUILD] RemoteDeliveryErrorHandlingTest was unstable

As we did not await task execution the seond mail repository
reprocessing could be triggered while the first one was not
even started which would go undetected.

Strictier awaits does the trick
---
 .../mailets/RemoteDeliveryErrorHandlingTest.java   | 22 ++
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git 
a/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
 
b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
index 96aab51829..10ef0704a6 100644
--- 
a/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
+++ 
b/server/mailet/remote-delivery-integration-testing/src/test/java/org/apache/james/mailets/RemoteDeliveryErrorHandlingTest.java
@@ -249,22 +249,36 @@ class RemoteDeliveryErrorHandlingTest {
 .isEqualTo(1));
 
 // When we retry and temporary problem is not solved
-given()
+Object taskId = given()
 .spec(webAdminApi)
 .param("action", "reprocess")
 .param("queue", MailQueueFactory.SPOOL.asString())
 .param("processor", TRANSPORT_PROCESSOR)
-.patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails");
+.patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails")
+.body()
+.jsonPath()
+.get("taskId");
+
+given()
+.spec(webAdminApi)
+.get("/tests/" + taskId + "/await");
+
 awaitAtMostOneMinute
 .untilAsserted(() -> 
assertThat(jamesServer.getProbe(MailRepositoryProbeImpl.class)
 
.getRepositoryMailCount(REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY))
 .isEqualTo(1));
-given()
+Object taskId2 = given()
 .spec(webAdminApi)
 .param("action", "reprocess")
 .param("queue", MailQueueFactory.SPOOL.asString())
 .param("processor", TRANSPORT_PROCESSOR)
-.patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails");
+.patch("/mailRepositories/" + 
REMOTE_DELIVERY_TEMPORARY_ERROR_REPOSITORY.getPath().urlEncoded() + "/mails")
+.body()
+.jsonPath()
+.get("taskId");
+given()
+.spec(webAdminApi)
+.get("/tests/" + taskId2 + "/await");
 
 // Then mail should be stored in permanent error repository
 awaitAtMostOneMinute


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



(james-project) branch build-stability-27-02-20204 created (now 95b736e782)

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

btellier pushed a change to branch build-stability-27-02-20204
in repository https://gitbox.apache.org/repos/asf/james-project.git


  at 95b736e782 [BUILD] RemoteDeliveryErrorHandlingTest was unstable

This branch includes the following new commits:

 new 95b736e782 [BUILD] RemoteDeliveryErrorHandlingTest was unstable

The 1 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.



-
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-3885 Webadmin route to change of username - support `force` parameter - do not require old user to exist (#2054)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 4f064d3ee3 JAMES-3885 Webadmin route to change of username - support 
`force` parameter  - do not require old user to exist (#2054)
4f064d3ee3 is described below

commit 4f064d3ee3b22a81e09c262df1524afc03eb6508
Author: vttran 
AuthorDate: Wed Feb 28 02:51:11 2024 +0700

JAMES-3885 Webadmin route to change of username - support `force` parameter 
 - do not require old user to exist (#2054)

- do not require old user to exist
---
 .../docs/modules/ROOT/pages/operate/webadmin.adoc  |  2 +-
 .../webadmin/routes/UsernameChangeRoutes.java  |  3 +-
 .../webadmin/routes/UsernameChangeRoutesTest.java  | 39 ++
 src/site/markdown/server/manage-webadmin.md|  2 +-
 4 files changed, 43 insertions(+), 3 deletions(-)

diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/operate/webadmin.adoc 
b/server/apps/distributed-app/docs/modules/ROOT/pages/operate/webadmin.adoc
index 0ff242d344..81ab4f0c00 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/operate/webadmin.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/operate/webadmin.adoc
@@ -683,7 +683,7 @@ Implemented migration steps are:
 Response codes:
 
 * 201: Success. Corresponding task id is returned.
-* 400: Error in the request. Details can be found in the reported error.
+* 400: Error in the request. Details can be found in the reported error. If 
you encounter the error "'oldUser' parameter should be an existing user," 
please note that this validation can be bypassed by specifying the `force` 
query parameter.
 
 The `fromStep` query parameter allows skipping previous steps, allowing to 
resume the username change from a failed step.
 
diff --git 
a/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/UsernameChangeRoutes.java
 
b/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/UsernameChangeRoutes.java
index f87dfecb51..b74fc450ea 100644
--- 
a/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/UsernameChangeRoutes.java
+++ 
b/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/UsernameChangeRoutes.java
@@ -42,6 +42,7 @@ import spark.Service;
 public class UsernameChangeRoutes implements Routes {
 private static final String OLD_USER_PARAM = "oldUser";
 private static final String NEW_USER_PARAM = "newUser";
+private static final String FORCE_PARAM = "force";
 private static final String ROOT_PATH = "/users/:" + OLD_USER_PARAM + 
"/rename/:" + NEW_USER_PARAM;
 private static final TaskRegistrationKey RENAME = 
TaskRegistrationKey.of("rename");
 
@@ -73,7 +74,7 @@ public class UsernameChangeRoutes implements Routes {
 Username oldUser = Username.of(request.params(OLD_USER_PARAM));
 Username newUser = Username.of(request.params(NEW_USER_PARAM));
 
-Preconditions.checkArgument(usersRepository.contains(oldUser), 
"'oldUser' parameter should be an existing user");
+Preconditions.checkArgument(request.queryParams(FORCE_PARAM) != 
null || usersRepository.contains(oldUser), "'oldUser' parameter should be an 
existing user");
 Preconditions.checkArgument(usersRepository.contains(newUser), 
"'newUser' parameter should be an existing user");
 
 Optional fromStep = 
Optional.ofNullable(request.queryParams("fromStep")).map(StepName::new);
diff --git 
a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/UsernameChangeRoutesTest.java
 
b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/UsernameChangeRoutesTest.java
index 26ec2cf710..34d95957ac 100644
--- 
a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/UsernameChangeRoutesTest.java
+++ 
b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/UsernameChangeRoutesTest.java
@@ -22,6 +22,7 @@ package org.apache.james.webadmin.routes;
 import static io.restassured.RestAssured.given;
 import static io.restassured.RestAssured.with;
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.hamcrest.Matchers.notNullValue;
 import static org.hamcrest.core.Is.is;
 import static org.mockito.Mockito.mock;
 
@@ -191,6 +192,44 @@ class UsernameChangeRoutesTest {
 .body("message", Matchers.is("Invalid arguments supplied in 
the user request"))
 .body("details", Matchers.is("'oldUser' parameter should be an 
existing user"));
  

(james-project) branch master updated: MailSizeEsmtpExtension - change log level when Quota exceeded (#2053)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 4f38296f28 MailSizeEsmtpExtension - change log level when Quota 
exceeded (#2053)
4f38296f28 is described below

commit 4f38296f2851d2de68006281d26eb0938e6ede1d
Author: vttran 
AuthorDate: Tue Feb 27 21:24:59 2024 +0700

MailSizeEsmtpExtension - change log level when Quota exceeded (#2053)
---
 .../james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java   | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
index 9de63f01ce..a2f90e9d67 100644
--- 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
+++ 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
@@ -117,8 +117,8 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 long maxMessageSize = session.getConfiguration().getMaxMessageSize();
 if ((maxMessageSize > 0) && (size > maxMessageSize)) {
 // Let the client know that the size limit has been hit.
-LOGGER.error("Rejected message from {} to {} of size {} exceeding 
system maximum message size of {} based on SIZE option.",
-tempSender,
+LOGGER.info("Rejected message from {} to {} of size {} exceeding 
system maximum message size of {} based on SIZE option.",
+tempSender.asPrettyString(),
 session.getRemoteAddress().getAddress().getHostAddress(),
 size,
 maxMessageSize);
@@ -178,7 +178,9 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 public HookResult onMessage(SMTPSession session, MailEnvelope mail) {
 Optional failed = session.getAttachment(MESG_FAILED, 
State.Transaction);
 if (failed.orElse(false)) {
-LOGGER.error("Rejected message from {} from {} exceeding system 
maximum message size of {}", session.getAttachment(SMTPSession.SENDER, 
State.Transaction), session.getRemoteAddress().getAddress().getHostAddress(), 
session.getConfiguration().getMaxMessageSize());
+LOGGER.info("Rejected message from {} from {} exceeding system 
maximum message size of {}",
+session.getAttachment(SMTPSession.SENDER, 
State.Transaction).orElse(MaybeSender.nullSender()).asPrettyString(),
+session.getRemoteAddress().getAddress().getHostAddress(), 
session.getConfiguration().getMaxMessageSize());
 return QUOTA_EXCEEDED;
 } else {
 return HookResult.DECLINED;


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



(james-mime4j) branch master updated: [RELEASE] Rollover to 0.8.10 (#93)

2024-02-26 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-mime4j.git


The following commit(s) were added to refs/heads/master by this push:
 new 597db871 [RELEASE] Rollover to 0.8.10 (#93)
597db871 is described below

commit 597db871705f2083041db39eb207cbb85ef533b4
Author: Benoit TELLIER 
AuthorDate: Tue Feb 27 07:34:25 2024 +0100

[RELEASE] Rollover to 0.8.10 (#93)
---
 CHANGELOG.md | 2 +-
 README.adoc  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b491bade..8fc56e49 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this 
file.
 
 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
 
-## [UNRELEASED]
+## [0.8.10] - 2024-01-09
 
 ## [0.8.10] - 2024-02-22
 
diff --git a/README.adoc b/README.adoc
index 81e310ba..71f191c6 100644
--- a/README.adoc
+++ b/README.adoc
@@ -5,7 +5,7 @@ 
image:https://img.shields.io/badge/Join%20us-Mailing%20lists-purple.svg[link="ht
 
link:https://gitter.im/apache/james-project[image:https://badges.gitter.im/apache/james-project.svg[Join
 the chat at link:https://gitter.im/apache/james-project]]
 
image:https://img.shields.io/badge/CI-Jenkins-blue.svg[link="https://ci-builds.apache.org/job/james/job/ApacheJames-Mime4J/;]
 
image:https://img.shields.io/badge/Documentation-green.svg[link="https://james.apache.org/mime4j/index.html;]
-image:https://img.shields.io/badge/Downloads-0.8.9-yellow.svg[link="https://james.apache.org/download.cgi#Apache_Mime4J;]
+image:https://img.shields.io/badge/Downloads-0.8.10-yellow.svg[link="https://james.apache.org/download.cgi#Apache_Mime4J;]
 
image:https://img.shields.io/badge/Tickets-JIRA-blue.svg[link="https://issues.apache.org/jira/projects/MIME4J/issues;]
 
image:https://img.shields.io/badge/License-ApacheV2-orange.svg[link="https://www.apache.org/licenses/;]
 
image:https://img.shields.io/badge/Latests-news-red.svg[link="https://james.apache.org/index.html#posts;]
@@ -55,7 +55,7 @@ Add this maven dependency to import MIME4J core:
 
 org.apache.james
 apache-mime4j-core
-0.8.9
+0.8.10
 
 
 
@@ -65,7 +65,7 @@ Add this maven dependency to import MIME4J dom:
 
 org.apache.james
 apache-mime4j-dom
-0.8.9
+0.8.10
 
 
 


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



(james-project) branch compress-cves-2 updated (26408466b3 -> 25de96ea4f)

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

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


omit 26408466b3 [UPDATE] commons-compress 1.24.0 -> 1.26.0
 add 8a9a9d38de [SITE] Blog post for 3.7.5 release
 add fd767d9da5 [SITE] Blog post for 3.8.1 release
 add e9232deaac [SITE] Downloads for 3.8.1 James release
 add 924ce3c29c [SITE] Downloads for 3.7.5 James release
 add f8cd3b0596 [SITE] Downloads for 0.8.10 MIME4J release
 add 701f46bdac [SITE] s/3.8.0/3.8.1
 add d40376550c [SITE] Release notes
 add b0ad23fb06 [SITE] Update upgrade instructions
 add 9cb4bcf949 [SITE] Mime4J 0.8.10 release
 add 169ae5b8e8 JMAP - EmailSubmission/set - Should not invoke 
onSuccessDestroyEmail/onSuccessUpdateEmail when not created (#2041)
 add 232adec907 [FIX] MailReceptionCheck do not send the mail before we 
actively listen to the results (#2038)
 add 9ac709336e [CHANGELOG] Mention 3.7.5 and 3.8.1 releases (#2045)
 add 01f39e7ba7 Document new CVEs (#2046)
 add 3897ad9b99 Update site plugin
 add 7fd6b27741 Update rat plugin
 add 487d9faeea [DOCUMENTATION] CVE-2023-51518 CVE-2023-51747 
CVE-2024-21742 (#2047)
 add 915bcc33f2 JAMES-3997 Netty backpressure for IMAP FETCH (#2031)
 add 667c27e6b9 JAMES-4010 Do not index body (#2018)
 add 7a300ed824 JAMES-4009 StripAttachment should explicitly handle 
duplicates
 add aee6550277 JAMES-3995 Optimize Email/get
 add 66426a8005 JAMES-4002 AES blob store tuning to reduce memory pressure 
(#2021)
 add a2583d4e8a JAMES-4008 JMAP - Email/set - Should be able to save a 
draft with invalid email address (#2040)
 add ba34e7242c JAMES-4007 ImapChannelUpstreamHandler should always cleanup 
INBOUND message
 add 8b9cbf1385 JAMES-4007 Prevent channel inactivity to clear literal 
while IMAP APPEND is in progress
 add 25de96ea4f [UPDATE] commons-compress 1.24.0 -> 1.26.0

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (26408466b3)
\
 N -- N -- N   refs/heads/compress-cves-2 (25de96ea4f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

No new revisions were added by this update.

Summary of changes:
 CHANGELOG.md   |  16 +-
 docs/antora.yml|   2 +-
 .../{IndexHeaders.java => IndexBody.java}  |   2 +-
 .../opensearch/OpenSearchMailboxConfiguration.java |  37 +++-
 .../OpenSearchListeningMessageSearchIndex.java |  12 +-
 .../mailbox/opensearch/json/IndexableMessage.java  |  17 +-
 .../opensearch/json/MessageToOpenSearchJson.java   |  14 +-
 .../mailbox/opensearch/json/MimePartParser.java|  10 +-
 .../OpenSearchMailboxConfigurationTest.java|  97 ++---
 ...a => OpenSearchNoIndexBodyIntegrationTest.java} | 104 +
 .../store/search/ListeningMessageSearchIndex.java  |  10 +-
 .../james/transport/mailets/StripAttachment.java   |  25 ++-
 .../transport/mailets/StripAttachmentTest.java |  96 ++---
 pom.xml|   4 +-
 .../apache/james/imap/api/process/ImapSession.java |  13 ++
 .../james/imap/processor/fetch/FetchProcessor.java |  66 +-
 server/apps/distributed-app/docs/antora.yml|   2 +-
 .../modules/ROOT/pages/configure/blobstore.adoc|  16 ++
 .../modules/ROOT/pages/configure/opensearch.adoc   |   3 +
 .../docs/modules/ROOT/pages/operate/security.adoc  |  35 +++
 .../docs/modules/ROOT/pages/run/k8s-values.adoc|   2 +-
 .../docs/modules/ROOT/pages/run/run-docker.adoc|   4 +-
 .../sample-configuration/jvm.properties|  12 ++
 server/blob/blob-aes/pom.xml   |   4 +
 .../org/apache/james/blob/aes/AESBlobStoreDAO.java |  76 ++-
 .../org/apache/james/blob/api/BlobStoreDAO.java|  26 +++
 .../blob/objectstorage/aws/S3BlobStoreDAO.java |  10 +
 .../james/healthcheck/MailReceptionCheck.java  |   7 +-
 .../org/apache/james/jmap/api/model/Preview.java   |   2 +
 .../AvoidBinaryBodyBufferingBodyFactory.java   |  98 +++--
 .../apache/james/jmap/mime4j/FakeBinaryBody.java   |  48 +++--
 .../org/apache/james/jmap/mime4j/SizeUtils.java| 152 +
 .../ComputeMessageFastViewProjectionListener.java  |   4 +-
 .../src/main/resources/eml/nested2.eml |  77 +++
 .../rfc8621/contract/EmailGetMethodContract.s

(james-project) 01/02: JAMES-4007 ImapChannelUpstreamHandler should always cleanup INBOUND message

2024-02-25 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 ba34e7242c95fa215b871a2af133e75ee14952ad
Author: Benoit TELLIER 
AuthorDate: Wed Feb 21 14:21:22 2024 +0100

JAMES-4007 ImapChannelUpstreamHandler should always cleanup INBOUND message

It needs to account for unexecuted messages, rejected messages,
cancelled subscriptions.
---
 .../apache/james/imapserver/netty/ImapChannelUpstreamHandler.java | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
index c0ef774c19..4e9e5985fd 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapChannelUpstreamHandler.java
@@ -405,9 +405,6 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 }
 if (signal.isOnComplete() || signal.isOnError()) {
 afterIDLEUponProcessing(ctx);
-if (message instanceof Closeable) {
-((Closeable) message).close();
-}
 }
 if (signal.hasError()) {
 ctx.fireExceptionCaught(signal.getThrowable());
@@ -419,6 +416,11 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 .contextWrite(ReactorUtils.context("imap", mdc(session))), 
message)
 // Manage throttling errors
 .doOnError(ctx::fireExceptionCaught)
+.doFinally(Throwing.consumer(any -> {
+if (message instanceof Closeable) {
+((Closeable) message).close();
+}
+}))
 .subscribe();
 disposableAttribute.set(disposable);
 }


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



(james-project) 02/02: JAMES-4007 Prevent channel inactivity to clear literal while IMAP APPEND is in progress

2024-02-25 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 8b9cbf138555b9c3c5027f9a0872323da511486a
Author: Benoit TELLIER 
AuthorDate: Wed Feb 21 14:28:29 2024 +0100

JAMES-4007 Prevent channel inactivity to clear literal while IMAP APPEND is 
in progress
---
 .../apache/james/imapserver/netty/ImapRequestFrameDecoder.java| 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 4adab34f09..3e3e26d043 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
@@ -221,7 +221,12 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 
 try {
 parseImapMessage(ctx, null, attachment, 
Pair.of(reader, size), readerIndex)
-.ifPresent(ctx::fireChannelRead);
+.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);
 }
@@ -237,6 +242,7 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
 
 });
 attachment.put(SUBSCRIPTION, (Disposable) () -> {
+// Clear the file if the connection is reset while buffering 
the litteral.
 subscribe.dispose();
 fileChunkConsumer.discard();
 });


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



  1   2   3   4   5   6   7   8   9   10   >