(james-project) branch master updated (6a48b9d2cf -> 087a257230)

2024-02-08 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 6a48b9d2cf JAMES-2372 Fixing multiple accounts with Fetchmail (#1951)
 new b14a35d162 JAMES-3981 Lower log level of closed connections
 new 6fdf498793 JAMES-3981 Warn upon invalid RCPT
 new 087a257230 JAMES-3981 Remove double logs upon closed channels

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:
 .../apache/james/protocols/netty/BasicChannelInboundHandler.java  | 7 ---
 .../protocols/smtp/core/fastfail/AbstractValidRcptHandler.java| 7 +++
 .../apache/james/imapserver/netty/ImapChannelUpstreamHandler.java | 8 +++-
 3 files changed, 18 insertions(+), 4 deletions(-)


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



(james-project) 03/03: JAMES-3981 Remove double logs upon closed channels

2024-02-08 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 087a257230c9155979c84ef47e30e35f86bf36e7
Author: Benoit TELLIER 
AuthorDate: Tue Feb 6 23:47:54 2024 +0100

JAMES-3981 Remove double logs upon closed channels

10:38:19.395 [INFO ] o.a.j.p.n.BasicChannelUpstreamHandler - Connection 
closed for 169.73.162.80
10:38:19.397 [INFO ] o.a.j.p.n.BasicChannelUpstreamHandler - Unable to 
process request
java.nio.channels.ClosedChannelException: null
at 
org.jboss.netty.handler.stream.ChunkedWriteHandler.discard(ChunkedWriteHandler.java:168)
at 
org.jboss.netty.handler.stream.ChunkedWriteHandler.flush(ChunkedWriteHandler.java:192)
at 
org.jboss.netty.handler.stream.ChunkedWriteHandler.handleDownstream(ChunkedWriteHandler.java:121)
at 
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
at 
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784)
at 
org.jboss.netty.handler.execution.ExecutionHandler.handleDownstream(ExecutionHandler.java:176)
at 
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
at 
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
at org.jboss.netty.channel.Channels.write(Channels.java:704)
at org.jboss.netty.channel.Channels.write(Channels.java:671)
at 
org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:347)
at 
org.apache.james.protocols.netty.NettyProtocolTransport.writeToClient(NettyProtocolTransport.java:104)
at 
org.apache.james.protocols.api.AbstractProtocolTransport.writeResponseToClient(AbstractProtocolTransport.java:145)
at 
org.apache.james.protocols.api.AbstractProtocolTransport.writeResponse(AbstractProtocolTransport.java:64)
at 
org.apache.james.protocols.netty.BasicChannelUpstreamHandler.channelConnected(BasicChannelUpstreamHandler.java:111)
at 
org.apache.james.smtpserver.netty.SMTPChannelUpstreamHandler.channelConnected(SMTPChannelUpstreamHandler.java:54)
at 
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:100)
---
 .../apache/james/protocols/netty/BasicChannelInboundHandler.java| 6 ++
 .../apache/james/imapserver/netty/ImapChannelUpstreamHandler.java   | 6 ++
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
index 92762d8157..076bda1944 100644
--- 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
+++ 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
@@ -268,11 +268,9 @@ public class BasicChannelInboundHandler extends 
ChannelInboundHandlerAdapter imp
 }
 transport.writeResponse(Response.DISCONNECT, session);
 }
-if (cause instanceof ClosedChannelException) {
-LOGGER.info("Channel closed before we could send in flight 
messages to the users (ClosedChannelException): {}", cause.getMessage());
-} else if (cause instanceof SocketException) {
+if (cause instanceof SocketException) {
 LOGGER.info("Socket exception encountered: {}", 
cause.getMessage());
-} else {
+} else if (!(cause instanceof ClosedChannelException)) {
 LOGGER.error("Unable to process request", cause);
 }
 ctx.close();
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 fb76cde4fb..13b7840122 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
@@ -272,11 +272,9 @@ public class ImapChannelUpstreamHandler extends 
ChannelInboundHandlerAdapter imp
 @Override
 public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) 
throws Exception {
 try (Closeable closeable = mdc(ctx).build()) {
-if (cause instanceof ClosedChannelException) {
-LOGGER.info("Channel was closed");
-} e

(james-project) branch master updated: [Fix] Fix tag for Minio testing image (#1978)

2024-02-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 aeb9456679 [Fix] Fix tag for Minio testing image (#1978)
aeb9456679 is described below

commit aeb9456679baef23c8b360370988551d16d25738
Author: Rene Cordier 
AuthorDate: Mon Feb 5 22:45:20 2024 +0700

[Fix] Fix tag for Minio testing image (#1978)

breaks the build in a sneaky way everytime the API on Minio changes slightly
---
 .../java/org/apache/james/blob/objectstorage/aws/S3MinioTest.java| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/server/blob/blob-s3/src/test/java/org/apache/james/blob/objectstorage/aws/S3MinioTest.java
 
b/server/blob/blob-s3/src/test/java/org/apache/james/blob/objectstorage/aws/S3MinioTest.java
index f85c656e03..e6f12dc638 100644
--- 
a/server/blob/blob-s3/src/test/java/org/apache/james/blob/objectstorage/aws/S3MinioTest.java
+++ 
b/server/blob/blob-s3/src/test/java/org/apache/james/blob/objectstorage/aws/S3MinioTest.java
@@ -51,11 +51,14 @@ import software.amazon.awssdk.services.s3.model.S3Exception;
 @Testcontainers
 public class S3MinioTest implements BlobStoreDAOContract {
 
+private static final String MINIO_IMAGE = "quay.io/minio/minio";
+private static final String MINIO_TAG = "RELEASE.2024-01-29T03-56-32Z";
+private static final String MINIO_IMAGE_FULL = MINIO_IMAGE + ":" + 
MINIO_TAG;
 private static final int MINIO_PORT = 9000;
 private static S3BlobStoreDAO testee;
 
 @Container
-private static final GenericContainer minioContainer = new 
GenericContainer<>("quay.io/minio/minio")
+private static final GenericContainer minioContainer = new 
GenericContainer<>(MINIO_IMAGE_FULL)
 .withExposedPorts(MINIO_PORT)
 .withEnv("MINIO_ROOT_USER", ACCESS_KEY_ID)
 .withEnv("MINIO_ROOT_PASSWORD", SECRET_ACCESS_KEY)


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



(james-mime4j) branch master updated: DefaultBodyDescriptorBuilder: Allow to customize standard charset (#94)

2024-01-31 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 ac81a5d4 DefaultBodyDescriptorBuilder: Allow to customize standard 
charset (#94)
ac81a5d4 is described below

commit ac81a5d45204bfdbfc43cc1eef73ae3238f53cee
Author: Benoit TELLIER 
AuthorDate: Thu Feb 1 07:35:27 2024 +0100

DefaultBodyDescriptorBuilder: Allow to customize standard charset (#94)
---
 .../james/mime4j/message/DefaultBodyDescriptorBuilder.java  | 13 +++--
 .../james/mime4j/message/MaximalBodyDescriptorTest.java |  8 
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git 
a/dom/src/main/java/org/apache/james/mime4j/message/DefaultBodyDescriptorBuilder.java
 
b/dom/src/main/java/org/apache/james/mime4j/message/DefaultBodyDescriptorBuilder.java
index f44cea99..e0cd112a 100644
--- 
a/dom/src/main/java/org/apache/james/mime4j/message/DefaultBodyDescriptorBuilder.java
+++ 
b/dom/src/main/java/org/apache/james/mime4j/message/DefaultBodyDescriptorBuilder.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.mime4j.message;
 
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -56,6 +58,7 @@ public class DefaultBodyDescriptorBuilder implements 
BodyDescriptorBuilder {
 private final DecodeMonitor monitor;
 private final FieldParser fieldParser;
 private final Map fields;
+private Charset defaultCharset = StandardCharsets.US_ASCII;
 
 /**
  * Creates a new root BodyDescriptor instance.
@@ -82,6 +85,10 @@ public class DefaultBodyDescriptorBuilder implements 
BodyDescriptorBuilder {
 this.fields = new HashMap();
 }
 
+public void setDefaultCharset(Charset charset) {
+this.defaultCharset = charset;
+}
+
 public void reset() {
 fields.clear();
 }
@@ -128,7 +135,7 @@ public class DefaultBodyDescriptorBuilder implements 
BodyDescriptorBuilder {
 }
 }
 if (actualCharset == null && MEDIA_TYPE_TEXT.equals(actualMediaType)) {
-actualCharset = US_ASCII;
+actualCharset = defaultCharset.name();
 }
 if (!MimeUtil.isMultipart(actualMimeType)) {
 actualBoundary = null;
@@ -150,7 +157,9 @@ public class DefaultBodyDescriptorBuilder implements 
BodyDescriptorBuilder {
 actualMimeType = DEFAULT_MIME_TYPE;
 }
 }
-return new DefaultBodyDescriptorBuilder(actualMimeType, fieldParser, 
monitor);
+DefaultBodyDescriptorBuilder child = new 
DefaultBodyDescriptorBuilder(actualMimeType, fieldParser, monitor);
+child.setDefaultCharset(defaultCharset);
+return child;
 }
 
 }
diff --git 
a/dom/src/test/java/org/apache/james/mime4j/message/MaximalBodyDescriptorTest.java
 
b/dom/src/test/java/org/apache/james/mime4j/message/MaximalBodyDescriptorTest.java
index 76ffa7ac..7591b05f 100644
--- 
a/dom/src/test/java/org/apache/james/mime4j/message/MaximalBodyDescriptorTest.java
+++ 
b/dom/src/test/java/org/apache/james/mime4j/message/MaximalBodyDescriptorTest.java
@@ -126,17 +126,17 @@ public class MaximalBodyDescriptorTest {
  * Test charset.
  */
 BodyDescriptor bd = builder.build();
-Assert.assertEquals("us-ascii", bd.getCharset());
+Assert.assertEquals("US-ASCII", bd.getCharset());
 builder.addField(new RawField("Content-Type ", "text/type; 
charset=ISO-8859-1"));
 bd = builder.build();
 Assert.assertEquals("ISO-8859-1", bd.getCharset());
 
 builder.reset();
 bd = builder.build();
-Assert.assertEquals("us-ascii", bd.getCharset());
+Assert.assertEquals("US-ASCII", bd.getCharset());
 builder.addField(new RawField("Content-Type ", "text/type"));
 bd = builder.build();
-Assert.assertEquals("us-ascii", bd.getCharset());
+Assert.assertEquals("US-ASCII", bd.getCharset());
 
 /*
  * Test boundary.
@@ -189,7 +189,7 @@ public class MaximalBodyDescriptorTest {
 BodyDescriptorBuilder builder = new DefaultBodyDescriptorBuilder();
 builder.addField(new RawField("To", "m...@example.org"));
 BodyDescriptor bd = builder.build();
-Assert.assertEquals("us-ascii", bd.getCharset());
+Assert.assertEquals("US-ASCII", bd.getCharset());
 }
 
 @Test


-
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: JAMES-3976 Email/import should accept empty keywords (#1962)

2024-01-31 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 c5863e50d2 JAMES-3976 Email/import should accept empty keywords (#1962)
c5863e50d2 is described below

commit c5863e50d2a239f56a577f8101c5e92c18315ce5
Author: Benoit TELLIER 
AuthorDate: Wed Jan 31 16:37:51 2024 +0100

JAMES-3976 Email/import should accept empty keywords (#1962)
---
 .../rfc8621/contract/EmailImportContract.scala | 365 +
 .../rfc8621/contract/EmailSetMethodContract.scala  |  51 +++
 .../org/apache/james/jmap/mail/EmailImport.scala   |   9 +-
 .../org/apache/james/jmap/mail/Keywords.scala  |   4 +-
 .../jmap/method/EmailSetCreatePerformer.scala  |   5 +-
 5 files changed, 427 insertions(+), 7 deletions(-)

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/EmailImportContract.scala
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala
index a10cdb4132..539cb0dc62 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailImportContract.scala
@@ -268,6 +268,371 @@ trait EmailImportContract {
  |]""".stripMargin)
   }
 
+  @Test
+  def importShouldSucceedWhenEmptyKeyword(server: GuiceJamesServer): Unit = {
+val bobPath = MailboxPath.inbox(BOB)
+val mailboxId: MailboxId = 
server.getProbe(classOf[MailboxProbeImpl]).createMailbox(bobPath)
+val receivedAt = ZonedDateTime.now().minusDays(1)
+
+val uploadResponse: String = `given`
+  .basePath("")
+  .header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
+  .body(ClassLoader.getSystemResourceAsStream("eml/alternative.eml"))
+.when
+  .post(s"/upload/$ACCOUNT_ID")
+.`then`
+  .statusCode(SC_CREATED)
+  .extract
+  .body
+  .asString
+
+val blobId: String = 
Json.parse(uploadResponse).\("blobId").get.asInstanceOf[JsString].value
+
+val receivedAtString = UTCDate(receivedAt).asUTC.format(UTC_DATE_FORMAT)
+val response = `given`
+  .header(ACCEPT.toString, ACCEPT_RFC8621_VERSION_HEADER)
+  .body(s"""{
+  |  "using": ["urn:ietf:params:jmap:core", 
"urn:ietf:params:jmap:mail"],
+  |  "methodCalls": [
+  |["Email/import",
+  |  {
+  |"accountId": "$ACCOUNT_ID",
+  |"emails": {
+  |   "C42": {
+  | "blobId": "$blobId",
+  | "mailboxIds": {
+  |   "${mailboxId.serialize()}": true
+  | },
+  | "keywords": {},
+  | "receivedAt": "$receivedAtString"
+  |   }
+  | }
+  |  },
+  |  "c1"],
+  |["Email/get",
+  | {
+  |   "accountId": "$ACCOUNT_ID",
+  |   "ids": ["#C42"],
+  |   "properties": ["keywords", "mailboxIds", "receivedAt", 
"subject", "size", "bodyValues", "htmlBody"],
+  |   "fetchHTMLBodyValues": true
+  | },
+  | "c2"]
+  |  ]
+  |}""".stripMargin)
+.when
+  .post
+.`then`
+  .statusCode(SC_OK)
+  .contentType(JSON)
+  .extract
+  .body
+  .asString
+
+val responseAsJson = Json.parse(response)
+  .\("methodResponses")
+  .\(0).\(1)
+  .\("created")
+  .\("C42")
+
+val messageId = responseAsJson
+  .\("id")
+  .get.asInstanceOf[JsString].value
+
+assertThatJson(response)
+  .whenIgnoringPaths("methodResponses[0][1].oldState", 
"methodResponses[0][1].newState", "methodResponses[1][1].state")
+  .inPath("methodResponses")
+  .isEqualTo(
+  s"""[
+ |["Email/import"

(james-project) branch master updated: JAMES-3909 Deleting userdata: Bypass user existence check (#1938)

2024-01-31 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 d910ab53e0 JAMES-3909 Deleting userdata: Bypass user existence check 
(#1938)
d910ab53e0 is described below

commit d910ab53e03727aed80595f44f72e2ea740697eb
Author: Benoit TELLIER 
AuthorDate: Wed Jan 31 15:57:40 2024 +0100

JAMES-3909 Deleting userdata: Bypass user existence check (#1938)
---
 .../apache/james/webadmin/routes/DeleteUserDataRoutes.java|  2 +-
 .../james/webadmin/routes/DeleteUserDataRoutesTest.java   | 11 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/DeleteUserDataRoutes.java
 
b/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/DeleteUserDataRoutes.java
index f581ed7127..a82d417205 100644
--- 
a/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/DeleteUserDataRoutes.java
+++ 
b/server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/DeleteUserDataRoutes.java
@@ -73,7 +73,7 @@ public class DeleteUserDataRoutes implements Routes {
 .register(DELETE_USER_DATA, request -> {
 Username username = 
Username.of(request.params(USER_PATH_PARAM));
 
-
Preconditions.checkArgument(usersRepository.contains(username), "'username' 
parameter should be an existing user");
+Preconditions.checkArgument(request.queryParams("force") != 
null || usersRepository.contains(username), "'username' 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/DeleteUserDataRoutesTest.java
 
b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DeleteUserDataRoutesTest.java
index f3939320e1..19823d8f58 100644
--- 
a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DeleteUserDataRoutesTest.java
+++ 
b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/DeleteUserDataRoutesTest.java
@@ -184,6 +184,17 @@ class DeleteUserDataRoutesTest {
 .body("message", Matchers.is("Invalid arguments supplied in 
the user request"))
 .body("details", Matchers.is("'username' parameter should be 
an existing user"));
 }
+
+@Test
+void shouldAcceptUnknownUserWhenForce() {
+given()
+.queryParam("action", "deleteData")
+.queryParam("force")
+.when()
+.post("/users/unkn...@domain.tld")
+.then()
+.statusCode(HttpStatus.CREATED_201);
+}
 }
 
 @Nested


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



(james-project) branch 3.8.x updated: [FIX] IMAP FETCH was pulling all messages into memory (#1965)

2024-01-31 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 988afdc201 [FIX] IMAP FETCH was pulling all messages into memory 
(#1965)
988afdc201 is described below

commit 988afdc201ea97072ee14cb6d9e9878d6131210e
Author: Benoit TELLIER 
AuthorDate: Wed Jan 31 15:29:15 2024 +0100

[FIX] IMAP FETCH was pulling all messages into memory (#1965)
---
 .../james/mailbox/cassandra/mail/CassandraMessageIdDAO.java   | 8 
 .../james/mailbox/cassandra/mail/CassandraMessageMapper.java  | 5 ++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAO.java
 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAO.java
index 540a33939b..3db4f7c2d5 100644
--- 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAO.java
+++ 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdDAO.java
@@ -78,6 +78,7 @@ import com.datastax.oss.driver.api.core.cql.BoundStatement;
 import com.datastax.oss.driver.api.core.cql.BoundStatementBuilder;
 import com.datastax.oss.driver.api.core.cql.PreparedStatement;
 import com.datastax.oss.driver.api.core.cql.Row;
+import com.datastax.oss.driver.api.core.metadata.schema.ClusteringOrder;
 import com.datastax.oss.driver.api.core.type.codec.TypeCodecs;
 import com.datastax.oss.driver.api.querybuilder.QueryBuilder;
 import com.google.common.annotations.VisibleForTesting;
@@ -211,6 +212,7 @@ public class CassandraMessageIdDAO {
 return session.prepare(QueryBuilder.selectFrom(TABLE_NAME)
 .all()
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
@@ -218,6 +220,7 @@ public class CassandraMessageIdDAO {
 return session.prepare(QueryBuilder.selectFrom(TABLE_NAME)
 .column(IMAP_UID)
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
@@ -226,6 +229,7 @@ public class CassandraMessageIdDAO {
 .all()
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)))
 .limit(bindMarker(LIMIT))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
@@ -239,6 +243,7 @@ public class CassandraMessageIdDAO {
 .all()
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)),
 column(IMAP_UID).isGreaterThanOrEqualTo(bindMarker(IMAP_UID)))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
@@ -248,6 +253,7 @@ public class CassandraMessageIdDAO {
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)),
 column(IMAP_UID).isGreaterThanOrEqualTo(bindMarker(IMAP_UID)))
 .limit(bindMarker(LIMIT))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
@@ -257,6 +263,7 @@ public class CassandraMessageIdDAO {
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)),
 
column(IMAP_UID).isGreaterThanOrEqualTo(bindMarker(IMAP_UID_GTE)),
 column(IMAP_UID).isLessThanOrEqualTo(bindMarker(IMAP_UID_LTE)))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
@@ -266,6 +273,7 @@ public class CassandraMessageIdDAO {
 .where(column(MAILBOX_ID).isEqualTo(bindMarker(MAILBOX_ID)),
 
column(IMAP_UID).isGreaterThanOrEqualTo(bindMarker(IMAP_UID_GTE)),
 column(IMAP_UID).isLessThanOrEqualTo(bindMarker(IMAP_UID_LTE)))
+.orderBy(IMAP_UID, ClusteringOrder.ASC)
 .build());
 }
 
diff --git 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
index 04ed2cab13..7da151a5d5 100644
--- 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
+++ 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java
@@ -28,7 +28,6 @@ import java.security.SecureRandom;
 import java.time.Clock;
 import java.time.Duration;
 import java.util.Collection;
-import java.util.Comparator;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
@@ -260,9 +259,9 @@ public class CassandraMessageMapper implements 
MessageMapper {
 CassandraId mailboxId = (CassandraId) mailbox.getMailboxId();
 
 Limit limit = Limit.from(limitAsInt);
+int concurrency

(james-project) branch master updated (403b958ebe -> c691fec744)

2024-01-31 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 403b958ebe Revert "[UPDATE] BouncyCastle 1.70 -> 1.77 (fixes multiple 
minor CVEs)"
 add c691fec744 [FIX] IMAP FETCH was pulling all messages into memory

No new revisions were added by this update.

Summary of changes:
 .../cassandra/mail/CassandraMessageIdDAO.java  |  8 
 .../cassandra/mail/CassandraMessageMapper.java |  5 ++---
 .../cassandra/CassandraMailboxManagerProvider.java |  3 ++-
 .../cassandra/CassandraMailboxManagerTest.java | 24 --
 .../TestCassandraMailboxSessionMapperFactory.java  |  9 +---
 5 files changed, 35 insertions(+), 14 deletions(-)


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



(james-project) 01/02: Revert "[UPDATE] Update spark version: Jetty update"

2024-01-30 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 57fddebdd599d3b9cb3eba353f26675503374d4b
Author: Benoit TELLIER 
AuthorDate: Fri Jan 26 16:54:28 2024 +0100

Revert "[UPDATE] Update spark version: Jetty update"

This reverts commit 69e45e4ddf164cff38764bcc4860b47b1274abb1.
---
 pom.xml| 10 +-
 server/container/core/pom.xml  |  2 +-
 server/container/filesystem-api/pom.xml|  2 +-
 server/container/spring/pom.xml|  2 +-
 server/protocols/webadmin/webadmin-core/pom.xml|  8 
 .../org/apache/james/webadmin/dropwizard/MetricsRoutes.java|  4 ++--
 .../apache/james/webadmin/routes/MailRepositoriesRoutes.java   |  2 +-
 7 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 037ef9b666..8f67121499 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2210,11 +2210,6 @@
 guice-assistedinject
 ${guice.version}
 
-
-com.intellisrc
-spark-core
-2.9.4-unofficial-5
-
 
 com.jayway.jsonpath
 json-path
@@ -2235,6 +2230,11 @@
 amqp-client
 5.20.0
 
+
+com.sparkjava
+spark-core
+2.9.4
+
 
 com.sun.activation
 javax.activation
diff --git a/server/container/core/pom.xml b/server/container/core/pom.xml
index 09dda08f72..6e176893a5 100644
--- a/server/container/core/pom.xml
+++ b/server/container/core/pom.xml
@@ -86,7 +86,7 @@
 guava
 
 
-com.intellisrc
+com.sparkjava
 spark-core
 test
 
diff --git a/server/container/filesystem-api/pom.xml 
b/server/container/filesystem-api/pom.xml
index e712879845..45ddafe090 100644
--- a/server/container/filesystem-api/pom.xml
+++ b/server/container/filesystem-api/pom.xml
@@ -39,7 +39,7 @@
 test
 
 
-com.intellisrc
+com.sparkjava
 spark-core
 test
 
diff --git a/server/container/spring/pom.xml b/server/container/spring/pom.xml
index 97c25bce52..38ea065542 100644
--- a/server/container/spring/pom.xml
+++ b/server/container/spring/pom.xml
@@ -119,7 +119,7 @@
 
 
 
-com.intellisrc
+com.sparkjava
 spark-core
 test
 
diff --git a/server/protocols/webadmin/webadmin-core/pom.xml 
b/server/protocols/webadmin/webadmin-core/pom.xml
index d9b48a1fc2..37172efd14 100644
--- a/server/protocols/webadmin/webadmin-core/pom.xml
+++ b/server/protocols/webadmin/webadmin-core/pom.xml
@@ -102,15 +102,15 @@
 com.google.guava
 guava
 
-
-com.intellisrc
-spark-core
-
 
 com.jayway.jsonpath
 json-path
 test
 
+
+com.sparkjava
+spark-core
+
 
 io.rest-assured
 rest-assured
diff --git 
a/server/protocols/webadmin/webadmin-dropwizard-metrics/src/main/java/org/apache/james/webadmin/dropwizard/MetricsRoutes.java
 
b/server/protocols/webadmin/webadmin-dropwizard-metrics/src/main/java/org/apache/james/webadmin/dropwizard/MetricsRoutes.java
index c2d25a8f8c..0e78accb7f 100644
--- 
a/server/protocols/webadmin/webadmin-dropwizard-metrics/src/main/java/org/apache/james/webadmin/dropwizard/MetricsRoutes.java
+++ 
b/server/protocols/webadmin/webadmin-dropwizard-metrics/src/main/java/org/apache/james/webadmin/dropwizard/MetricsRoutes.java
@@ -27,6 +27,8 @@ import java.util.Optional;
 import java.util.Set;
 
 import javax.inject.Inject;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.james.webadmin.PublicRoutes;
 
@@ -37,8 +39,6 @@ import com.google.common.collect.ImmutableSet;
 import io.prometheus.client.SampleNameFilter;
 import io.prometheus.client.dropwizard.DropwizardExports;
 import io.prometheus.client.exporter.common.TextFormat;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
 import spark.Request;
 import spark.Response;
 import spark.Service;
diff --git 
a/server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/routes/MailRepositoriesRoutes.java
 
b/server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/routes/MailRepositoriesRoutes.java
index 7a6ad3f83e..407408aaf8 100644
--- 
a/server/protocols/webadmin/webadmin-mailrepository/src

(james-project) branch master updated (d944e153d7 -> 403b958ebe)

2024-01-30 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 d944e153d7 [DOC] Improve distributed-app README instructions
 new 57fddebdd5 Revert "[UPDATE] Update spark version: Jetty update"
 new 403b958ebe Revert "[UPDATE] BouncyCastle 1.70 -> 1.77 (fixes multiple 
minor CVEs)"

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:
 mailet/crypto/pom.xml  |  2 +-
 pom.xml| 18 +-
 server/container/core/pom.xml  |  2 +-
 server/container/filesystem-api/pom.xml|  2 +-
 server/container/guice/configuration/pom.xml   |  4 ++--
 server/container/spring/pom.xml|  2 +-
 server/mailet/dkim/pom.xml |  4 ++--
 server/protocols/jwt/pom.xml   |  4 ++--
 server/protocols/webadmin/webadmin-core/pom.xml|  8 
 .../james/webadmin/dropwizard/MetricsRoutes.java   |  4 ++--
 .../james/webadmin/routes/MailRepositoriesRoutes.java  |  2 +-
 11 files changed, 26 insertions(+), 26 deletions(-)


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



(james-project) 02/02: Revert "[UPDATE] BouncyCastle 1.70 -> 1.77 (fixes multiple minor CVEs)"

2024-01-30 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 403b958ebebf318b5ab24e53294d914a4f44a7b0
Author: Rene Cordier 
AuthorDate: Tue Jan 30 09:44:46 2024 +0700

Revert "[UPDATE] BouncyCastle 1.70 -> 1.77 (fixes multiple minor CVEs)"

This reverts commit 73cda2c2c59fafa885519cb1667b23248810fc47.
---
 mailet/crypto/pom.xml| 2 +-
 pom.xml  | 8 
 server/container/guice/configuration/pom.xml | 4 ++--
 server/mailet/dkim/pom.xml   | 4 ++--
 server/protocols/jwt/pom.xml | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/mailet/crypto/pom.xml b/mailet/crypto/pom.xml
index 5a6d69b734..2d75b73383 100644
--- a/mailet/crypto/pom.xml
+++ b/mailet/crypto/pom.xml
@@ -60,7 +60,7 @@
 
 
 org.bouncycastle
-bcmail-jdk18on
+bcmail-jdk15on
 
 
 
diff --git a/pom.xml b/pom.xml
index 8f67121499..4ca269340b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -655,7 +655,7 @@
 1.9.0
 6.3.0.RELEASE
 
-1.77
+1.70
 
 2.13
 ${scala.base}.11
@@ -2736,17 +2736,17 @@
 
 
 org.bouncycastle
-bcmail-jdk18on
+bcmail-jdk15on
 ${bouncycastle.version}
 
 
 org.bouncycastle
-bcpkix-jdk18on
+bcpkix-jdk15on
 ${bouncycastle.version}
 
 
 org.bouncycastle
-bcprov-jdk18on
+bcprov-jdk15on
 ${bouncycastle.version}
 
 
diff --git a/server/container/guice/configuration/pom.xml 
b/server/container/guice/configuration/pom.xml
index 97d6d14671..80a6eea33e 100644
--- a/server/container/guice/configuration/pom.xml
+++ b/server/container/guice/configuration/pom.xml
@@ -60,11 +60,11 @@
 
 
 org.bouncycastle
-bcpkix-jdk18on
+bcpkix-jdk15on
 
 
 org.bouncycastle
-bcprov-jdk18on
+bcprov-jdk15on
 
 
 org.slf4j
diff --git a/server/mailet/dkim/pom.xml b/server/mailet/dkim/pom.xml
index 671f15b13b..8d1aaf615f 100644
--- a/server/mailet/dkim/pom.xml
+++ b/server/mailet/dkim/pom.xml
@@ -113,11 +113,11 @@
 
 
 org.bouncycastle
-bcpkix-jdk18on
+bcpkix-jdk15on
 
 
 org.bouncycastle
-bcprov-jdk18on
+bcprov-jdk15on
 
 
 
diff --git a/server/protocols/jwt/pom.xml b/server/protocols/jwt/pom.xml
index cd489fac0d..4ba4aa9144 100644
--- a/server/protocols/jwt/pom.xml
+++ b/server/protocols/jwt/pom.xml
@@ -107,11 +107,11 @@
 
 
 org.bouncycastle
-bcpkix-jdk18on
+bcpkix-jdk15on
 
 
 org.bouncycastle
-bcprov-jdk18on
+bcprov-jdk15on
 
 
 org.mock-server


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



(james-project) branch master updated: [boyscout] fixes missing mdc values in smtp audit logs (#1952)

2024-01-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 775ab6fcb9 [boyscout] fixes missing mdc values in smtp audit logs 
(#1952)
775ab6fcb9 is described below

commit 775ab6fcb96ccfa98de5c6cebcdc701dd6501fca
Author: Jean Helou 
AuthorDate: Fri Jan 26 08:49:54 2024 +0100

[boyscout] fixes missing mdc values in smtp audit logs (#1952)

Both the HA proxy path and the non behaviour overrides do build the mdc.
unfortunately unless behind an HA proxy, SMTP server will go the behaviour 
overrides path and lose its MDC in the process.

I discovered this while attempting to configure crowdsec on my SMTP server 
instance and noticed we lacked the remote IP in the logs.

I could not find a sane way to write tests for this patch.
---
 .../org/apache/james/protocols/netty/BasicChannelInboundHandler.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
index 95207bdda1..1e4470fd48 100644
--- 
a/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
+++ 
b/protocols/netty/src/main/java/org/apache/james/protocols/netty/BasicChannelInboundHandler.java
@@ -168,7 +168,9 @@ public class BasicChannelInboundHandler extends 
ChannelInboundHandlerAdapter imp
 }
 ChannelInboundHandlerAdapter override = behaviourOverrides.peekFirst();
 if (override != null) {
-override.channelRead(ctx, msg);
+try (Closeable closeable = mdc(ctx).build()) {
+override.channelRead(ctx, msg);
+}
 return;
 }
 


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



(james-project) branch master updated (3445c5a1f0 -> 02bf0074a0)

2024-01-23 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 3445c5a1f0 [FIX] SMTP stack should recompute relaying rights upon 
PROXY message (#1933)
 add 090cd634c9 JAMES-3971 Fix startup errors for jpa-smtp-app
 add 02bf0074a0 JAMES-3970 Need to compile JPA SMTP application

No new revisions were added by this update.

Summary of changes:
 server/apps/jpa-smtp-app/README.adoc   |  4 ++--
 server/apps/jpa-smtp-app/pom.xml   |  1 -
 src/site/markdown/server/install/guice-jpa-smtp.md | 22 ++
 src/site/markdown/server/install/guice-jpa.md  |  6 +++---
 4 files changed, 19 insertions(+), 14 deletions(-)


-
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] SMTP stack should recompute relaying rights upon PROXY message (#1933)

2024-01-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 3445c5a1f0 [FIX] SMTP stack should recompute relaying rights upon 
PROXY message (#1933)
3445c5a1f0 is described below

commit 3445c5a1f0466769e357819ed8d5c2cca8a414a1
Author: Benoit TELLIER 
AuthorDate: Mon Jan 22 16:40:43 2024 +0100

[FIX] SMTP stack should recompute relaying rights upon PROXY message (#1933)

Otherwise, the relaying information is taken from the
proxy and not from the source.
---
 .../james/protocols/smtp/SMTPSessionImpl.java  | 15 +++-
 .../james/smtpserver/SMTPProxyProtocolTest.java| 87 ++
 .../src/test/resources/smtpserver-proxy.xml| 52 +
 3 files changed, 152 insertions(+), 2 deletions(-)

diff --git 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSessionImpl.java
 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSessionImpl.java
index f2302a2e8f..b5b35ac5c9 100644
--- 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSessionImpl.java
+++ 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPSessionImpl.java
@@ -23,6 +23,7 @@ import java.util.Optional;
 
 import org.apache.james.protocols.api.ProtocolSessionImpl;
 import org.apache.james.protocols.api.ProtocolTransport;
+import org.apache.james.protocols.api.ProxyInformation;
 import org.apache.james.protocols.api.Response;
 
 /**
@@ -41,8 +42,12 @@ public class SMTPSessionImpl extends ProtocolSessionImpl 
implements SMTPSession
 
 public SMTPSessionImpl(ProtocolTransport transport, SMTPConfiguration 
config) {
 super(transport, config);
-relayingAllowed = Optional.ofNullable(getRemoteAddress())
-.flatMap(addres -> Optional.ofNullable(addres.getAddress()))
+relayingAllowed = computeRelayingAllowed(config);
+}
+
+private Boolean computeRelayingAllowed(SMTPConfiguration config) {
+return Optional.ofNullable(getRemoteAddress())
+.flatMap(address -> Optional.ofNullable(address.getAddress()))
 .flatMap(address -> Optional.ofNullable(address.getHostAddress()))
 .map(config::isRelayingAllowed)
 .orElse(false);
@@ -53,6 +58,12 @@ public class SMTPSessionImpl extends ProtocolSessionImpl 
implements SMTPSession
 return relayingAllowed;
 }
 
+@Override
+public void setProxyInformation(ProxyInformation proxyInformation) {
+super.setProxyInformation(proxyInformation);
+relayingAllowed = computeRelayingAllowed((SMTPConfiguration) config);
+}
+
 @Override
 public void resetState() {
 // remember the ehlo mode between resets
diff --git 
a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPProxyProtocolTest.java
 
b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPProxyProtocolTest.java
new file mode 100644
index 00..9adbcd466c
--- /dev/null
+++ 
b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPProxyProtocolTest.java
@@ -0,0 +1,87 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+package org.apache.james.smtpserver;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.apache.james.jmap.JMAPTestingConstants.DOMAIN;
+import static org.apache.james.jmap.JMAPTestingConstants.LOCALHOST_IP;
+import static org.apache.james.smtpserver.SMTPServerTestSystem.BOB;
+import static org.apache.james.smtpserver.SMTPServerTestSystem.DATE;
+import static org.apache.james.smtpserver.SMTPServerTestSy

(james-project) branch master updated: [FIX] Enable dynamic translation of LDAP entries (#1932)

2024-01-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 00c51c98ae [FIX] Enable dynamic translation of LDAP entries (#1932)
00c51c98ae is described below

commit 00c51c98ae002bce3cb346c2163ebe429f74db95
Author: Benoit TELLIER 
AuthorDate: Mon Jan 22 16:40:28 2024 +0100

[FIX] Enable dynamic translation of LDAP entries (#1932)
---
 .../user/ldap/LdapRepositoryConfiguration.java | 25 ++
 .../james/user/ldap/ReadOnlyLDAPUsersDAO.java  | 25 +++---
 2 files changed, 38 insertions(+), 12 deletions(-)

diff --git 
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
 
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
index 4548d5d01d..33ba7aaa92 100644
--- 
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
+++ 
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
@@ -58,6 +58,7 @@ public class LdapRepositoryConfiguration {
 private Optional userIdAttribute;
 private Optional resolveLocalPartAttribute;
 private Optional userObjectClass;
+private Optional usernameAttribute;
 private Optional poolSize;
 private Optional trustAllCerts;
 private ImmutableMap.Builder perDomainBaseDN;
@@ -71,6 +72,7 @@ public class LdapRepositoryConfiguration {
 userIdAttribute = Optional.empty();
 resolveLocalPartAttribute = Optional.empty();
 userObjectClass = Optional.empty();
+usernameAttribute = Optional.empty();
 poolSize = Optional.empty();
 trustAllCerts = Optional.empty();
 perDomainBaseDN = ImmutableMap.builder();
@@ -147,6 +149,7 @@ public class LdapRepositoryConfiguration {
 userListBase.orElse(userBase.get()),
 userIdAttribute.get(),
 resolveLocalPartAttribute,
+usernameAttribute,
 userObjectClass.get(),
 NO_CONNECTION_TIMEOUT,
 NO_READ_TIME_OUT,
@@ -180,6 +183,7 @@ public class LdapRepositoryConfiguration {
 .orElse(userBase);
 String userIdAttribute = configuration.getString("[@userIdAttribute]");
 Optional resolveLocalPartAttribute = 
Optional.ofNullable(configuration.getString("[@resolveLocalPartAttribute]", 
null));
+Optional usernameAttribute = 
Optional.ofNullable(configuration.getString("[@usernameAttribute]", null));
 String userObjectClass = configuration.getString("[@userObjectClass]");
 // Default is to use connection pooling
 int connectionTimeout = configuration.getInt("[@connectionTimeout]", 
NO_CONNECTION_TIMEOUT);
@@ -223,6 +227,7 @@ public class LdapRepositoryConfiguration {
 userBase,
 userListBase, userIdAttribute,
 resolveLocalPartAttribute,
+usernameAttribute,
 userObjectClass,
 connectionTimeout,
 readTimeout,
@@ -282,10 +287,16 @@ public class LdapRepositoryConfiguration {
 /**
  * The value of this field is taken from the configuration attribute
  * userIdAttribute. This is the LDAP attribute type which holds
- * the userId value. Note that this is not the same as the email address
- * attribute.
+ * the userId value. This value is used to identify the LDAP entry used 
for authentication,
+ * and by default is used to retrieve the associated username.
  */
 private final String userIdAttribute;
+/**
+ * The value of this field is taken from the configuration attribute
+ * userIdAttribute. This is the LDAP attribute is used to, 
given a LDAP entry,
+ * retrieve the associated username. Defaults to 'userIdAttribute' value.
+ */
+private final Optional usernameAttribute;
 
 /**
  * The value of this field is taken from the configuration attribute
@@ -337,7 +348,7 @@ public class LdapRepositoryConfiguration {
 private final ImmutableMap perDomainBaseDN;
 
 private LdapRepositoryConfiguration(List ldapHosts, String principal, 
String credentials, String userBase, String userListBase, String 
userIdAttribute,
-Optional 
resolveLocalPartAttribute, String userObjectClass, int connectionTimeout, int 
readTimeout,
+Optional 
resolveLocalPartAttribute, Optional usernameAttribute, String 
userObjectClass, int connectionTimeout, int readTimeout,
 boolean supportsVirtualHosting, int 
poolSize, ReadOnlyLDAPGroupRestriction restriction, String filter,

(james-project) 03/04: [FIX] Better handle COPY / MOVE

2024-01-16 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 a0133276fd9ff91de74282669732a2a7648bb3e1
Author: Benoit TELLIER 
AuthorDate: Mon Jan 15 17:45:55 2024 +0100

[FIX] Better handle COPY / MOVE

The messages should be considered updated, and not new.
---
 .../jmap/api/change/MailboxAndEmailChange.java | 30 +--
 .../jmap/change/MailboxChangeListenerTest.scala| 92 ++
 2 files changed, 117 insertions(+), 5 deletions(-)

diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
index 08a2b5a475..f5942a8c6a 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
@@ -60,14 +60,34 @@ public class MailboxAndEmailChange implements JmapChange {
 }
 
 public List fromAdded(MailboxEvents.Added messageAdded, 
ZonedDateTime now, List sharees) {
-return EmailChange.builder()
-.accountId(AccountId.fromUsername(messageAdded.getUsername()))
+AccountId accountId = 
AccountId.fromUsername(messageAdded.getUsername());
+EmailChange.Builder emailChangeBuilder = EmailChange.builder()
+.accountId(accountId)
 .state(stateFactory.generate())
 .date(now)
 .isShared(false)
-.isDelivery(messageAdded.isDelivery())
-.created(messageAdded.getMessageIds())
-.build()
+.isDelivery(messageAdded.isDelivery());
+MailboxChange mailboxChange = MailboxChange.builder()
+.accountId(accountId)
+.state(stateFactory.generate())
+.date(now)
+.isCountChange(true)
+.updated(ImmutableList.of(messageAdded.getMailboxId()))
+.build();
+
+if (messageAdded.isAppended()) {
+return new MailboxAndEmailChange(accountId,
+emailChangeBuilder
+.created(messageAdded.getMessageIds())
+.build(),
+mailboxChange)
+.propagateToSharee(sharees, stateFactory);
+}
+return new MailboxAndEmailChange(accountId,
+emailChangeBuilder
+.updated(messageAdded.getMessageIds())
+.build(),
+mailboxChange)
 .propagateToSharee(sharees, stateFactory);
 }
 
diff --git 
a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/change/MailboxChangeListenerTest.scala
 
b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/change/MailboxChangeListenerTest.scala
index 1ec548d8e6..455879bc3e 100644
--- 
a/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/change/MailboxChangeListenerTest.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/change/MailboxChangeListenerTest.scala
@@ -264,6 +264,52 @@ class MailboxChangeListenerTest {
   })
 }
 
+@Test
+def shouldUpdateWhenCopy(): Unit = {
+  val mailboxSession = MailboxSessionUtil.create(BOB)
+  val path1 = MailboxPath.forUser(BOB, "test")
+  val mailboxId1: MailboxId = mailboxManager.createMailbox(path1, 
mailboxSession).get
+  val messageManager1: MessageManager = 
mailboxManager.getMailbox(mailboxId1, mailboxSession)
+  val appendResult1: AppendResult = 
messageManager1.appendMessage(AppendCommand.builder().build("header: 
value\r\n\r\nbody"), mailboxSession)
+  val path2 = MailboxPath.forUser(BOB, "test2")
+  val mailboxId2: MailboxId = mailboxManager.createMailbox(path2, 
mailboxSession).get
+  val messageManager2: MessageManager = 
mailboxManager.getMailbox(mailboxId2, mailboxSession)
+
+  val state = dummyState()
+
+  
mailboxManager.copyMessages(MessageRange.one(appendResult1.getId.getUid), 
mailboxId1, mailboxId2, mailboxSession)
+
+  SoftAssertions.assertSoftly(softly => {
+val changes = mailboxChangeRepository.getSinceState(ACCOUNT_ID, state, 
None.toJava).block()
+softly.assertThat(changes.getCreated).isEmpty()
+softly.assertThat(changes.getDestroyed).isEmpty()
+softly.assertThat(changes.getUpdated).containsExactly(mailboxId2)
+  })
+}
+
+@Test
+def shouldUpdateWhenMove(): Unit = {
+  val mailboxSession = MailboxSessionUtil.create(BOB)
+  val path1 = MailboxPath.forUser(BOB, "test")
+  val mailboxId1: MailboxId = mailboxManager.createMailbox(path1, 
mailboxSession).get

(james-project) branch master updated (bb01c8a9f2 -> 721b19eb43)

2024-01-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 bb01c8a9f2 [FIX] OpenSearch should normalize base subject (#1910)
 new 14e916467b [FIX] /changes handling of \Deleted flag updates
 new 04aaad4a5a [FIX] Refactoring for MailboxAndEmailChange
 new a0133276fd [FIX] Better handle COPY / MOVE
 new 721b19eb43 [FIX] Adapt integration tests accordingly

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:
 .../apache/james/mailbox/model/UpdatedFlags.java   |   9 +-
 .../apache/james/jmap/api/change/EmailChange.java  |  20 +
 .../apache/james/jmap/api/change/JmapChange.java   |  19 +
 .../jmap/api/change/MailboxAndEmailChange.java | 190 +++
 .../james/jmap/api/change/MailboxChange.java   |  38 +-
 .../contract/EmailChangesMethodContract.scala  |   2 +-
 .../jmap/change/MailboxChangeListenerTest.scala| 558 ++---
 7 files changed, 662 insertions(+), 174 deletions(-)


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



(james-project) 02/04: [FIX] Refactoring for MailboxAndEmailChange

2024-01-16 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 04aaad4a5a32814d844c0c3fcdc79bf989f82a62
Author: Benoit TELLIER 
AuthorDate: Mon Jan 15 17:31:23 2024 +0100

[FIX] Refactoring for MailboxAndEmailChange

Reuse propagateToSharee for added
---
 .../apache/james/jmap/api/change/JmapChange.java   | 13 +
 .../jmap/api/change/MailboxAndEmailChange.java | 60 --
 2 files changed, 22 insertions(+), 51 deletions(-)

diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
index f9d2e9e884..07a5d0bafc 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
@@ -19,14 +19,27 @@
 
 package org.apache.james.jmap.api.change;
 
+import java.util.List;
 import java.util.function.Supplier;
+import java.util.stream.Stream;
 
 import org.apache.james.jmap.api.model.AccountId;
 
+import com.google.common.collect.ImmutableList;
+
 public interface JmapChange {
 AccountId getAccountId();
 
 JmapChange forSharee(AccountId accountId, Supplier state);
 
 boolean isNoop();
+
+default ImmutableList propagateToSharee(List 
sharees, State.Factory stateFactory) {
+if (isNoop()) {
+return ImmutableList.of();
+}
+return Stream.concat(Stream.of(this), sharees.stream()
+.map(shareeId -> forSharee(shareeId, stateFactory::generate)))
+.collect(ImmutableList.toImmutableList());
+}
 }
diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
index c86b5a0360..08a2b5a475 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
@@ -23,9 +23,7 @@ import java.time.ZonedDateTime;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.BiConsumer;
-import java.util.function.Consumer;
 import java.util.function.Supplier;
-import java.util.stream.Stream;
 
 import javax.inject.Inject;
 import javax.mail.Flags;
@@ -62,64 +60,24 @@ public class MailboxAndEmailChange implements JmapChange {
 }
 
 public List fromAdded(MailboxEvents.Added messageAdded, 
ZonedDateTime now, List sharees) {
-AccountId accountId = 
AccountId.fromUsername(messageAdded.getUsername());
-State state = stateFactory.generate();
-EmailChange ownerEmailChange = EmailChange.builder()
-.accountId(accountId)
-.state(state)
+return EmailChange.builder()
+.accountId(AccountId.fromUsername(messageAdded.getUsername()))
+.state(stateFactory.generate())
 .date(now)
 .isShared(false)
 .isDelivery(messageAdded.isDelivery())
 .created(messageAdded.getMessageIds())
-.build();
-
-MailboxChange ownerMailboxChange = MailboxChange.builder()
-.accountId(AccountId.fromUsername(messageAdded.getUsername()))
-.state(state)
-.date(now)
-.isCountChange(true)
-.shared(false)
-.updated(ImmutableList.of(messageAdded.getMailboxId()))
-.build();
-
-MailboxAndEmailChange ownerChange = new 
MailboxAndEmailChange(accountId, ownerEmailChange, ownerMailboxChange);
-
-Stream shareeChanges = sharees.stream()
-.map(shareeId -> new MailboxAndEmailChange(shareeId,
-EmailChange.builder()
-.accountId(shareeId)
-.state(state)
-.date(now)
-.isShared(true)
-.isDelivery(messageAdded.isDelivery())
-.created(messageAdded.getMessageIds())
-.build(),
-MailboxChange.builder()
-.accountId(shareeId)
-.state(state)
-.date(now)
-.isCountChange(true)
-.shared(true)
-
.updated(ImmutableList.of(messageAdded.getMailboxId()))
-.build()));
-
-return Stream.concat(Stream.of(ownerChange), shareeChanges)
-.collect(ImmutableList.toImmutableList());
+

(james-project) 04/04: [FIX] Adapt integration tests accordingly

2024-01-16 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 721b19eb4305316bc5e64862e9ed75e130cd75ba
Author: Benoit TELLIER 
AuthorDate: Mon Jan 15 18:17:10 2024 +0100

[FIX] Adapt integration tests accordingly
---
 .../apache/james/jmap/rfc8621/contract/EmailChangesMethodContract.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/EmailChangesMethodContract.scala
 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailChangesMethodContract.scala
index 0ce6bee345..e91d264c13 100644
--- 
a/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailChangesMethodContract.scala
+++ 
b/server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/EmailChangesMethodContract.scala
@@ -388,7 +388,7 @@ trait EmailChangesMethodContract {
  |  "accountId": 
"29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
  |  "oldState": "${oldState.getValue}",
  |  "hasMoreChanges": false,
- |  "created": ["${messageId.serialize()}"],
+ |  "created": [],
  |  "updated": ["${messageId.serialize()}"],
  |  "destroyed": []
  |}""".stripMargin)


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



(james-project) 01/04: [FIX] /changes handling of \Deleted flag updates

2024-01-16 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 14e916467beed880bd98c38d12ed3ce82f9a394b
Author: Benoit TELLIER 
AuthorDate: Mon Jan 15 17:07:37 2024 +0100

[FIX] /changes handling of \Deleted flag updates

 - Need to consider setFlags(\Deleted) as deleted
 - Need to handle unset deleted flags
 - Need to ignore RECENT changes
 - Need to handle clear deleted flags as a create
 - Need to noop when deleting a flag marked as deleted
 - More resilient when faced with Noop flags updates
 - Per message management is now required

Overall refactoring to improve readability
---
 .../apache/james/mailbox/model/UpdatedFlags.java   |   9 +-
 .../apache/james/jmap/api/change/EmailChange.java  |  20 +
 .../apache/james/jmap/api/change/JmapChange.java   |   6 +
 .../jmap/api/change/MailboxAndEmailChange.java | 142 ---
 .../james/jmap/api/change/MailboxChange.java   |  38 +-
 .../jmap/change/MailboxChangeListenerTest.scala| 466 +
 6 files changed, 543 insertions(+), 138 deletions(-)

diff --git 
a/mailbox/api/src/main/java/org/apache/james/mailbox/model/UpdatedFlags.java 
b/mailbox/api/src/main/java/org/apache/james/mailbox/model/UpdatedFlags.java
index e39f66e428..c7fcb848a2 100644
--- a/mailbox/api/src/main/java/org/apache/james/mailbox/model/UpdatedFlags.java
+++ b/mailbox/api/src/main/java/org/apache/james/mailbox/model/UpdatedFlags.java
@@ -245,11 +245,18 @@ public class UpdatedFlags {
 addModifiedUserFlags(flagsOld, flagsNew, modifiedFlags);
 return modifiedFlags.getSystemFlags().length > 0 || 
modifiedFlags.getUserFlags().length > 0;
 }
-
+
 public boolean flagsChanged() {
 return modifiedFlags.getSystemFlags().length > 0 || 
modifiedFlags.getUserFlags().length > 0;
 }
 
+public boolean flagsChangedIgnoringRecent() {
+if (modifiedFlags.contains(Flags.Flag.RECENT)) {
+return modifiedFlags.getSystemFlags().length > 1 || 
modifiedFlags.getUserFlags().length > 0;
+}
+return modifiedFlags.getSystemFlags().length > 0 || 
modifiedFlags.getUserFlags().length > 0;
+}
+
 @Override
 public final boolean equals(Object other) {
 if (this == other) {
diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/EmailChange.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/EmailChange.java
index e5069229cc..a5c8d7b332 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/EmailChange.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/EmailChange.java
@@ -24,6 +24,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.function.Supplier;
 
 import org.apache.james.jmap.api.model.AccountId;
 import org.apache.james.mailbox.model.MessageId;
@@ -174,6 +175,25 @@ public class EmailChange implements JmapChange {
 return isDelivery;
 }
 
+public EmailChange forSharee(AccountId accountId, Supplier state) {
+return EmailChange.builder()
+.accountId(accountId)
+.state(state.get())
+.date(date)
+.isShared(true)
+.created(created)
+.updated(updated)
+.destroyed(destroyed)
+.build();
+}
+
+@Override
+public boolean isNoop() {
+return created.isEmpty()
+&& updated.isEmpty()
+&& destroyed.isEmpty();
+}
+
 @Override
 public final boolean equals(Object o) {
 if (o instanceof EmailChange) {
diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
index 3767de1733..f9d2e9e884 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/JmapChange.java
@@ -19,8 +19,14 @@
 
 package org.apache.james.jmap.api.change;
 
+import java.util.function.Supplier;
+
 import org.apache.james.jmap.api.model.AccountId;
 
 public interface JmapChange {
 AccountId getAccountId();
+
+JmapChange forSharee(AccountId accountId, Supplier state);
+
+boolean isNoop();
 }
diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
index 430fa6eec1..c86b5a0360 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEmailChange.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/change/MailboxAndEma

(james-project) 02/02: JAMES-2586 Implement PostgresMessageIdMapper

2024-01-15 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

commit 17b5e2bd2f9bafe619358d465efa9447327470ca
Author: hung phan 
AuthorDate: Fri Jan 12 17:49:21 2024 +0700

JAMES-2586 Implement PostgresMessageIdMapper
---
 .../PostgresMailboxSessionMapperFactory.java   |  12 +-
 .../mail/MailboxDeleteDuringUpdateException.java   |  23 ++
 .../postgres/mail/PostgresMessageIdMapper.java | 274 +
 .../postgres/mail/PostgresMessageMapper.java   |   7 +-
 .../mail/dao/PostgresMailboxMessageDAO.java|  68 +++--
 .../postgres/mail/PostgresMapperProvider.java  |  39 ++-
 .../postgres/mail/PostgresMessageIdMapperTest.java |  45 
 7 files changed, 440 insertions(+), 28 deletions(-)

diff --git 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/PostgresMailboxSessionMapperFactory.java
 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/PostgresMailboxSessionMapperFactory.java
index 7d78d275f4..7f54b43501 100644
--- 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/PostgresMailboxSessionMapperFactory.java
+++ 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/PostgresMailboxSessionMapperFactory.java
@@ -29,11 +29,14 @@ import org.apache.james.blob.api.BlobStore;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.postgres.mail.PostgresAnnotationMapper;
 import org.apache.james.mailbox.postgres.mail.PostgresMailboxMapper;
+import org.apache.james.mailbox.postgres.mail.PostgresMessageIdMapper;
 import org.apache.james.mailbox.postgres.mail.PostgresMessageMapper;
 import org.apache.james.mailbox.postgres.mail.PostgresModSeqProvider;
 import org.apache.james.mailbox.postgres.mail.PostgresUidProvider;
 import org.apache.james.mailbox.postgres.mail.dao.PostgresMailboxAnnotationDAO;
 import org.apache.james.mailbox.postgres.mail.dao.PostgresMailboxDAO;
+import org.apache.james.mailbox.postgres.mail.dao.PostgresMailboxMessageDAO;
+import org.apache.james.mailbox.postgres.mail.dao.PostgresMessageDAO;
 import org.apache.james.mailbox.postgres.user.PostgresSubscriptionDAO;
 import org.apache.james.mailbox.postgres.user.PostgresSubscriptionMapper;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
@@ -45,7 +48,6 @@ import org.apache.james.mailbox.store.mail.MessageIdMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.user.SubscriptionMapper;
 
-
 public class PostgresMailboxSessionMapperFactory extends 
MailboxSessionMapperFactory implements AttachmentMapperFactory {
 
 private final PostgresExecutor.Factory executorFactory;
@@ -82,7 +84,13 @@ public class PostgresMailboxSessionMapperFactory extends 
MailboxSessionMapperFac
 
 @Override
 public MessageIdMapper createMessageIdMapper(MailboxSession session) {
-throw new NotImplementedException("not implemented");
+return new PostgresMessageIdMapper(new 
PostgresMailboxDAO(executorFactory.create(session.getUser().getDomainPart())),
+new 
PostgresMessageDAO(executorFactory.create(session.getUser().getDomainPart()), 
blobIdFactory),
+new 
PostgresMailboxMessageDAO(executorFactory.create(session.getUser().getDomainPart())),
+getModSeqProvider(session),
+blobStore,
+blobIdFactory,
+clock);
 }
 
 @Override
diff --git 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/MailboxDeleteDuringUpdateException.java
 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/MailboxDeleteDuringUpdateException.java
new file mode 100644
index 00..e738905441
--- /dev/null
+++ 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/MailboxDeleteDuringUpdateException.java
@@ -0,0 +1,23 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for 

(james-project) branch postgresql updated (35bd908641 -> 17b5e2bd2f)

2024-01-15 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 35bd908641 JAMES-2586 Implement BlobReferenceSource(s) for postgres-app
 new 5abe1b002e JAMES-2586 add mailbox para for generateMessageUid method 
in MapperProvider
 new 17b5e2bd2f JAMES-2586 Implement PostgresMessageIdMapper

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:
 .../cassandra/mail/CassandraMapperProvider.java|  13 +-
 .../mail/CassandraMessageIdMapperTest.java |  12 +-
 .../james/mailbox/jpa/mail/JPAMapperProvider.java  |   2 +-
 .../inmemory/mail/InMemoryMapperProvider.java  |   2 +-
 .../PostgresMailboxSessionMapperFactory.java   |  12 +-
 .../mail/MailboxDeleteDuringUpdateException.java}  |   5 +-
 .../postgres/mail/PostgresMessageIdMapper.java | 274 +
 .../postgres/mail/PostgresMessageMapper.java   |   7 +-
 .../mail/dao/PostgresMailboxMessageDAO.java|  68 +++--
 .../postgres/mail/PostgresMapperProvider.java  |  39 ++-
 ...rTest.java => PostgresMessageIdMapperTest.java} |   9 +-
 .../mailbox/store/mail/model/MapperProvider.java   |   2 +-
 .../store/mail/model/MessageIdMapperTest.java  | 134 +-
 13 files changed, 463 insertions(+), 116 deletions(-)
 copy 
mailbox/{opensearch/src/main/java/org/apache/james/mailbox/opensearch/IndexAttachments.java
 => 
postgres/src/main/java/org/apache/james/mailbox/postgres/mail/MailboxDeleteDuringUpdateException.java}
 (91%)
 create mode 100644 
mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageIdMapper.java
 copy 
mailbox/postgres/src/test/java/org/apache/james/mailbox/postgres/mail/{PostgresMessageMapperTest.java
 => PostgresMessageIdMapperTest.java} (91%)


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



(james-project) 01/02: JAMES-2586 add mailbox para for generateMessageUid method in MapperProvider

2024-01-15 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

commit 5abe1b002e2adafad16afe611804a6b09a8d66de
Author: hung phan 
AuthorDate: Fri Jan 12 17:48:02 2024 +0700

JAMES-2586 add mailbox para for generateMessageUid method in MapperProvider
---
 .../cassandra/mail/CassandraMapperProvider.java|  13 +-
 .../mail/CassandraMessageIdMapperTest.java |  12 +-
 .../james/mailbox/jpa/mail/JPAMapperProvider.java  |   2 +-
 .../inmemory/mail/InMemoryMapperProvider.java  |   2 +-
 .../mailbox/store/mail/model/MapperProvider.java   |   2 +-
 .../store/mail/model/MessageIdMapperTest.java  | 134 ++---
 6 files changed, 85 insertions(+), 80 deletions(-)

diff --git 
a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
 
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
index e3e7cd9f2b..730a2a836f 100644
--- 
a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
+++ 
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
@@ -40,6 +40,7 @@ import org.apache.james.mailbox.store.mail.AttachmentMapper;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.MessageIdMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
+import org.apache.james.mailbox.store.mail.UidProvider;
 import org.apache.james.mailbox.store.mail.model.MapperProvider;
 import org.apache.james.mailbox.store.mail.model.MessageUidProvider;
 import org.apache.james.utils.UpdatableTickingClock;
@@ -51,7 +52,7 @@ public class CassandraMapperProvider implements 
MapperProvider {
 private static final Factory MESSAGE_ID_FACTORY = new 
CassandraMessageId.Factory();
 
 private final CassandraCluster cassandra;
-private final MessageUidProvider messageUidProvider;
+private final UidProvider messageUidProvider;
 private final CassandraModSeqProvider cassandraModSeqProvider;
 private final UpdatableTickingClock updatableTickingClock;
 private final MailboxSession mailboxSession = 
MailboxSessionUtil.create(Username.of("benwa"));
@@ -60,7 +61,7 @@ public class CassandraMapperProvider implements 
MapperProvider {
 public CassandraMapperProvider(CassandraCluster cassandra,
CassandraConfiguration 
cassandraConfiguration) {
 this.cassandra = cassandra;
-messageUidProvider = new MessageUidProvider();
+messageUidProvider = new 
CassandraUidProvider(this.cassandra.getConf(), cassandraConfiguration);
 cassandraModSeqProvider = new CassandraModSeqProvider(
 this.cassandra.getConf(),
 cassandraConfiguration);
@@ -116,8 +117,12 @@ public class CassandraMapperProvider implements 
MapperProvider {
 }
 
 @Override
-public MessageUid generateMessageUid() {
-return messageUidProvider.next();
+public MessageUid generateMessageUid(Mailbox mailbox) {
+try {
+return messageUidProvider.nextUid(mailbox);
+} catch (MailboxException e) {
+throw new RuntimeException(e);
+}
 }
 
 @Override
diff --git 
a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapperTest.java
 
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapperTest.java
index 2c1cb4f8eb..5ff34370b1 100644
--- 
a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapperTest.java
+++ 
b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageIdMapperTest.java
@@ -152,7 +152,7 @@ class CassandraMessageIdMapperTest extends 
MessageIdMapperTest {
 .whenQueryStartsWith("UPDATE messagev3"));
 
 try {
-message1.setUid(mapperProvider.generateMessageUid());
+
message1.setUid(mapperProvider.generateMessageUid(benwaInboxMailbox));
 
message1.setModSeq(mapperProvider.generateModSeq(benwaInboxMailbox));
 sut.save(message1);
 } catch (Exception e) {
@@ -176,7 +176,7 @@ class CassandraMessageIdMapperTest extends 
MessageIdMapperTest {
 .whenQueryStartsWith("INSERT INTO blobparts 
(id,chunknumber,data)"));
 
 try {
-message1.setUid(mapperProvider.generateMessageUid());
+
message1.setUid(mapperProvider.generateMessageUid(benwaInboxMailbox));
 
message1.setModSeq(mapperProvider.generateModSeq(benwaInboxMailbox));
 sut.save(message1);
 } catch (Exception e) {
@@ -200,7 +200,7 @@ class CassandraMessageIdMapperTes

(james-project) branch master updated: CHANGELOG refresher as off 08/01/2024

2024-01-10 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 26eac6facf CHANGELOG refresher as off 08/01/2024
26eac6facf is described below

commit 26eac6facf19b9a6708e953a8a0512e5c4203d75
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 12:11:29 2024 +0100

CHANGELOG refresher as off 08/01/2024
---
 CHANGELOG.md | 94 
 1 file changed, 94 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98357ff9df..facddb9133 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,84 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/)
 
 No changes yet.
 
+### Fixes
+
+### Security
+
+- [FIX] JMX password auto-detection
+- [FIX] Enforce CRLF as part of SMTP DATA transaction (#1876)
+- [FIX] Set up JMX auth for Spring
+- [FIX] Set up JMX auth filter for Guice
+
+### New Features
+
+- JAMES-3942 Audit trail
+- JAMES-3897 Crowdsec integration for SMTP
+- JAMES-3964 Implement and test disabledCaps for SMTP
+- JAMES-3962 JMAP Email/set: specific headers for body parts (#1801)
+- JAMES-3960 Hints to ensure UID/ModSeq consistency in case of disaster
+- JAMES-3959 Starting distributed James without OpenSearch (#1784)
+- JAMES-3954 Implement RFC-9394 PARTIAL for IMAP FETCH/SEARCH
+- JAMES-3944 JMAP FILTER: More features: forward, flag, discard, etc...
+- JAMES-3930 ReadOnlyUsersLDAPRepository::test should allow authentication 
using localPart as login username
+- Supporting several LDAP hosts
+- JAMES 3822 SMTP FutureRelease Extension
+- JAMES-2434 IsFromMailingList matcher (#1606)
+- JAMES-3906 SSL hot reload for IMAP /SMTP
+- JAMES-3908 Storage directive with several folder (#1575)
+- JAMES-3909 Fully delete one user data webadmin endpoint
+
+### Improvements
+
+ - JAMES-3967 RelayLimit: add error log
+ - JAMES-3967 Store mails when relay is exceeded
+ - [FIX] LdapRepositoryConfiguration should interoperate with 
UsersRepositoryImpl (#1855)
+ - JAMES-3539 PushSubscription/get should return expired subscriptions (#1845)
+ - [ENHANCEMENT] Allow to trust all certificates with S3 blobstore (#1846)
+ - Numerous dependency updates
+ - [IMPROVEMENT] JMAP: Display message/disposition-notification in main 
message body
+ - JAMES-3965 DKIMSign: Use fileSystem in order to resolve privateKeyFilepath
+ - JAMES-3963 Full text search: AND for combining phrase terms (#1810)
+ - JAMES-3963 Sort From To Cc on display name first (#1811)
+ - JAMES-3955 Increase consumer timeout for TaskManagerWorkQueue
+ - JAMES-3955 WARNING logs upon closing RABBITMQ channels
+ - JAMES-3955 Applicative timeouts before Rabbit timeouts
+ - JAMES-3958 DKIM: Be resilient when updating mails with invalid headers 
(#1783)
+ - JAMES-3874 LMTP should handle overQuota exceptions
+ - JAMES-3944 Forwards should rewrite MAIL FROM
+ - JAMES-3887 MailboxManager::createMailboxReactive should subscribe parent 
mailboes it creates (#1752)
+ - JAMES-3828 ICALAttributeDTO: support missing uid, method and dtstamp fields
+ - [IMPROVMENT] Add Cassandra statements to the logs (#1723)
+ - JAMES-3925 Rework JMAP quota cleanup
+ - JAMES-3926 Move mutualized quota DAOs to backend/cassandra
+ - JAMES-3604 Enable to use quorum queues onto DTM work queue (#1708)
+ - JAMES-3938 IMAP MOVE should not fail on empty mailbox (#1713)
+ - [FIX] VerifySenderIdentity makes sense when auth is not announced (#1693)
+ - [FIX] PropagateLookupRightListener should not fail on missing mailbox
+ - [FIX] Some S3 like object storage, like MinIO, don't accept underscores in 
their bucket names
+ - JAMES-3914 Sieve actions fails when several recipients
+ - JAMES-3911 JPA: Prevent concurrent operations on the same EntityManager
+
+## [Unreleased 3.8.x]
+
+### Security
+
+- [FIX] JMX password auto-detection
+- [FIX] Enforce CRLF as part of SMTP DATA transaction (#1876)
+- [FIX] Set up JMX auth for Spring
+- [FIX] Set up JMX auth filter for Guice
+
+### Enhancements 
+
+ - JAMES-3938 IMAP MOVE should not fail on empty mailbox (#1716)
+ - JAMES-3604 Enable to use quorum queues onto DTM work queue (#1714)
+ - JAMES-3924 Allow conditional Cassandra statement recording
+ - JAMES-3934 Allow external scheduling for RabbitMQ mailQueue browse st… 
(#1682)
+ - JAMES-3918 Force deletion of user mailboxes (#1608) (#1611)
+ - FIX Proxy for SMTPS (#1594)
+ - JAMES-3914 Sieve actions fails when several recipients
+ - Small JPA enhancements
+
 ## [3.8.0] - 2023-05-17
 
 This release brings the following significant changes:
@@ -293,6 +371,22 @@ Multiple performance enhancements for Distributed server 
mailbox, IMAP, SMTP and
  - JAMES-3440 RFC-8621 support for emailQueryView before + inMailbox sorted by 
receivedAt
  - JAMES-2080 Allow turning off header indexing in OpenSearch (#1516)
 
+## [Unreleased 3.7.x]
+
+### Security
+
+- [FIX

(james-project) branch postgresql updated (c43b2c544e -> bf5f99e455)

2024-01-09 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 c43b2c544e JAMES-2586 Refactor the way initPostgres of 
PostgresTableManager
 new c2dbfc579f JAMES-2586 Implement PostgresDeletedMessageMetadataVault
 new 55a09898a5 JAMES-2586 Guice binding + module chooser + sample config 
for Postgres DeletedMessageVault
 new de96f76fd9 JAMES-2586 Plug DeletedMessageVaultDeletionCallback into 
DeleteMessageListener
 new bf9a4b1d00 JAMES-2586 PostgresDeletedMessageVaultIntegrationTest
 new bf5f99e455 JAMES-2586 Plug PreDeletionHooks

The 5 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|   4 +-
 .../pom.xml|  33 +++---
 .../DeletedMessageVaultDeletionCallback.java   |  28 ++---
 .../PostgresDeletedMessageMetadataModule.java  |  39 +++
 .../PostgresDeletedMessageMetadataVault.java   | 115 +
 .../PostgresDeletedMessageMetadataVaultTest.java   |  21 +++-
 .../james/vault/metadata/MetadataSerializer.java   |   0
 mailbox/pom.xml|   1 +
 .../mailbox/postgres/DeleteMessageListener.java|  52 +++---
 .../postgres/mail/MessageRepresentation.java   | 113 
 .../postgres/mail/PostgresMailboxManager.java  |   6 +-
 .../postgres/mail/PostgresMessageManager.java  |   4 +-
 .../postgres/mail/dao/PostgresMessageDAO.java  |  27 -
 .../postgres/DeleteMessageListenerContract.java|   8 +-
 .../postgres/DeleteMessageListenerTest.java|   3 +-
 .../postgres/DeleteMessageListenerWithRLSTest.java |   3 +-
 .../postgres/PostgresMailboxManagerProvider.java   |  11 +-
 .../postgres/PostgresMailboxManagerStressTest.java |   4 +-
 .../postgres/PostgresMailboxManagerTest.java   |  14 +--
 .../PostgresRecomputeCurrentQuotasServiceTest.java |   3 +-
 .../postgres/host/PostgresHostSystem.java  |   4 +-
 pom.xml|  16 +++
 .../deletedMessageVault.properties |   0
 .../apache/james/PostgresJamesConfiguration.java   |  33 +-
 .../org/apache/james/PostgresJamesServerMain.java  |  16 ++-
 .../org/apache/james/PostgresJamesServerTest.java  |   2 +
 server/container/guice/mailbox-postgres/pom.xml|   4 +
 .../PostgresDeletedMessageVaultModule.java}|  25 -
 .../modules/mailbox/PostgresMailboxModule.java |   1 +
 server/protocols/webadmin-integration-test/pom.xml |   1 +
 .../postgres-webadmin-integration-test}/pom.xml|  64 ++--
 ...ostgresDeletedMessageVaultIntegrationTest.java} | 108 ++-
 .../src/test/resources/dnsservice.xml  |   0
 .../src/test/resources/domainlist.xml  |   0
 .../src/test}/resources/imapserver.xml |   0
 .../src/test/resources/jwt_publickey   |   0
 .../src/test/resources/listeners.xml   |   7 +-
 .../src/test}/resources/lmtpserver.xml |   0
 .../src/test/resources/mailetcontainer.xml |  14 +--
 .../src/test/resources/mailrepositorystore.xml |   0
 .../src/test}/resources/managesieveserver.xml  |   0
 .../src/test}/resources/pop3server.xml |   0
 .../src/test/resources/smtpserver.xml  |   0
 .../src/test/resources/webadmin.properties |   0
 44 files changed, 571 insertions(+), 213 deletions(-)
 copy mailbox/plugin/{quota-search => deleted-messages-vault-postgres}/pom.xml 
(77%)
 copy mailbox/plugin/{deleted-messages-vault-cassandra => 
deleted-messages-vault-postgres}/src/main/java/org/apache/james/vault/metadata/DeletedMessageVaultDeletionCallback.java
 (81%)
 copy 
server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStorageModule.java
 => 
mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/PostgresDeletedMessageMetadataModule.java
 (61%)
 create mode 100644 
mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/PostgresDeletedMessageMetadataVault.java
 copy 
event-bus/postgres/src/test/java/org/apache/james/events/PostgresEventDeadLettersTest.java
 => 
mailbox/plugin/deleted-messages-vault-postgres/src/test/java/org/apache/james/vault/metadata/PostgresDeletedMessageMetadataVaultTest.java
 (59%)
 rename mailbox/plugin/{deleted-messages-vault-cassandra => 
deleted-messages-vault}/src/main/java/org/apache/james/vault/metadata/MetadataSerializer.java
 (100%)
 create mode 100644 
mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/MessageRepresentation.java
 copy serv

(james-project) 01/05: JAMES-2586 Implement PostgresDeletedMessageMetadataVault

2024-01-09 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

commit c2dbfc579f41e6aef0475da24f804d9cb21b59d5
Author: Quan Tran 
AuthorDate: Tue Jan 2 15:05:05 2024 +0700

JAMES-2586 Implement PostgresDeletedMessageMetadataVault
---
 Jenkinsfile|   3 +-
 .../plugin/deleted-messages-vault-postgres/pom.xml |  79 ++
 .../PostgresDeletedMessageMetadataModule.java  |  65 
 .../PostgresDeletedMessageMetadataVault.java   | 115 +
 .../PostgresDeletedMessageMetadataVaultTest.java   |  46 +
 .../james/vault/metadata/MetadataSerializer.java   |   0
 mailbox/pom.xml|   1 +
 pom.xml|   5 +
 8 files changed, 313 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e27ed683f4..cb220daa6e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -46,7 +46,8 @@ pipeline {
 'server/container/guice/mailbox-postgres,' +
 'server/apps/postgres-app,' +
 'mpt/impl/imap-mailbox/postgres,' +
-'event-bus/postgres'
+'event-bus/postgres,' +
+'mailbox/plugin/deleted-messages-vault-postgres'
 }
 
 tools {
diff --git a/mailbox/plugin/deleted-messages-vault-postgres/pom.xml 
b/mailbox/plugin/deleted-messages-vault-postgres/pom.xml
new file mode 100644
index 00..103fd725b4
--- /dev/null
+++ b/mailbox/plugin/deleted-messages-vault-postgres/pom.xml
@@ -0,0 +1,79 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+4.0.0
+
+org.apache.james
+apache-james-mailbox
+3.9.0-SNAPSHOT
+../../pom.xml
+
+
+
apache-james-mailbox-deleted-messages-vault-postgres
+Apache James :: Mailbox :: Plugin :: Deleted Messages Vault :: 
Postgres
+Apache James Mailbox Deleted Messages Vault metadata on top 
of Postgres
+
+
+
+${james.groupId}
+apache-james-backends-postgres
+
+
+${james.groupId}
+apache-james-backends-postgres
+test-jar
+test
+
+
+${james.groupId}
+
apache-james-mailbox-deleted-messages-vault
+
+
+${james.groupId}
+
apache-james-mailbox-deleted-messages-vault
+test-jar
+test
+
+
+${james.groupId}
+apache-james-mailbox-memory
+test
+
+
+${james.groupId}
+james-server-guice-common
+test-jar
+test
+
+
+${james.groupId}
+james-server-testing
+test
+
+
+${james.groupId}
+testing-base
+test
+
+
+org.testcontainers
+postgresql
+test
+
+
+
diff --git 
a/mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/PostgresDeletedMessageMetadataModule.java
 
b/mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/PostgresDeletedMessageMetadataModule.java
new file mode 100644
index 00..de041482a4
--- /dev/null
+++ 
b/mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/PostgresDeletedMessageMetadataModule.java
@@ -0,0 +1,65 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ ***

(james-project) 05/05: JAMES-2586 Plug PreDeletionHooks

2024-01-09 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

commit bf5f99e4556e82221289a14eee9995987680447c
Author: Quan Tran 
AuthorDate: Mon Jan 8 15:39:09 2024 +0700

JAMES-2586 Plug PreDeletionHooks
---
 .../mailbox/postgres/mail/PostgresMailboxManager.java  |  6 --
 .../mailbox/postgres/mail/PostgresMessageManager.java  |  4 ++--
 .../james/mailbox/postgres/DeleteMessageListenerTest.java  |  3 ++-
 .../mailbox/postgres/DeleteMessageListenerWithRLSTest.java |  3 ++-
 .../mailbox/postgres/PostgresMailboxManagerProvider.java   |  6 --
 .../mailbox/postgres/PostgresMailboxManagerStressTest.java |  4 +++-
 .../james/mailbox/postgres/PostgresMailboxManagerTest.java | 14 --
 .../task/PostgresRecomputeCurrentQuotasServiceTest.java|  3 ++-
 .../mpt/imapmailbox/postgres/host/PostgresHostSystem.java  |  4 +++-
 9 files changed, 26 insertions(+), 21 deletions(-)

diff --git 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMailboxManager.java
 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMailboxManager.java
index 070c12333a..0f25e6bc08 100644
--- 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMailboxManager.java
+++ 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMailboxManager.java
@@ -62,11 +62,12 @@ public class PostgresMailboxManager extends 
StoreMailboxManager {
   QuotaComponents quotaComponents,
   MessageSearchIndex index,
   ThreadIdGuessingAlgorithm 
threadIdGuessingAlgorithm,
+  PreDeletionHooks preDeletionHooks,
   Clock clock) {
 super(mapperFactory, sessionProvider, new NoMailboxPathLocker(),
 messageParser, messageIdFactory, annotationManager,
 eventBus, storeRightManager, quotaComponents,
-index, MailboxManagerConfiguration.DEFAULT, 
PreDeletionHooks.NO_PRE_DELETION_HOOK, threadIdGuessingAlgorithm, clock);
+index, MailboxManagerConfiguration.DEFAULT, preDeletionHooks, 
threadIdGuessingAlgorithm, clock);
 }
 
 @Override
@@ -82,7 +83,8 @@ public class PostgresMailboxManager extends 
StoreMailboxManager {
 configuration.getBatchSizes(),
 getStoreRightManager(),
 getThreadIdGuessingAlgorithm(),
-getClock());
+getClock(),
+getPreDeletionHooks());
 }
 
 @Override
diff --git 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageManager.java
 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageManager.java
index c10700e36a..4bf0c237bd 100644
--- 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageManager.java
+++ 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageManager.java
@@ -64,9 +64,9 @@ public class PostgresMessageManager extends 
StoreMessageManager {
   QuotaManager quotaManager, QuotaRootResolver 
quotaRootResolver,
   MessageId.Factory messageIdFactory, 
BatchSizes batchSizes,
   StoreRightManager storeRightManager, 
ThreadIdGuessingAlgorithm threadIdGuessingAlgorithm,
-  Clock clock) {
+  Clock clock, PreDeletionHooks 
preDeletionHooks) {
 super(StoreMailboxManager.DEFAULT_NO_MESSAGE_CAPABILITIES, 
mapperFactory, index, eventBus, locker, mailbox,
-quotaManager, quotaRootResolver, batchSizes, storeRightManager, 
PreDeletionHooks.NO_PRE_DELETION_HOOK,
+quotaManager, quotaRootResolver, batchSizes, storeRightManager, 
preDeletionHooks,
 new MessageStorer.WithoutAttachment(mapperFactory, 
messageIdFactory, new MessageFactory.StoreMessageFactory(), 
threadIdGuessingAlgorithm, clock));
 this.storeRightManager = storeRightManager;
 this.mapperFactory = mapperFactory;
diff --git 
a/mailbox/postgres/src/test/java/org/apache/james/mailbox/postgres/DeleteMessageListenerTest.java
 
b/mailbox/postgres/src/test/java/org/apache/james/mailbox/postgres/DeleteMessageListenerTest.java
index bc769f2042..7e93f82be6 100644
--- 
a/mailbox/postgres/src/test/java/org/apache/james/mailbox/postgres/DeleteMessageListenerTest.java
+++ 
b/mailbox/postgres/src/test/java/org/apache/james/mailbox/postgres/DeleteMessageListenerTest.java
@@ -25,6 +25,7 @@ import org.apache.james.backends.postgres.PostgresExtension;
 import org.apache.james.mailbox.postgres.mail.PostgresMailboxManager;
 import org.apache.james.mailbox.postgres.mail.dao.PostgresMailboxMessageDAO;
 import

(james-project) 02/05: JAMES-2586 Guice binding + module chooser + sample config for Postgres DeletedMessageVault

2024-01-09 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

commit 55a09898a5c7501c3460ce37d847ed38f133d593
Author: Quan Tran 
AuthorDate: Tue Jan 2 16:09:28 2024 +0700

JAMES-2586 Guice binding + module chooser + sample config for Postgres 
DeletedMessageVault
---
 .../deletedMessageVault.properties |  7 
 .../apache/james/PostgresJamesConfiguration.java   | 33 ++--
 .../org/apache/james/PostgresJamesServerMain.java  | 14 +++
 .../org/apache/james/PostgresJamesServerTest.java  |  2 +
 server/container/guice/mailbox-postgres/pom.xml|  4 ++
 .../mailbox/PostgresDeletedMessageVaultModule.java | 44 ++
 6 files changed, 100 insertions(+), 4 deletions(-)

diff --git 
a/server/apps/postgres-app/sample-configuration/deletedMessageVault.properties 
b/server/apps/postgres-app/sample-configuration/deletedMessageVault.properties
new file mode 100644
index 00..a6df89a227
--- /dev/null
+++ 
b/server/apps/postgres-app/sample-configuration/deletedMessageVault.properties
@@ -0,0 +1,7 @@
+# = Deleted Messages Vault 
Configuration ==
+
+enabled=false
+
+# Retention period for your deleted messages into the vault, after which they 
expire and can be potentially cleaned up
+# Optional, default 1y
+# retentionPeriod=1y
\ No newline at end of file
diff --git 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
index 26bad105be..d526c89237 100644
--- 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
+++ 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesConfiguration.java
@@ -34,6 +34,7 @@ import 
org.apache.james.server.core.configuration.Configuration;
 import org.apache.james.server.core.configuration.FileConfigurationProvider;
 import org.apache.james.server.core.filesystem.FileSystemImpl;
 import org.apache.james.utils.PropertiesProvider;
+import org.apache.james.vault.VaultConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,8 +70,8 @@ public class PostgresJamesConfiguration implements 
Configuration {
 private Optional 
usersRepositoryImplementation;
 private Optional searchConfiguration;
 private Optional blobStoreConfiguration;
-
 private Optional eventBusImpl;
+private Optional deletedMessageVaultConfiguration;
 
 private Builder() {
 searchConfiguration = Optional.empty();
@@ -79,6 +80,7 @@ public class PostgresJamesConfiguration implements 
Configuration {
 usersRepositoryImplementation = Optional.empty();
 blobStoreConfiguration = Optional.empty();
 eventBusImpl = Optional.empty();
+deletedMessageVaultConfiguration = Optional.empty();
 }
 
 public Builder workingDirectory(String path) {
@@ -129,6 +131,11 @@ public class PostgresJamesConfiguration implements 
Configuration {
 return this;
 }
 
+public Builder deletedMessageVaultConfiguration(VaultConfiguration 
vaultConfiguration) {
+this.deletedMessageVaultConfiguration = 
Optional.of(vaultConfiguration);
+return this;
+}
+
 public PostgresJamesConfiguration build() {
 ConfigurationPath configurationPath = 
this.configurationPath.orElse(new 
ConfigurationPath(FileSystem.FILE_PROTOCOL_AND_CONF));
 JamesServerResourceLoader directories = new 
JamesServerResourceLoader(rootDirectory
@@ -154,13 +161,24 @@ public class PostgresJamesConfiguration implements 
Configuration {
 
 EventBusImpl eventBusImpl = this.eventBusImpl.orElseGet(() -> 
EventBusImpl.from(propertiesProvider));
 
+VaultConfiguration deletedMessageVaultConfiguration = 
this.deletedMessageVaultConfiguration.orElseGet(() -> {
+try {
+return 
VaultConfiguration.from(propertiesProvider.getConfiguration("deletedMessageVault"));
+} catch (FileNotFoundException e) {
+return VaultConfiguration.DEFAULT;
+} catch (ConfigurationException e) {
+throw new RuntimeException(e);
+}
+});
+
 return new PostgresJamesConfiguration(
 configurationPath,
 directories,
 searchConfiguration,
 usersRepositoryChoice,
 blobStoreConfiguration,
-eventBusImpl);
+eventBusImpl,
+deletedMessageVaultConfiguration);
 }
 }
 
@@ -174,19 +192,22 @@ public class PostgresJamesConfiguration implements 
Configuration {
  

(james-project) 04/05: JAMES-2586 PostgresDeletedMessageVaultIntegrationTest

2024-01-09 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

commit bf9a4b1d00594219269665232ea05de80edc3d8f
Author: Quan Tran 
AuthorDate: Mon Jan 8 14:43:47 2024 +0700

JAMES-2586 PostgresDeletedMessageVaultIntegrationTest

Can not rely on `DeletedMessageVaultIntegrationTest` for now, as it 
requires `JmapGuiceProbe`.
---
 Jenkinsfile|   1 +
 pom.xml|  11 ++
 .../org/apache/james/PostgresJamesServerMain.java  |   2 +-
 server/protocols/webadmin-integration-test/pom.xml |   1 +
 .../postgres-webadmin-integration-test/pom.xml | 114 ++
 ...PostgresDeletedMessageVaultIntegrationTest.java | 131 +
 .../src/test/resources/dnsservice.xml  |  25 
 .../src/test/resources/domainlist.xml  |  24 
 .../src/test/resources/imapserver.xml  |  41 +++
 .../src/test/resources/jwt_publickey   |   9 ++
 .../src/test/resources/listeners.xml   |  49 
 .../src/test/resources/lmtpserver.xml  |  23 
 .../src/test/resources/mailetcontainer.xml | 117 ++
 .../src/test/resources/mailrepositorystore.xml |  31 +
 .../src/test/resources/managesieveserver.xml   |  32 +
 .../src/test/resources/pop3server.xml  |  23 
 .../src/test/resources/smtpserver.xml  |  54 +
 .../src/test/resources/webadmin.properties |  27 +
 18 files changed, 714 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index cb220daa6e..b2be2d09b9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,6 +45,7 @@ pipeline {
 'server/container/guice/postgres-common,' +
 'server/container/guice/mailbox-postgres,' +
 'server/apps/postgres-app,' +
+
'server/protocols/webadmin-integration-test/postgres-webadmin-integration-test,'
 +
 'mpt/impl/imap-mailbox/postgres,' +
 'event-bus/postgres,' +
 'mailbox/plugin/deleted-messages-vault-postgres'
diff --git a/pom.xml b/pom.xml
index d36c4280e1..7f9582eb68 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1760,6 +1760,17 @@
 james-server-onami
 ${project.version}
 
+
+${james.groupId}
+james-server-postgres-app
+${project.version}
+
+
+${james.groupId}
+james-server-postgres-app
+${project.version}
+test-jar
+
 
 ${james.groupId}
 james-server-protocols-imap4
diff --git 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
index fd07cc23ac..5da7524604 100644
--- 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
+++ 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
@@ -127,7 +127,7 @@ public class PostgresJamesServerMain implements 
JamesServerMain {
 JamesServerMain.main(server);
 }
 
-static GuiceJamesServer createServer(PostgresJamesConfiguration 
configuration) {
+public static GuiceJamesServer createServer(PostgresJamesConfiguration 
configuration) {
 SearchConfiguration searchConfiguration = 
configuration.searchConfiguration();
 
 return GuiceJamesServer.forConfiguration(configuration)
diff --git a/server/protocols/webadmin-integration-test/pom.xml 
b/server/protocols/webadmin-integration-test/pom.xml
index ea9509f515..f3bd318799 100644
--- a/server/protocols/webadmin-integration-test/pom.xml
+++ b/server/protocols/webadmin-integration-test/pom.xml
@@ -35,6 +35,7 @@
 
 distributed-webadmin-integration-test
 memory-webadmin-integration-test
+postgres-webadmin-integration-test
 webadmin-integration-test-common
 
 
diff --git 
a/server/protocols/webadmin-integration-test/postgres-webadmin-integration-test/pom.xml
 
b/server/protocols/webadmin-integration-test/postgres-webadmin-integration-test/pom.xml
new file mode 100644
index 00..3bed95cec3
--- /dev/null
+++ 
b/server/protocols/webadmin-integration-test/postgres-webadmin-integration-test/pom.xml
@@ -0,0 +1,114 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+4.0.0
+
+
+org.apache.james
+webadmin-integration-test
+3.9.0-SNAPSHOT
+../pom.xml
+
+
+postgres-webadmin-integration-test
+jar
+
+Apache Ja

(james-project) 03/05: JAMES-2586 Plug DeletedMessageVaultDeletionCallback into DeleteMessageListener

2024-01-09 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

commit de96f76fd9f562cfd2dfebacee7b3858a3716af5
Author: Quan Tran 
AuthorDate: Mon Jan 8 10:27:48 2024 +0700

JAMES-2586 Plug DeletedMessageVaultDeletionCallback into 
DeleteMessageListener

missing attachment metadata though -> need to do it in 
https://github.com/linagora/james-project/issues/5011
---
 .../plugin/deleted-messages-vault-postgres/pom.xml |   4 +
 .../DeletedMessageVaultDeletionCallback.java   | 123 +
 .../mailbox/postgres/DeleteMessageListener.java|  52 ++---
 .../postgres/mail/MessageRepresentation.java   | 113 +++
 .../postgres/mail/dao/PostgresMessageDAO.java  |  27 -
 .../postgres/DeleteMessageListenerContract.java|   8 +-
 .../postgres/PostgresMailboxManagerProvider.java   |   5 +-
 .../mailbox/PostgresDeletedMessageVaultModule.java |   6 +
 .../modules/mailbox/PostgresMailboxModule.java |   1 +
 9 files changed, 319 insertions(+), 20 deletions(-)

diff --git a/mailbox/plugin/deleted-messages-vault-postgres/pom.xml 
b/mailbox/plugin/deleted-messages-vault-postgres/pom.xml
index 103fd725b4..856b49aa56 100644
--- a/mailbox/plugin/deleted-messages-vault-postgres/pom.xml
+++ b/mailbox/plugin/deleted-messages-vault-postgres/pom.xml
@@ -54,6 +54,10 @@
 apache-james-mailbox-memory
 test
 
+
+${james.groupId}
+apache-james-mailbox-postgres
+
 
 ${james.groupId}
 james-server-guice-common
diff --git 
a/mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/DeletedMessageVaultDeletionCallback.java
 
b/mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/DeletedMessageVaultDeletionCallback.java
new file mode 100644
index 00..18a7027c46
--- /dev/null
+++ 
b/mailbox/plugin/deleted-messages-vault-postgres/src/main/java/org/apache/james/vault/metadata/DeletedMessageVaultDeletionCallback.java
@@ -0,0 +1,123 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.vault.metadata;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.SequenceInputStream;
+import java.time.Clock;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.util.Optional;
+import java.util.Set;
+
+import javax.inject.Inject;
+
+import org.apache.james.blob.api.BlobStore;
+import org.apache.james.core.MailAddress;
+import org.apache.james.core.MaybeSender;
+import org.apache.james.core.Username;
+import org.apache.james.mailbox.model.MailboxId;
+import org.apache.james.mailbox.model.MessageId;
+import org.apache.james.mailbox.postgres.DeleteMessageListener;
+import org.apache.james.mailbox.postgres.mail.MessageRepresentation;
+import org.apache.james.mime4j.MimeIOException;
+import org.apache.james.mime4j.codec.DecodeMonitor;
+import org.apache.james.mime4j.dom.Message;
+import org.apache.james.mime4j.dom.address.Mailbox;
+import org.apache.james.mime4j.message.DefaultMessageBuilder;
+import org.apache.james.mime4j.stream.MimeConfig;
+import org.apache.james.server.core.Envelope;
+import org.apache.james.vault.DeletedMessage;
+import org.apache.james.vault.DeletedMessageVault;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.github.fge.lambdas.Throwing;
+import com.google.common.collect.ImmutableSet;
+
+import reactor.core.publisher.Mono;
+
+public class DeletedMessageVaultDeletionCallback implements 
DeleteMessageListener.DeletionCallback {
+private static final Logger LOGGER = 
LoggerFactory.getLogger(DeletedMessageVaul

(james-mime4j) branch master updated: Refresh changelog (#92)

2024-01-08 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 a069e1e2 Refresh changelog (#92)
a069e1e2 is described below

commit a069e1e22cef144a69489a33c0127a083efe759a
Author: Benoit TELLIER 
AuthorDate: Tue Jan 9 08:09:33 2024 +0100

Refresh changelog (#92)
---
 CHANGELOG.md | 12 
 1 file changed, 12 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5887215..af190276 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,18 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/)
 
 ## [UNRELEASED]
 
+Bug fixes:
+
+ - Prevent header injection with MIME4J DOM
+ - MIME4J-325 DateTimeParser should throw ParseException if value can't be 
parsed (#88)
+ - MIME4J-324 Handle URL parsing exception in LenientContentDispositionField
+
+Performance:
+
+ - ContentTypeFieldLenientImpl: clear is not needed (#86)
+ - MIME4J-322 Use ArrayDeque in MimeTokenStream
+ - MIME4J-324 Avoid an extra copy of ContentDispositionFieldLenientImpl 
parameters
+
 ## [0.8.9] - 2022-12-30
 
 Bug fixes:


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



(james-project) annotated tag james-project-3.7.5 updated (2105c1ede6 -> b85fb6adf4)

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

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


*** WARNING: tag james-project-3.7.5 was modified! ***

from 2105c1ede6 (commit)
  to b85fb6adf4 (tag)
 tagging 2105c1ede6e0a51190976bf3288fd5ddc4e9bf89 (commit)
 replaces james-project-3.7.4
  by Benoit TELLIER
  on Mon Jan 8 21:39:24 2024 +0100

- Log -
[maven-release-plugin] copy for tag james-project-3.7.5
---


No new revisions were added by this update.

Summary of changes:


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



(james-project) branch 3.7.x updated (3b4a6ca840 -> 47a520f263)

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

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


 discard 3b4a6ca840 [maven-release-plugin] prepare for next development 
iteration
 discard e637103f3f [maven-release-plugin] prepare release james-project-3.7.5

This update removed existing revisions from the reference, leaving the
reference pointing at a previous point in the repository history.

 * -- * -- N   refs/heads/3.7.x (47a520f263)
\
 O -- O -- O   (3b4a6ca840)

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:
 backends-common/cassandra/pom.xml   | 2 +-
 backends-common/elasticsearch-v7/pom.xml| 2 +-
 backends-common/jpa/pom.xml | 2 +-
 backends-common/pom.xml | 2 +-
 backends-common/pulsar/pom.xml  | 2 +-
 backends-common/rabbitmq/pom.xml| 2 +-
 core/pom.xml| 2 +-
 event-bus/api/pom.xml   | 2 +-
 event-bus/cassandra/pom.xml | 2 +-
 event-bus/distributed/pom.xml   | 2 +-
 event-bus/in-vm/pom.xml | 2 +-
 event-bus/pom.xml   | 2 +-
 event-sourcing/event-sourcing-core/pom.xml  | 2 +-
 event-sourcing/event-sourcing-pojo/pom.xml  | 2 +-
 event-sourcing/event-store-api/pom.xml  | 2 +-
 event-sourcing/event-store-cassandra/pom.xml| 2 +-
 event-sourcing/event-store-memory/pom.xml   | 2 +-
 event-sourcing/pom.xml  | 2 +-
 examples/custom-james-assembly/pom.xml  | 2 +-
 examples/custom-listeners/pom.xml   | 2 +-
 examples/custom-mailets/pom.xml | 2 +-
 examples/custom-smtp-command/pom.xml| 2 +-
 examples/custom-smtp-hooks/pom.xml  | 2 +-
 examples/custom-webadmin-route/pom.xml  | 2 +-
 examples/pom.xml| 2 +-
 javax-mail-extension/pom.xml| 2 +-
 json/pom.xml| 2 +-
 mailbox/api/pom.xml | 2 +-
 mailbox/backup/pom.xml  | 2 +-
 mailbox/cassandra/pom.xml   | 2 +-
 mailbox/elasticsearch-v7/pom.xml| 2 +-
 mailbox/event/json/pom.xml  | 2 +-
 mailbox/jpa/pom.xml | 2 +-
 mailbox/lucene/pom.xml  | 2 +-
 mailbox/memory/pom.xml  | 2 +-
 mailbox/plugin/deleted-messages-vault-cassandra/pom.xml | 2 +-
 mailbox/plugin/deleted-messages-vault/pom.xml   | 2 +-
 mailbox/plugin/quota-mailing-cassandra/pom.xml  | 2 +-
 mailbox/plugin/quota-mailing-memory/pom.xml | 2 +-
 mailbox/plugin/quota-mailing/pom.xml| 2 +-
 mailbox/plugin/quota-search-elasticsearch-v7/pom.xml| 2 +-
 mailbox/plugin/quota-search-scanning/pom.xml| 2 +-
 mailbox/plugin/quota-search/pom.xml | 2 +-
 mailbox/plugin/spamassassin/pom.xml | 2 +-
 mailbox/pom.xml | 2 +-
 mailbox/scanning-search/pom.xml | 2 +-
 mailbox/spring/pom.xml  | 2 +-
 mailbox/store/pom.xml   | 2 +-
 mailbox/tika/pom.xml| 2 +-
 mailbox/tools/copier/pom.xml| 2 +-
 mailbox/tools/indexer/pom.xml   | 2 +-
 mailbox/tools/jpa-migrator/pom.xml  | 2 +-
 mailbox/tools/quo

(james-project) annotated tag james-project-3.7.5 deleted (was 337ee97bdc)

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

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


*** WARNING: tag james-project-3.7.5 was deleted! ***

   tag was  337ee97bdc

The revisions that were on this annotated tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.


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



(james-project) annotated tag james-project-3.7.5 updated (e637103f3f -> 337ee97bdc)

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

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


*** WARNING: tag james-project-3.7.5 was modified! ***

from e637103f3f (commit)
  to 337ee97bdc (tag)
 tagging e637103f3f31549e98c7529fba024fb192569a3b (commit)
 replaces james-project-3.7.4
  by Benoit TELLIER
  on Mon Jan 8 18:10:06 2024 +0100

- Log -
[maven-release-plugin] copy for tag james-project-3.7.5
---


No new revisions were added by this update.

Summary of changes:


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



svn commit: r66474 - /release/james/server/3.8.1/

2024-01-08 Thread btellier
Author: btellier
Date: Mon Jan  8 16:29:12 2024
New Revision: 66474

Log:
James 3.8.1 release materials

Added:
release/james/server/3.8.1/
release/james/server/3.8.1/james-server-cassandra-guice.zip   (with props)
release/james/server/3.8.1/james-server-cassandra-guice.zip.asc   (with 
props)
release/james/server/3.8.1/james-server-cassandra-guice.zip.sha512
release/james/server/3.8.1/james-server-distributed-app.zip   (with props)
release/james/server/3.8.1/james-server-distributed-app.zip.asc   (with 
props)
release/james/server/3.8.1/james-server-distributed-app.zip.sha512
release/james/server/3.8.1/james-server-distributed-guice.zip   (with props)
release/james/server/3.8.1/james-server-distributed-guice.zip.asc   (with 
props)
release/james/server/3.8.1/james-server-distributed-guice.zip.sha512
release/james/server/3.8.1/james-server-jpa-guice.zip   (with props)
release/james/server/3.8.1/james-server-jpa-guice.zip.asc   (with props)
release/james/server/3.8.1/james-server-jpa-guice.zip.sha512
release/james/server/3.8.1/james-server-spring-app-3.8.1-app.zip   (with 
props)
release/james/server/3.8.1/james-server-spring-app-3.8.1-app.zip.asc   
(with props)
release/james/server/3.8.1/james-server-spring-app-3.8.1-app.zip.sha512

Added: release/james/server/3.8.1/james-server-cassandra-guice.zip
==
Binary file - no diff available.

Propchange: release/james/server/3.8.1/james-server-cassandra-guice.zip
--
svn:mime-type = application/octet-stream

Added: release/james/server/3.8.1/james-server-cassandra-guice.zip.asc
==
Binary file - no diff available.

Propchange: release/james/server/3.8.1/james-server-cassandra-guice.zip.asc
--
svn:mime-type = application/octet-stream

Added: release/james/server/3.8.1/james-server-cassandra-guice.zip.sha512
==
--- release/james/server/3.8.1/james-server-cassandra-guice.zip.sha512 (added)
+++ release/james/server/3.8.1/james-server-cassandra-guice.zip.sha512 Mon Jan  
8 16:29:12 2024
@@ -0,0 +1 @@
+b63aa16abba3b35da817acfdcac7e552066a952fc4941f772837ca080a61432bcd70a4f756434f64495f1caf39be2c15d16bfb2dc470519024290b317dbe219e
  james-server-cassandra-guice.zip

Added: release/james/server/3.8.1/james-server-distributed-app.zip
==
Binary file - no diff available.

Propchange: release/james/server/3.8.1/james-server-distributed-app.zip
--
svn:mime-type = application/octet-stream

Added: release/james/server/3.8.1/james-server-distributed-app.zip.asc
==
Binary file - no diff available.

Propchange: release/james/server/3.8.1/james-server-distributed-app.zip.asc
--
svn:mime-type = application/octet-stream

Added: release/james/server/3.8.1/james-server-distributed-app.zip.sha512
==
--- release/james/server/3.8.1/james-server-distributed-app.zip.sha512 (added)
+++ release/james/server/3.8.1/james-server-distributed-app.zip.sha512 Mon Jan  
8 16:29:12 2024
@@ -0,0 +1 @@
+fc77d47bcc92b1c686b42ba4c55d3fd6df0fcc1e9bdc2837344002e10e66384c3d6329ae0cf5f54a6661c5551e77b0a31fab2a7f98e192c60b7a76ea46f8deb1
  james-server-distributed-app.zip

Added: release/james/server/3.8.1/james-server-distributed-guice.zip
==
Binary file - no diff available.

Propchange: release/james/server/3.8.1/james-server-distributed-guice.zip
--
svn:mime-type = application/octet-stream

Added: release/james/server/3.8.1/james-server-distributed-guice.zip.asc
==
Binary file - no diff available.

Propchange: release/james/server/3.8.1/james-server-distributed-guice.zip.asc
--
svn:mime-type = application/octet-stream

Added: release/james/server/3.8.1/james-server-distributed-guice.zip.sha512
==
--- release/james/server/3.8.1/james-server-distributed-guice.zip.sha512 (added)
+++ release/james/server/3.8.1/james-server-distributed-guice.zip.sha512 Mon 
Jan  8 16:29:12 2024
@@ -0,0 +1

(james-project) annotated tag james-project-3.8.1 updated (e71dd84c74 -> d765168f2a)

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

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


*** WARNING: tag james-project-3.8.1 was modified! ***

from e71dd84c74 (commit)
  to d765168f2a (tag)
 tagging e71dd84c74c367a5f5e30bf67c11225c4f9ac5a0 (commit)
 replaces james-project-3.8.0
  by Benoit TELLIER
  on Mon Jan 8 16:27:28 2024 +0100

- Log -
[maven-release-plugin] copy for tag james-project-3.8.1
---


No new revisions were added by this update.

Summary of changes:


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



svn commit: r66468 - /release/james/mime4j/0.8.8/

2024-01-08 Thread btellier
Author: btellier
Date: Mon Jan  8 14:23:02 2024
New Revision: 66468

Log:
Archive Mime4j 0.8.8

Removed:
release/james/mime4j/0.8.8/


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



svn commit: r66467 - /release/james/mime4j/0.8.10/

2024-01-08 Thread btellier
Author: btellier
Date: Mon Jan  8 14:22:33 2024
New Revision: 66467

Log:
Apache Mime4J 0.8.10 release materials

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

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

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

Added: release/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.asc
==
--- release/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.asc (added)
+++ release/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.asc Mon Jan  8 
14:22:33 2024
@@ -0,0 +1,16 @@
+-BEGIN PGP SIGNATURE-
+
+iQIzBAABCgAdFiEE0C30riI0HNMhVtUjOOLTh5/fcLYFAmWcBI4ACgkQOOLTh5/f
+cLblzw/+LknSd5BBZsAkTPzVkUu2eahKH9tZY0kzDWbwnwiVX6oDaGEPoOlntuiC
+J7/B6Qkg/p/WAMXvg4NTEL4y6cG4ecbX6S2iH/CsUyToMLZrMPOwmQZrJb2PCOO2
+K1LsFPYVdJWWUA7ZbXsmV8e2Zt7b8Aarcw3IN8CzpI06/guNJPdwx4jwgfg9U7yP
+19ekfcAhQfw4D0Xop48Bt7YjKmfJM4+21yLlJyF7BcobUh+59X6ENArq0u9k+Bp8
+MTOfM/fEvvSEcC/4A8DOptUTiue83/9yPjQ9UIg8R71+E2jXDIJlZaV4iAYaaC5Q
+ZH9u0ApcJ8cob4pLA+P40NBnaEQcu3vwfhNSsh5keEuZZbDHGYSeKUQoLkmu7bGh
+rDWZLQyChuBDotzYxCr9fOP5xu9RCzrge/pK1Hl45b2WomLrWL8LDXIQHu5rK1mO
+06UytPTTFjl+H5Yx6Bw4R0JAlEYEGTLnm0bqBFKf1FxD6K6zxxjpF/RnXYfy1rN7
+SZ74117Zh9/qTIT60h0juNGKVJtZ57jzVxdcYJLRr9Ta8jE02Hp4RqF0G4IoQq1C
+UrKfPwq7/qeM+YjZMalwnX14WcMSmurIcM81a0rPwWxG+gHdVXxl0gF7cqmmhOhP
+fCH5bUR5YQ3GkVHBn3QnHJSwPS56sxtbzCy6yrtOwwazy90wXMc=
+=oOm1
+-END PGP SIGNATURE-

Added: release/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.sha512
==
--- release/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.sha512 (added)
+++ release/james/mime4j/0.8.10/apache-mime4j-0.8.10-bin.zip.sha512 Mon Jan  8 
14:22:33 2024
@@ -0,0 +1 @@
+01f27333c68dec7bec22a1a6c7b53012fce757a76f7a27fb430ae129377ea78cf898ad0906db48adfb0e00e7c9a05a4fb6d38d2b755b6bef0892a0549ed27f46
  apache-mime4j-0.8.10-bin.zip

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

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

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

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

Added: release/james/mime4j/0.8.10/apache-mime4j-core-0.8.10.jar.sha512
==
--- release/james/mime4j/0.8.10/apache-mime4j-core-0.8.10.jar.sha512 (added)
+++ release/james/mime4j/0.8.10/apache-mime4j-core-0.8.10.jar.sha512 Mon Jan  8 
14:22:33 2024
@@ -0,0 +1 @@
+4659f904e36c51c111d3e0c2261661697e60a01d5102bcc4bd798ae3837564f5e4112b0c2292840f4733fee0ea75ec5f6329adb885f1586f6779a477ae3472a6
  apache-mime4j-core-0.8.10.jar

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

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

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

Propchange: release/james/mime4j/0.8.10/apache-mime4j-dom-0.8.10.jar.asc

(james-mime4j) annotated tag apache-mime4j-project-0.8.10 updated (e4278a55 -> 0eccebbb)

2024-01-08 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.10
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git


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

from e4278a55 (commit)
  to 0eccebbb (tag)
 tagging e4278a55e70da172f7dfb51d73747ac453a7b738 (commit)
 replaces apache-mime4j-project-0.8.9
  by Benoit TELLIER
  on Mon Jan 8 14:53:43 2024 +0100

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


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 0.8.10-x updated: [maven-release-plugin] prepare for next development iteration

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

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


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

commit 097f4f76af1559fd31e4242ec86e396a0b0f0f04
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 14:53:46 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 4b18dd45..8a7607b5 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 3f299d62..f612b5a5 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index 0ef30932..d7a7fa1e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index 865ce6ab..d2cba7bc 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 0bc27515..2d02382d 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 177ff127..d5c69bd7 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 55faae57..d55c0e0d 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index 02f6ecf8..60ef7b43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-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.10
+  HEAD
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index a0b40f7c..84c5b817 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-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) branch 0.8.10-x created (now e4278a55)

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

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


  at e4278a55 [maven-release-plugin] prepare release 
apache-mime4j-project-0.8.10

This branch includes the following new commits:

 new e4278a55 [maven-release-plugin] prepare release 
apache-mime4j-project-0.8.10

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

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

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

commit e4278a55e70da172f7dfb51d73747ac453a7b738
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 14:52:34 2024 +0100

[maven-release-plugin] prepare release apache-mime4j-project-0.8.10
---
 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 6c29e3fc..4b18dd45 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 88abaa2e..3f299d62 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index f0fba5dd..0ef30932 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index 8c469fd6..865ce6ab 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 7ff40b04..0bc27515 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 4a035c76..177ff127 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 8a0410b5..55faae57 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index 85266f3a..02f6ecf8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 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.10
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index a7463f10..a0b40f7c 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../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.10 deleted (was 5c16c827)

2024-01-08 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.10
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git


*** WARNING: tag apache-mime4j-project-0.8.10 was deleted! ***

   tag was  5c16c827

The revisions that were on this annotated tag are still contained in
other references; therefore, this change does not discard any commits
from the repository.


-
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 mime4j-project-0.8.10 deleted (was b36ec8bc)

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

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


*** WARNING: tag mime4j-project-0.8.10 was deleted! ***

   tag was  b36ec8bc

This change permanently discards the following revisions:

 discard 02fcb31b [maven-release-plugin] prepare release mime4j-project-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-mime4j) branch 0.8.10-x deleted (was f4a2df4f)

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

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


 was f4a2df4f [maven-release-plugin] prepare for next development iteration

This change permanently discards the following revisions:

 discard f4a2df4f [maven-release-plugin] prepare for next development iteration


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



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

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

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


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

commit f4a2df4f6bc8eb2dcd9752b7b525b008fed5f86b
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 14:46:20 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 4b18dd45..8a7607b5 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 3f299d62..f612b5a5 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index 0ef30932..d7a7fa1e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index 865ce6ab..d2cba7bc 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 0bc27515..2d02382d 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 177ff127..d5c69bd7 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 55faae57..d55c0e0d 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index f658051f..60ef7b43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-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
-  mime4j-project-0.8.10
+  HEAD
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index a0b40f7c..84c5b817 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-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 mime4j-project-0.8.10 updated (02fcb31b -> b36ec8bc)

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

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


*** WARNING: tag mime4j-project-0.8.10 was modified! ***

from 02fcb31b (commit)
  to b36ec8bc (tag)
 tagging 02fcb31b64a1bd01881174a670894404c8978c97 (commit)
 replaces apache-mime4j-project-0.8.9
  by Benoit TELLIER
  on Mon Jan 8 14:46:16 2024 +0100

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


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) 01/01: [maven-release-plugin] prepare release mime4j-project-0.8.10

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

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

commit 02fcb31b64a1bd01881174a670894404c8978c97
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 14:46:03 2024 +0100

[maven-release-plugin] prepare release mime4j-project-0.8.10
---
 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 6c29e3fc..4b18dd45 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 88abaa2e..3f299d62 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index f0fba5dd..0ef30932 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index 8c469fd6..865ce6ab 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 7ff40b04..0bc27515 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 4a035c76..177ff127 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 8a0410b5..55faae57 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index 85266f3a..f658051f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 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
+  mime4j-project-0.8.10
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index a7463f10..a0b40f7c 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../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) branch 0.8.10-x created (now 02fcb31b)

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

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


  at 02fcb31b [maven-release-plugin] prepare release mime4j-project-0.8.10

This branch includes the following new commits:

 new 02fcb31b [maven-release-plugin] prepare release mime4j-project-0.8.10

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) branch ref-ch-log created (now ada329f0)

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

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


  at ada329f0 [maven-release-plugin] prepare release 
apache-mime4j-project-0.8.10

This branch includes the following new commits:

 new ada329f0 [maven-release-plugin] prepare release 
apache-mime4j-project-0.8.10

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) branch ref-ch-log updated: [maven-release-plugin] prepare for next development iteration

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

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


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

commit eaea0be50a5d14b0e51d34291abb5d66ea2a35e3
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 14:19:54 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 4b18dd45..8a7607b5 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 3f299d62..f612b5a5 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index 0ef30932..d7a7fa1e 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index 865ce6ab..d2cba7bc 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 0bc27515..2d02382d 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 177ff127..d5c69bd7 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 55faae57..d55c0e0d 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-SNAPSHOT
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index 02f6ecf8..60ef7b43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10
+0.8.11-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.10
+  HEAD
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index a0b40f7c..84c5b817 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10
+0.8.11-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.10 updated (ada329f0 -> 5c16c827)

2024-01-08 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.10
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git


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

from ada329f0 (commit)
  to 5c16c827 (tag)
 tagging ada329f08ccd620f2143623bf8c85d7d33af7c16 (commit)
 replaces apache-mime4j-project-0.8.9
  by Benoit TELLIER
  on Mon Jan 8 14:19:51 2024 +0100

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


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) 01/01: [maven-release-plugin] prepare release apache-mime4j-project-0.8.10

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

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

commit ada329f08ccd620f2143623bf8c85d7d33af7c16
Author: Benoit TELLIER 
AuthorDate: Mon Jan 8 14:19:38 2024 +0100

[maven-release-plugin] prepare release apache-mime4j-project-0.8.10
---
 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 6c29e3fc..4b18dd45 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/benchmark/pom.xml b/benchmark/pom.xml
index 88abaa2e..3f299d62 100644
--- a/benchmark/pom.xml
+++ b/benchmark/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/core/pom.xml b/core/pom.xml
index f0fba5dd..0ef30932 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/dom/pom.xml b/dom/pom.xml
index 8c469fd6..865ce6ab 100644
--- a/dom/pom.xml
+++ b/dom/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/examples/pom.xml b/examples/pom.xml
index 7ff40b04..0bc27515 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/james-utils/pom.xml b/james-utils/pom.xml
index 4a035c76..177ff127 100644
--- a/james-utils/pom.xml
+++ b/james-utils/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/mbox/pom.xml b/mbox/pom.xml
index 8a0410b5..55faae57 100644
--- a/mbox/pom.xml
+++ b/mbox/pom.xml
@@ -23,7 +23,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 
diff --git a/pom.xml b/pom.xml
index 85266f3a..02f6ecf8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
 org.apache.james
 apache-mime4j-project
-0.8.10-SNAPSHOT
+0.8.10
 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.10
   
 
 http://issues.apache.org/jira/browse/MIME4J
diff --git a/storage/pom.xml b/storage/pom.xml
index a7463f10..a0b40f7c 100644
--- a/storage/pom.xml
+++ b/storage/pom.xml
@@ -23,7 +23,7 @@
 
 apache-mime4j-project
 org.apache.james
-0.8.10-SNAPSHOT
+0.8.10
 ../pom.xml
 
 


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



svn commit: r66466 - /release/james/KEYS

2024-01-08 Thread btellier
Author: btellier
Date: Mon Jan  8 13:18:51 2024
New Revision: 66466

Log:
Add a new private key for my new laptop

Modified:
release/james/KEYS

Modified: release/james/KEYS
==
--- release/james/KEYS (original)
+++ release/james/KEYS Mon Jan  8 13:18:51 2024
@@ -1649,3 +1649,62 @@ H7gj7MuoDhV6cdoqIdW7qvgSMwkMXAhWH/TWk7sZ
 zNKJHLHBBKZTIkvF+diAh+BdnmAY+gU8LBI=
 =gP+0
 -END PGP PUBLIC KEY BLOCK-
+
+pub   rsa4096 2024-01-08 [SC]
+  D02DF4AE22341CD32156D52338E2D3879FDF70B6
+uid   [ultimate] Benoit TELLIER 
+sig 338E2D3879FDF70B6 2024-01-08  Benoit TELLIER 
+sub   rsa4096 2024-01-08 [E]
+sig  38E2D3879FDF70B6 2024-01-08  Benoit TELLIER 
+
+-BEGIN PGP PUBLIC KEY BLOCK-
+
+mQINBGWb9LABEAC7ZvPj9qShlzCtgQjLQsrfyVaFLIe5R7Mgyi8pddna6jNBgQpt
+I+KeeU5oURe8NkGpMwIykyCctt2AJZvAq+Fh12flJer8d4q+SdWTFG68el+ackzr
+7cDUZfG3Eu+L2Zsn5EG4yWpJ/JxSKaj/hbImNXP+rWeQsewn2QUq9OwAc1KfPZZD
+gsSxv5CKIOGsomHNyrx1olo4D97sfJv24T4HZuYS0If+iwsbhPgEL9fo0C87joHf
+FTLn+uLZbYbOX1feUY3lUddCLck2qpF/bB2Bk+asDXa30SAdyQ9WNNKRqQAa+Di5
+fBQF9CI2iaLkDf0DZAEqt3YFHQ2X30Vl7BIyAcPb2zZC6ICpbLqN6RhAIF0UjCbU
+PUCyLfUxpUU2kNQ1YM4TrnyKIBsHHO/YsGNXYs8Ac07pDe5Rod9btfdJhUkmBJA2
+ZF5dycsEbFlHXxMmXPr4Mla3mtEvd+89rDUqiAf0Ka1F/Ay3kpIjuaWBv+7qmWJL
+NgvzbDv90fCobD2ICEqBMhjqUf5/0cFTB5cwGN5/zzlTVc98k3FrORSGszkTieJl
+6OkWxJrKGDlqcgzVgck7KMaZQaHp4/IfHFKKRrexq1CIKLhdclFguR3P3FsoTItL
+3+tWCraUezV3yHQEAx44cM+RlkIcW8+L7pn4xlRd3AA6RpVcIRmIEZJ1+wARAQAB
+tCRCZW5vaXQgVEVMTElFUiA8YnRlbGxpZXJAYXBhY2hlLm9yZz6JAk4EEwEKADgW
+IQTQLfSuIjQc0yFW1SM44tOHn99wtgUCZZv0sAIbAwULCQgHAgYVCgkICwIEFgID
+AQIeAQIXgAAKCRA44tOHn99wtrrXD/9a9bat/t0Q/o9SWZpSe8UIH8UYVoi0emcv
+eT27U/vI5fXD2hfuFCWPNuci4Cxt6whJb8Josh5q+hGTcDt9NwDhNojwCt1QgB67
+60JusvrLnq2ak9Qa0KGpEk9lOWRtz9898ueZeLz9o2mIFPBTe2ErbBLIHS6E4H5F
+rLCipVuWwv+O6K35FitErpoN5+rjYnwrRcG3HAbY76Cp2gmjh56LfnLsH+0FHKp3
+mBUPV0IJr8I6YbF7gs/EcHT8glaQACagJ5MOxDVZ0+Uxu9cOTxIIFWHTZI9wPA1c
+VnxRgphGpqbu3OCX60j73CX8UB3MsB9jXU3poHLhD0y3yxDi0fqT1Suio3DQGnL9
+RTtpimg/YHOtOR/hAKjER3AuvCPBQOIYUpj1LWz5k4RRDLM9n/hBF9GqDs/dtMUw
+e7mKARuB/n0+FepsCQorb0W9aM2sHxuwJNyu+I4pEnKF4fEwuslDiz7muAWwin6U
+Iq2s7pB4dCjN193pd8BjmmuojzqTAeVO97Vgun8oGyi9ycq7VtodbkDpolFOdGx5
+4EhNtCf3riH+5Pa95RTq16kOoNeNc1CVNs2iN6Y8Eo7+vjLRK1Og1l3czAs7TqAa
+sIvy+d1yA9jOtgOwSw07+n29ky0zNzTvGHc8RBuTTvHMwpi5+KxYdYneSyRepg25
+vnQUKUCz8bkCDQRlm/SwARAAvl7CFpMXSEh1VhPus48BWLdyEXjnYdR5RgTA0Tzy
+5+TTpAPAyy5i5Hj6RKxa8lMXWxoW+VZekDbd1NIOP6jO3uihlLsdkVYSP4meMZOT
+YVaPxgRHhE24ltA19bj4RZMq8zGGf/BN9v5siNTuMswmiQBkJLDzbNZ4y85UYzJy
+ko7f/tnTxhmXXM0racPFfY5tpgJHuUvAtgA4WMyonH4TikY5IsW33zvIW3SQ3lW9
+U7JaWpdomFSdrqtFSSWpoZcKXjzgoLTxXgKLnJzL/rCIkudwj2uMjmhzn4kJU9jn
+2Y1hdVHWIsOL1ZxXTrMFxz0ApM99h8a4i05DDqxoLmi3T9saIFU6b4ym1Rt9uMZ6
+wbjhB8TiRQ20ZFzVNj4JfAabQXcizoK4A6h89SainDdXRCd1vwKDgfKJquMdqBxx
+3yyoDf8JsR1Su6ZD8K8wbpMTGz9Gvymju5IZ/K7luI3X8oJjrywNYbf71NMeMVsc
+SIU50svOeCAK1Y5K1qQxvJNScUOBZ1ptnO7oPvuBH5KboM53vNpyxaLZQZfGNesU
+ygU+941Spx91HfxFeJ/Q+OG4FNdFAA+263CkiXB865OrzcVsPzH3MRlptyW3zjy1
+mK5xxdqn3/tYzz2Erafx4LuDWsDx76/gYGUhPB/MYxX2WasLfOabGyj0bDMWps8W
+6wEAEQEAAYkCNgQYAQoAIBYhBNAt9K4iNBzTIVbVIzji04ef33C2BQJlm/SwAhsM
+AAoJEDji04ef33C2Cb0QALBL2sMQLDreTmEJuv5cAUxul8Ssh9Gtcg89AVTu1v7H
+yxPs+UnWuAsK2NN/qXTpHeEnHkLSnujes1zmCvfDDj+1tSTFxhqioMZKhsjy1U3Y
+FZOcgzckgVWZE6+xux37cogk3W20RJBS8OsVtH+Ntwu1+fGAPhMmHEIbr3QKbaMe
+8dashslNmMK/4gMx1y4MVEwtpN7woR/1nZuhe0WqTQIJGCb29YKpzy6lVkUNbZDC
+kl7o/gemtVDs+QOVSR2ZOnztCVc90Ve6oML8KBWEx1MImoO3pmu8q/2uVmpKw50k
+9wvbQdFEYZQFvcY6ACcyEzCM2ZV9mLgbbs99S33Q7gmE8Lyp40AP/uaOcQohH7k8
+nV0946S6+VTA+KYodest6i+A0m40VaJuVNpGnkLSbknVyOshgipOFvjhut7HfJOU
+6O5bekOS3h0dG4NnvVTS2Vagse6tmGr9OZaAii+a30y2PzU6bofutUo6e7YLSxMx
+/vbgsiqHcYfx8gIusg60Ahoy4k0bNMYPyeQyMMXC2zeXmzRSuR5bfNNXVo+psRJ+
+t5zQ78/ZUbztmwCGMt9W6fICZXYcLiJsQktYOZ2nrGBT0c/klIKhfNzah7Mpj4Hl
+lWm6JMilochI7XA0Y4uK54pIXXMVqkluCzaQgIIoAOu1XT2jeflYxM95p1cx/t+5
+=MEf7
+-END PGP PUBLIC KEY BLOCK-



-
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: [FIX] Prevent header injection with MIME4J DOM (#91)

2024-01-04 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 9dec5df2 [FIX] Prevent header injection with MIME4J DOM (#91)
9dec5df2 is described below

commit 9dec5df2a588fed8027839815daefa79ee66efd1
Author: Benoit TELLIER 
AuthorDate: Fri Jan 5 08:12:54 2024 +0100

[FIX] Prevent header injection with MIME4J DOM (#91)
---
 core/pom.xml   |  5 +++
 .../org/apache/james/mime4j/stream/RawField.java   | 23 +
 .../apache/james/mime4j/stream/RawFieldTest.java   | 40 --
 .../mime4j/message/DefaultMessageWriterTest.java   | 11 ++
 4 files changed, 76 insertions(+), 3 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 93d7827b..f0fba5dd 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -42,6 +42,11 @@
 commons-io
 commons-io
 
+
+org.assertj
+assertj-core
+test
+
 
 
 
diff --git a/core/src/main/java/org/apache/james/mime4j/stream/RawField.java 
b/core/src/main/java/org/apache/james/mime4j/stream/RawField.java
index e64c6a73..1be89662 100644
--- a/core/src/main/java/org/apache/james/mime4j/stream/RawField.java
+++ b/core/src/main/java/org/apache/james/mime4j/stream/RawField.java
@@ -56,6 +56,29 @@ public final class RawField implements Field {
 
 public RawField(String name, String body) {
 this(null, -1, name, body);
+
+int pos = 0;
+
+while (true) {
+pos = body.indexOf('\r', pos);
+if (pos < 0) {
+break;
+}
+if (pos < body.length() + 2) {
+if (body.charAt(pos + 1) != '\n') {
+throw new IllegalArgumentException("Injection of 
un-encoded line breaks inside header field could be assimilated to header 
injection");
+}
+if (pos != body.length() - 2 && !isSpace(body, pos + 2)) {
+throw new IllegalArgumentException("Injection of 
un-encoded line breaks inside header field could be assimilated to header 
injection");
+}
+}
+pos ++;
+}
+}
+
+private static boolean isSpace(String body, int pos) {
+return body.charAt(pos) == ' '
+|| body.charAt(pos) == '\t';
 }
 
 public ByteSequence getRaw() {
diff --git 
a/core/src/test/java/org/apache/james/mime4j/stream/RawFieldTest.java 
b/core/src/test/java/org/apache/james/mime4j/stream/RawFieldTest.java
index 5a1cc7da..90d85134 100644
--- a/core/src/test/java/org/apache/james/mime4j/stream/RawFieldTest.java
+++ b/core/src/test/java/org/apache/james/mime4j/stream/RawFieldTest.java
@@ -19,6 +19,9 @@
 
 package org.apache.james.mime4j.stream;
 
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatCode;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
 import junit.framework.Assert;
 import org.apache.james.mime4j.util.ByteSequence;
 import org.apache.james.mime4j.util.ContentUtil;
@@ -45,11 +48,11 @@ public class RawFieldTest {
 Assert.assertEquals("stuff", field1.getBody());
 Assert.assertEquals("raw: stuff", field1.toString());
 
-RawField field2 = new RawField("raw", null);
+RawField field2 = new RawField("raw", "any");
 Assert.assertNull(field2.getRaw());
 Assert.assertEquals("raw", field2.getName());
-Assert.assertEquals(null, field2.getBody());
-Assert.assertEquals("raw: ", field2.toString());
+Assert.assertEquals("any", field2.getBody());
+Assert.assertEquals("raw: any", field2.toString());
 }
 
 @Test
@@ -63,4 +66,35 @@ public class RawFieldTest {
 Assert.assertEquals(s, field.toString());
 }
 
+@Test
+public void shouldRejectAmbiguousLineEnding() {
+assertThatThrownBy(() -> new RawField("Name", 
"Value\r\ncheating")).isInstanceOf(IllegalArgumentException.class);
+}
+
+@Test
+public void shouldAcceptCRLFTerminatedHeader() {
+assertThatCode(() -> new RawField("Name", 
"Value\r\n")).doesNotThrowAnyException();
+}
+
+@Test
+public void shouldAcceptTabFolding() {
+assertThatCode(() -> new RawField("Name", 
"Value\r\n\thello")).doesNotThrowAnyException();
+}
+
+@Test
+public void shouldAcceptSpaceFolding() {
+assertThatCode(() -> new RawField("Name", "Value\r\n 
hello")).doesNotThrowAnyException();
+}
+
+@Test
+public void shouldAcceptOnlyDelimiter() {
+assertThatCode(() -> new RawField("Name&qu

(james-project) branch postgresql updated: JAMES-3777 [FIX] ReadProjection was not correctly used (#1899)

2024-01-04 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 602faa9980 JAMES-3777 [FIX] ReadProjection was not correctly used 
(#1899)
602faa9980 is described below

commit 602faa99808e45e032f8ef2b4d0fcbcc273271cd
Author: Trần Hồng Quân <55171818+quantranhong1...@users.noreply.github.com>
AuthorDate: Fri Jan 5 14:12:17 2024 +0700

JAMES-3777 [FIX] ReadProjection was not correctly used (#1899)
---
 .../filtering/CassandraFilteringProjection.java   |  6 +++---
 ...ntSourcingFilteringManagementNoProjectionTest.java |  5 +
 .../impl/EventSourcingFilteringManagement.java| 19 +++
 .../data/jmap/PopulateFilteringProjectionTask.java|  2 +-
 .../PopulateFilteringProjectionRequestToTaskTest.java |  2 +-
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git 
a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/filtering/CassandraFilteringProjection.java
 
b/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/filtering/CassandraFilteringProjection.java
index 0282d7c683..05294a6fdc 100644
--- 
a/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/filtering/CassandraFilteringProjection.java
+++ 
b/server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/filtering/CassandraFilteringProjection.java
@@ -29,7 +29,6 @@ import static 
org.apache.james.jmap.cassandra.filtering.CassandraFilteringProjec
 
 import java.util.List;
 import java.util.Optional;
-import java.util.function.Function;
 
 import javax.inject.Inject;
 
@@ -54,6 +53,7 @@ import com.datastax.oss.driver.api.core.cql.Row;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
 import com.google.common.collect.ImmutableList;
 
 import reactor.core.publisher.Mono;
@@ -82,7 +82,7 @@ public class CassandraFilteringProjection implements 
EventSourcingFilteringManag
 .whereColumn(AGGREGATE_ID).isEqualTo(bindMarker(AGGREGATE_ID))
 .build());
 
-objectMapper = new ObjectMapper();
+objectMapper = new ObjectMapper().registerModule(new Jdk8Module());
 }
 
 @Override
@@ -107,7 +107,7 @@ public class CassandraFilteringProjection implements 
EventSourcingFilteringManag
 }
 
 @Override
-public Optional subscriber(Function> ruleLoader) {
+public Optional subscriber() {
 return Optional.of(this);
 }
 
diff --git 
a/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/filtering/CassandraEventSourcingFilteringManagementNoProjectionTest.java
 
b/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/filtering/CassandraEventSourcingFilteringManagementNoProjectionTest.java
index abe1636d3b..dbcfe0599e 100644
--- 
a/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/filtering/CassandraEventSourcingFilteringManagementNoProjectionTest.java
+++ 
b/server/data/data-jmap-cassandra/src/test/java/org/apache/james/jmap/cassandra/filtering/CassandraEventSourcingFilteringManagementNoProjectionTest.java
@@ -20,7 +20,6 @@
 package org.apache.james.jmap.cassandra.filtering;
 
 import org.apache.james.backends.cassandra.CassandraClusterExtension;
-import org.apache.james.backends.cassandra.components.CassandraModule;
 import org.apache.james.eventsourcing.eventstore.EventStore;
 import org.apache.james.eventsourcing.eventstore.cassandra.CassandraEventStore;
 import 
org.apache.james.eventsourcing.eventstore.cassandra.CassandraEventStoreModule$;
@@ -34,9 +33,7 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 
 class CassandraEventSourcingFilteringManagementNoProjectionTest implements 
FilteringManagementContract {
 @RegisterExtension
-static CassandraClusterExtension eventStoreExtension = new 
CassandraClusterExtension(CassandraModule.aggregateModules(
-CassandraEventStoreModule$.MODULE$.MODULE(),
-CassandraFilteringProjectionModule.MODULE));
+static CassandraClusterExtension eventStoreExtension = new 
CassandraClusterExtension(CassandraEventStoreModule$.MODULE$.MODULE());
 
 private EventStore eventStore;
 
diff --git 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/filtering/impl/EventSourcingFilteringManagement.java
 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/filtering/impl/EventSourcingFilteringManagement.java
index 08ac0d372f..ff7d6caf43 100644
--- 
a/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/filtering/impl/EventSourcingFilteringManagement.java
+++ 
b/server/data/data-jmap/src/main/java/org/apache/james/jmap/api/

(james-project) branch postgresql updated: JAMES-2586 Adopt Postgres 16.1 (#1897)

2024-01-04 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 e6ff72c754 JAMES-2586 Adopt Postgres 16.1 (#1897)
e6ff72c754 is described below

commit e6ff72c7546d6c8d3de9f02b91540ac3e874e22a
Author: Benoit TELLIER 
AuthorDate: Fri Jan 5 08:12:01 2024 +0100

JAMES-2586 Adopt Postgres 16.1 (#1897)
---
 .../test/java/org/apache/james/backends/postgres/PostgresFixture.java   | 2 +-
 server/apps/postgres-app/docker-compose-distributed.yml | 2 +-
 server/apps/postgres-app/docker-compose.yml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresFixture.java
 
b/backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresFixture.java
index 6c003f7ad9..897943a75c 100644
--- 
a/backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresFixture.java
+++ 
b/backends-common/postgres/src/test/java/org/apache/james/backends/postgres/PostgresFixture.java
@@ -88,7 +88,7 @@ public interface PostgresFixture {
 }
 }
 
-String IMAGE = "postgres:16";
+String IMAGE = "postgres:16.1";
 Integer PORT = POSTGRESQL_PORT;
 Supplier> PG_CONTAINER = () -> new 
PostgreSQLContainer<>(IMAGE)
 .withDatabaseName(DEFAULT_DATABASE.dbName())
diff --git a/server/apps/postgres-app/docker-compose-distributed.yml 
b/server/apps/postgres-app/docker-compose-distributed.yml
index 95bc9b0390..ddf5d3cc94 100644
--- a/server/apps/postgres-app/docker-compose-distributed.yml
+++ b/server/apps/postgres-app/docker-compose-distributed.yml
@@ -49,7 +49,7 @@ services:
   - james
 
   postgres:
-image: postgres:16.0
+image: postgres:16.1
 container_name: postgres
 ports:
   - "5432:5432"
diff --git a/server/apps/postgres-app/docker-compose.yml 
b/server/apps/postgres-app/docker-compose.yml
index c8d5f8f995..50440253bd 100644
--- a/server/apps/postgres-app/docker-compose.yml
+++ b/server/apps/postgres-app/docker-compose.yml
@@ -23,7 +23,7 @@ services:
   - 
./sample-configuration-single/search.properties:/root/conf/search.properties
 
   postgres:
-image: postgres:16.0
+image: postgres:16.1
 ports:
   - "5432:5432"
 environment:


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



(james-project) branch postgresql updated: JAMES-2586 [PGSQL] Guice binding Postgres BlobStore & Adapt to BlobStoreModulesChooser

2024-01-03 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 d279e01dcc JAMES-2586 [PGSQL] Guice binding Postgres BlobStore & Adapt 
to BlobStoreModulesChooser
d279e01dcc is described below

commit d279e01dcc4a78dd5f2e024ed5979a0b41477b00
Author: Tung Tran 
AuthorDate: Wed Dec 27 16:11:35 2023 +0700

JAMES-2586 [PGSQL] Guice binding Postgres BlobStore & Adapt to 
BlobStoreModulesChooser
---
 pom.xml| 10 
 .../james/PostgresBlobStoreIntegrationTest.java| 59 ++
 server/container/guice/blob/postgres/pom.xml   | 53 +++
 .../src/main/java/modules/BlobPostgresModule.java  | 35 +
 server/container/guice/distributed/pom.xml |  4 ++
 .../modules/blobstore/BlobStoreConfiguration.java  |  7 ++-
 .../modules/blobstore/BlobStoreModulesChooser.java | 16 ++
 .../blobstore/BlobStoreConfigurationTest.java  | 17 +++
 server/container/guice/pom.xml |  1 +
 9 files changed, 201 insertions(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 03e3a1a41e..c334da3b23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1169,6 +1169,16 @@
 blob-memory-guice
 ${project.version}
 
+
+${james.groupId}
+blob-postgres
+${project.version}
+
+
+${james.groupId}
+blob-postgres-guice
+${project.version}
+
 
 ${james.groupId}
 blob-s3
diff --git 
a/server/apps/postgres-app/src/test/java/org/apache/james/PostgresBlobStoreIntegrationTest.java
 
b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresBlobStoreIntegrationTest.java
new file mode 100644
index 00..72d8bab747
--- /dev/null
+++ 
b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresBlobStoreIntegrationTest.java
@@ -0,0 +1,59 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james;
+
+import static 
org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT;
+
+import org.apache.james.backends.postgres.PostgresExtension;
+import org.apache.james.modules.blobstore.BlobStoreConfiguration;
+import org.apache.james.modules.protocols.ImapGuiceProbe;
+import org.apache.james.modules.protocols.SmtpGuiceProbe;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+public class PostgresBlobStoreIntegrationTest implements 
MailsShouldBeWellReceived {
+
+@RegisterExtension
+static JamesServerExtension jamesServerExtension = new 
JamesServerBuilder(tmpDir ->
+PostgresJamesConfiguration.builder()
+.workingDirectory(tmpDir)
+.configurationFromClasspath()
+.searchConfiguration(SearchConfiguration.scanning())
+.blobStore(BlobStoreConfiguration.builder()
+.postgres()
+.disableCache()
+.deduplication()
+.noCryptoConfig())
+.usersRepository(DEFAULT)
+.build())
+.server(PostgresJamesServerMain::createServer)
+.extension(PostgresExtension.empty())
+.build();
+
+@Override
+public int imapPort(GuiceJamesServer server) {
+return server.getProbe(ImapGuiceProbe.class).getImapPort();
+}
+
+@Override
+public int smtpPort(GuiceJamesServer server) {
+return server.getProbe(SmtpGuiceProbe.class).getSmtpPort().getValue();
+}
+
+}
\ No newline at end of file
diff --git a/server/container/guice/

(james-project) 02/02: JAMES-2586 Disable concurrent test of PostgresBlobStoreDAO

2024-01-02 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

commit 42ccbca1b8f9b68d2a38137ece3934e511253483
Author: Tung Tran 
AuthorDate: Wed Jan 3 08:33:15 2024 +0700

JAMES-2586 Disable concurrent test of PostgresBlobStoreDAO

- The test is not valid because the upload parallelism with big blobs takes 
time and the test does not waiting for the end of the upload
---
 .../blob/postgres/PostgresBlobStoreDAOTest.java| 22 ++
 1 file changed, 22 insertions(+)

diff --git 
a/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
 
b/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
index c053232632..7ef69a0390 100644
--- 
a/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
+++ 
b/server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java
@@ -47,4 +47,26 @@ class PostgresBlobStoreDAOTest implements 
BlobStoreDAOContract {
 @Disabled("Not supported")
 public void listBucketsShouldReturnBucketsWithNoBlob() {
 }
+
+@Override
+@Disabled("The test is not valid because the upload parallelism with big 
blobs takes time and the test does not waiting for the end of the upload")
+public void concurrentSaveByteSourceShouldReturnConsistentValues(String 
description, byte[] bytes) {
+}
+
+@Override
+@Disabled("The test is not valid because the upload parallelism with big 
blobs takes time and the test does not waiting for the end of the upload")
+public void concurrentSaveInputStreamShouldReturnConsistentValues(String 
description, byte[] bytes) {
+}
+
+@Override
+@Disabled("The test is not valid because the upload parallelism with big 
blobs takes time and the test does not waiting for the end of the upload")
+public void concurrentSaveBytesShouldReturnConsistentValues(String 
description, byte[] bytes) {
+}
+
+@Override
+@Disabled("The test is not valid because the upload parallelism with big 
blobs takes time and the test does not waiting for the end of the upload")
+public void mixingSaveReadAndDeleteShouldReturnConsistentState() {
+}
+
+
 }


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



(james-project) branch postgresql updated (8a85f704f2 -> 42ccbca1b8)

2024-01-02 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 8a85f704f2 JAMES-3817 Only perform JMAP event bus dead letter health 
check if JMAP is used
 new 5c125e46e2 JAMES-2586 Implement PostgresBlobStoreDAO
 new 42ccbca1b8 JAMES-2586 Disable concurrent test of PostgresBlobStoreDAO

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:
 server/blob/{blob-file => blob-postgres}/pom.xml   |  57 +++-
 .../blob/postgres/PostgresBlobStorageModule.java   |  35 ++---
 .../james/blob/postgres/PostgresBlobStoreDAO.java  | 156 +
 .../blob/postgres/PostgresBlobStoreDAOTest.java}   |  38 -
 server/blob/pom.xml|   1 +
 5 files changed, 257 insertions(+), 30 deletions(-)
 copy server/blob/{blob-file => blob-postgres}/pom.xml (70%)
 copy 
event-bus/postgres/src/main/java/org/apache/james/events/PostgresEventDeadLettersModule.java
 => 
server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStorageModule.java
 (62%)
 create mode 100644 
server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStoreDAO.java
 copy 
server/blob/{blob-file/src/test/java/org/apache/james/blob/file/FileBlobStoreDAOTest.java
 => 
blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreDAOTest.java}
 (50%)


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



(james-project) 01/02: JAMES-2586 Implement PostgresBlobStoreDAO

2024-01-02 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

commit 5c125e46e26553580a96ccac075b8cb2c689ce64
Author: hung phan 
AuthorDate: Tue Dec 26 20:51:07 2023 +0700

JAMES-2586 Implement PostgresBlobStoreDAO
---
 server/blob/blob-postgres/pom.xml  | 161 +
 .../blob/postgres/PostgresBlobStorageModule.java   |  62 
 .../james/blob/postgres/PostgresBlobStoreDAO.java  | 156 
 .../blob/postgres/PostgresBlobStoreDAOTest.java|  50 +++
 server/blob/pom.xml|   1 +
 5 files changed, 430 insertions(+)

diff --git a/server/blob/blob-postgres/pom.xml 
b/server/blob/blob-postgres/pom.xml
new file mode 100644
index 00..09ab43e02b
--- /dev/null
+++ b/server/blob/blob-postgres/pom.xml
@@ -0,0 +1,161 @@
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>
+4.0.0
+
+
+org.apache.james
+james-server-blob
+3.9.0-SNAPSHOT
+../pom.xml
+
+
+blob-postgres
+
+Apache James :: Server :: Blob :: Postgres
+
+
+3.16.22
+1.0.2.RELEASE
+
+
+
+
+${james.groupId}
+apache-james-backends-postgres
+
+
+${james.groupId}
+apache-james-backends-postgres
+test-jar
+test
+
+
+${james.groupId}
+blob-api
+
+
+${james.groupId}
+blob-api
+test-jar
+test
+
+
+${james.groupId}
+blob-storage-strategy
+
+
+${james.groupId}
+blob-storage-strategy
+test-jar
+test
+
+
+${james.groupId}
+james-server-guice-common
+test-jar
+test
+
+
+${james.groupId}
+james-server-testing
+test
+
+
+${james.groupId}
+james-server-util
+test
+
+
+${james.groupId}
+metrics-tests
+test
+
+
+${james.groupId}
+testing-base
+test
+
+
+commons-io
+commons-io
+
+
+io.projectreactor
+reactor-core
+
+
+org.awaitility
+awaitility
+test
+
+
+org.jooq
+jooq
+${jooq.version}
+
+
+org.jooq
+jooq-postgres-extensions
+${jooq.version}
+
+
+org.mockito
+mockito-core
+test
+
+
+org.postgresql
+r2dbc-postgresql
+${r2dbc.postgresql.version}
+
+
+org.testcontainers
+junit-jupiter
+test
+
+
+org.testcontainers
+postgresql
+test
+
+
+org.testcontainers
+testcontainers
+test
+
+
+
+
+
+org.apache.maven.plugins
+maven-surefire-plugin
+
+-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
+-Xms1024m -Xmx2048m
+true
+
1800
+
+
+
+
+
+
diff --git 
a/server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStorageModule.java
 
b/server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStorageModule.java
new file mode 100644
index 00..d5eab5e4eb
--- /dev/null
+++ 
b/server/blob/blob-postgres/src/main/java/org/apache/james/blob/postgres/PostgresBlobStorageModule.java
@@ -0,0 +1,62 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You

(james-project) branch 3.7.x updated: [FIX] JMX password auto-detection (#1894)

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

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


The following commit(s) were added to refs/heads/3.7.x by this push:
 new ec277b6b87 [FIX] JMX password auto-detection (#1894)
ec277b6b87 is described below

commit ec277b6b873ba907b38eb73ad2e5fb4567be29f1
Author: Benoit TELLIER 
AuthorDate: Wed Jan 3 07:42:29 2024 +0100

[FIX] JMX password auto-detection (#1894)
---
 server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java 
b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
index eddc34c8ae..5cf3eb3bcf 100644
--- a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
+++ b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
@@ -136,10 +136,10 @@ public class ServerCmd {
 }
 
 private static String locateJmxConfiguration() {
-if (!new File(JMX_PASSWORD_FILE_PATH_DEFAULT).exists()) {
+if (new File(JMX_PASSWORD_FILE_PATH_DEFAULT).exists()) {
 return JMX_PASSWORD_FILE_PATH_DEFAULT;
 }
-if (!new File("conf/jmxremote.password").exists()) {
+if (new File("conf/jmxremote.password").exists()) {
 return "conf/jmxremote.password";
 }
 return "../conf/jmxremote.password";


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



(james-project) branch 3.7.x updated (82a4b1c9a6 -> 59bf9b9cdf)

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

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


from 82a4b1c9a6 JAMES-3604 Fix inverted condition for RabbitMQWorkQueue 
quorum queue … (#1749)
 new 3d22156176 [FIX] Set up JMX auth filter for Guice
 new 59bf9b9cdf [FIX] Set up JMX auth for Spring

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:
 .../src/main/java/org/apache/james/cli/ServerCmd.java  | 12 +++-
 .../spring-app/src/main/resources/jmxremote.access |  1 +
 .../spring-app/src/main/resources/jmxremote.password   |  1 +
 .../james/app/spring/JamesAppSpringMainTest.java   | 17 +
 .../james/app/spring/JamesSpringContextTest.java   | 18 +-
 .../org/apache/james/modules/server/JMXServer.java |  5 +++--
 .../META-INF/org/apache/james/spring-server.xml|  7 +++
 7 files changed, 57 insertions(+), 4 deletions(-)
 create mode 100644 server/apps/spring-app/src/main/resources/jmxremote.access
 create mode 100644 server/apps/spring-app/src/main/resources/jmxremote.password


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



(james-project) 02/02: [FIX] Set up JMX auth for Spring

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

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

commit 59bf9b9cdfaabbeb1de6971ce0bbbe230c9f8b36
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 18:13:25 2023 +0100

[FIX] Set up JMX auth for Spring

This prevents un-authenticated user from triggering
deserialization exploits which could be exploited
for privilege escalation.
---
 .../src/main/java/org/apache/james/cli/ServerCmd.java  | 12 +++-
 .../spring-app/src/main/resources/jmxremote.access |  1 +
 .../spring-app/src/main/resources/jmxremote.password   |  1 +
 .../james/app/spring/JamesAppSpringMainTest.java   | 17 +
 .../james/app/spring/JamesSpringContextTest.java   | 18 +-
 .../META-INF/org/apache/james/spring-server.xml|  7 +++
 6 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java 
b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
index 77b3aa1496..eddc34c8ae 100644
--- a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
+++ b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
@@ -121,7 +121,7 @@ public class ServerCmd {
 public static void executeAndOutputToStream(String[] args, PrintStream 
printStream) throws Exception {
 Stopwatch stopWatch = Stopwatch.createStarted();
 CommandLine cmd = parseCommandLine(args);
-JmxConnection jmxConnection = new JmxConnection(getHost(cmd), 
getPort(cmd), getAuthCredential(cmd, JMX_PASSWORD_FILE_PATH_DEFAULT));
+JmxConnection jmxConnection = new JmxConnection(getHost(cmd), 
getPort(cmd), getAuthCredential(cmd, locateJmxConfiguration()));
 
 CmdType cmdType = new ServerCmd(
 new JmxDataProbe().connect(jmxConnection),
@@ -135,6 +135,16 @@ public class ServerCmd {
 stopWatch.stop();
 }
 
+private static String locateJmxConfiguration() {
+if (!new File(JMX_PASSWORD_FILE_PATH_DEFAULT).exists()) {
+return JMX_PASSWORD_FILE_PATH_DEFAULT;
+}
+if (!new File("conf/jmxremote.password").exists()) {
+return "conf/jmxremote.password";
+}
+return "../conf/jmxremote.password";
+}
+
 private final JmxDataProbe probe;
 private final JmxMailboxProbe mailboxProbe;
 private final JmxQuotaProbe quotaProbe;
diff --git a/server/apps/spring-app/src/main/resources/jmxremote.access 
b/server/apps/spring-app/src/main/resources/jmxremote.access
new file mode 100644
index 00..09a7b6612a
--- /dev/null
+++ b/server/apps/spring-app/src/main/resources/jmxremote.access
@@ -0,0 +1 @@
+james-admin readwrite
\ No newline at end of file
diff --git a/server/apps/spring-app/src/main/resources/jmxremote.password 
b/server/apps/spring-app/src/main/resources/jmxremote.password
new file mode 100644
index 00..f2ad9e9aee
--- /dev/null
+++ b/server/apps/spring-app/src/main/resources/jmxremote.password
@@ -0,0 +1 @@
+james-admin changeme
\ No newline at end of file
diff --git 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
index 3acc3a596d..52726603ee 100644
--- 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
+++ 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
@@ -18,11 +18,28 @@
  /
 package org.apache.james.app.spring;
 
+import java.io.File;
+import java.io.FileOutputStream;
+
 import org.junit.jupiter.api.Test;
 
 class JamesAppSpringMainTest {
 @Test
 void testServer() throws Exception {
+File accessFile = new File("../conf/jmxremote.access");
+accessFile.getParentFile().mkdirs();
+accessFile.createNewFile();
+try (FileOutputStream out = new FileOutputStream(accessFile)) {
+out.write("james-admin readwrite\r\n".getBytes());
+out.flush();
+}
+File passwordFile = new File("../conf/jmxremote.password");
+passwordFile.createNewFile();
+try (FileOutputStream out = new FileOutputStream(passwordFile)) {
+out.write("james-admin changeme\r\n".getBytes());
+out.flush();
+}
+
 JamesAppSpringMain.main(null);
 }
 }
diff --git 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index 8d2560a1fa..b65462d8cf 100644
--- 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
+

(james-project) 01/02: [FIX] Set up JMX auth filter for Guice

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

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

commit 3d221561761a0ab7c86896cc0028f21b65cc2b4d
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 16:55:52 2023 +0100

[FIX] Set up JMX auth filter for Guice

This prevents un-authenticated user from triggering
deserialization exploits which could be exploited
for privilege escalation.
---
 .../jmx/src/main/java/org/apache/james/modules/server/JMXServer.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
 
b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
index 901926dad2..d880208f35 100644
--- 
a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
+++ 
b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
@@ -129,8 +129,9 @@ public class JMXServer implements Startable {
 Map environment = 
Optional.of(existJmxPasswordFile())
 .filter(FunctionalUtils.identityPredicate())
 .map(hasJmxPasswordFile -> 
ImmutableMap.of("jmx.remote.x.password.file", jmxPasswordFilePath,
-"jmx.remote.x.access.file", jmxAccessFilePath))
-.orElse(ImmutableMap.of());
+"jmx.remote.x.access.file", jmxAccessFilePath,
+"jmx.remote.rmi.server.credentials.filter.pattern", 
"java.lang.String;!*"))
+
.orElse(ImmutableMap.of("jmx.remote.rmi.server.credentials.filter.pattern", 
"java.lang.String;!*"));
 
 jmxConnectorServer = 
JMXConnectorServerFactory.newJMXConnectorServer(new JMXServiceURL(serviceURL),
 environment,


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



(james-project) branch postgresql updated: JAMES-2586 Remove james-server-cassandra-app direct dependency (#1875)

2023-12-22 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 77ca11653c JAMES-2586 Remove james-server-cassandra-app direct 
dependency (#1875)
77ca11653c is described below

commit 77ca11653c3d79bb7b33b94cdab4da28c2f946f0
Author: Benoit TELLIER 
AuthorDate: Fri Dec 22 21:30:16 2023 +0100

JAMES-2586 Remove james-server-cassandra-app direct dependency (#1875)
---
 .../smtp/cassandra-rabbitmq-object-storage/pom.xml |  7 +++
 mpt/impl/smtp/cassandra/pom.xml|  7 +++
 server/apps/cassandra-app/pom.xml  |  6 ++
 server/apps/distributed-app/pom.xml|  6 ++
 server/apps/distributed-pop3-app/pom.xml   |  6 ++
 server/apps/postgres-app/pom.xml   | 24 ++
 .../james/BodyDeduplicationIntegrationTest.java| 12 ++-
 .../james/PostgresWithOpenSearchDisabledTest.java  | 14 -
 .../james/WithScanningSearchMutableTest.java   | 14 -
 .../james/modules/AwsS3BlobStoreExtension.java |  0
 server/container/guice/opensearch/pom.xml  | 18 
 .../apache/james/DockerOpenSearchExtension.java|  0
 .../org/apache/james/DockerOpenSearchRule.java |  2 +-
 .../test/java/org/apache/james/TikaExtension.java  |  0
 .../org/apache/james/modules/TestTikaModule.java   |  0
 .../mailbox}/TestDockerOpenSearchModule.java   |  2 +-
 server/container/guice/pom.xml |  6 ++
 .../pom.xml|  7 +++
 .../pom.xml|  7 +++
 .../distributed-webadmin-integration-test/pom.xml  |  7 +++
 20 files changed, 122 insertions(+), 23 deletions(-)

diff --git a/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml 
b/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
index 3b9dde21e6..bd752b1cab 100644
--- a/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
+++ b/mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
@@ -97,6 +97,13 @@
 test-jar
 test
 
+
+${james.groupId}
+james-server-guice-opensearch
+${project.version}
+test-jar
+test
+
 
 ${james.groupId}
 james-server-util
diff --git a/mpt/impl/smtp/cassandra/pom.xml b/mpt/impl/smtp/cassandra/pom.xml
index e9ded6448d..73eed99f44 100644
--- a/mpt/impl/smtp/cassandra/pom.xml
+++ b/mpt/impl/smtp/cassandra/pom.xml
@@ -69,6 +69,13 @@
 test-jar
 test
 
+
+${james.groupId}
+james-server-guice-opensearch
+${project.version}
+test-jar
+test
+
 
 ${james.groupId}
 james-server-util
diff --git a/server/apps/cassandra-app/pom.xml 
b/server/apps/cassandra-app/pom.xml
index 90784e8fd3..7cd877e61b 100644
--- a/server/apps/cassandra-app/pom.xml
+++ b/server/apps/cassandra-app/pom.xml
@@ -171,6 +171,12 @@
 ${james.groupId}
 james-server-guice-opensearch
 
+
+${james.groupId}
+james-server-guice-opensearch
+test-jar
+test
+
 
 ${james.groupId}
 james-server-guice-pop
diff --git a/server/apps/distributed-app/pom.xml 
b/server/apps/distributed-app/pom.xml
index fbd7f61e42..4dfed7e64e 100644
--- a/server/apps/distributed-app/pom.xml
+++ b/server/apps/distributed-app/pom.xml
@@ -216,6 +216,12 @@
 ${james.groupId}
 james-server-guice-opensearch
 
+
+${james.groupId}
+james-server-guice-opensearch
+test-jar
+test
+
 
 ${james.groupId}
 james-server-guice-pop
diff --git a/server/apps/distributed-pop3-app/pom.xml 
b/server/apps/distributed-pop3-app/pom.xml
index e0401e4fe4..92a434e087 100644
--- a/server/apps/distributed-pop3-app/pom.xml
+++ b/server/apps/distributed-pop3-app/pom.xml
@@ -209,6 +209,12 @@
 ${james.groupId}
 james-server-guice-opensearch
 
+
+${james.groupId}
+james-server-guice-opensearch
+test-jar
+test
+
 
 ${james.groupId}
 james-server-guice-pop
diff --git a/server/apps/postgres-app/pom.xml b/server/apps/postgres-app/pom.xml
index 3e0dab7b67..f361239063 100644
--- a/server/apps/postgres-app/pom.xml
+++ b/server/apps/postgres-app/pom.xml
@@ -90,12 +90,6 @@
 test-jar
 test
 
-
-${james.groupId}
-james-server-cassandra-app
-test-jar
-test

(james-project) 08/09: JAMES-3944 Configure rrt-error in more places

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

commit 8b418eb6de775dd9c72ea10238dd7c827596375d
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 08:33:44 2023 +0100

JAMES-3944 Configure rrt-error in more places

Also add a note into upgrade-instructions.md
---
 .../cli-integration-tests/src/test/resources/mailetcontainer.xml | 4 
 .../src/test/java/org/apache/james/cli/DomainManageTest.java | 2 +-
 server/apps/webadmin-cli/src/test/resources/mailetcontainer.xml  | 6 ++
 .../jmap/src/main/resources/defaultJmapMailetContainer.xml   | 5 +
 .../main/java/org/apache/james/mailets/TemporaryJamesServer.java | 2 ++
 .../src/test/java/org/apache/james/mailets/MailetErrorsTest.java | 7 +++
 .../mailetcontainer-api/src/main/resources/mailetcontainer.xml   | 9 +
 .../src/test/resources/mailetcontainer.xml   | 6 ++
 .../src/test/resources/mailetcontainer.xml   | 5 +
 .../src/test/resources/mailetcontainer.xml   | 5 +
 .../integration/WebAdminServerIntegrationImmutableTest.java  | 6 --
 .../webadmin/integration/WebAdminServerIntegrationTest.java  | 6 --
 testing/base/src/main/resources/logback-test.xml | 4 
 upgrade-instructions.md  | 3 +++
 14 files changed, 61 insertions(+), 9 deletions(-)

diff --git 
a/server/apps/cli-integration-tests/src/test/resources/mailetcontainer.xml 
b/server/apps/cli-integration-tests/src/test/resources/mailetcontainer.xml
index 943770ab9d..c450e90b15 100644
--- a/server/apps/cli-integration-tests/src/test/resources/mailetcontainer.xml
+++ b/server/apps/cli-integration-tests/src/test/resources/mailetcontainer.xml
@@ -44,6 +44,10 @@
 
 
 
+
+
+
+
 
 
 
diff --git 
a/server/apps/webadmin-cli/src/test/java/org/apache/james/cli/DomainManageTest.java
 
b/server/apps/webadmin-cli/src/test/java/org/apache/james/cli/DomainManageTest.java
index f16f1945ea..5428f89e09 100644
--- 
a/server/apps/webadmin-cli/src/test/java/org/apache/james/cli/DomainManageTest.java
+++ 
b/server/apps/webadmin-cli/src/test/java/org/apache/james/cli/DomainManageTest.java
@@ -50,7 +50,7 @@ class DomainManageTest {
 .configurationFromClasspath()
 .usersRepository(DEFAULT)
 .build())
-.server(configuration -> 
MemoryJamesServerMain.createServer(configuration))
+.server(MemoryJamesServerMain::createServer)
 .build();
 
 private final ByteArrayOutputStream outputStreamCaptor = new 
ByteArrayOutputStream();
diff --git a/server/apps/webadmin-cli/src/test/resources/mailetcontainer.xml 
b/server/apps/webadmin-cli/src/test/resources/mailetcontainer.xml
index bbed9a83c2..ae66343c59 100644
--- a/server/apps/webadmin-cli/src/test/resources/mailetcontainer.xml
+++ b/server/apps/webadmin-cli/src/test/resources/mailetcontainer.xml
@@ -47,6 +47,12 @@
 
 
 
+
+
+memory://var/mail/rrt-error/
+
+
+
 
 
 
diff --git 
a/server/container/guice/protocols/jmap/src/main/resources/defaultJmapMailetContainer.xml
 
b/server/container/guice/protocols/jmap/src/main/resources/defaultJmapMailetContainer.xml
index eb27100d53..bde631415e 100644
--- 
a/server/container/guice/protocols/jmap/src/main/resources/defaultJmapMailetContainer.xml
+++ 
b/server/container/guice/protocols/jmap/src/main/resources/defaultJmapMailetContainer.xml
@@ -93,4 +93,9 @@
 
 
 
+
+
+
+
+
 
\ No newline at end of file
diff --git 
a/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
 
b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
index aee4e6914d..1f136009cd 100644
--- 
a/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ 
b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -55,6 +55,7 @@ public class TemporaryJamesServer {
 return MailetContainer.builder()
 .putProcessor(CommonProcessors.root())
 .putProcessor(CommonProcessors.error())
+.putProcessor(CommonProcessors.rrtError())
 .putProcessor(CommonProcessors.transport())
 .putProcessor(CommonProcessors.bounces());
 }
@@ -63,6 +64,7 @@ public class TemporaryJamesServer {
 return MailetContainer.builder()
 .putProcessor(CommonProcessors.simpleRoot())
 .putProcessor(CommonProcessors.error())
+.putProcessor(CommonProcessors.rrtError())
 .putProcessor(CommonProcessors.transport())
 .putProces

(james-project) branch master updated (8e7c7ac7ae -> d7475326f1)

2023-12-22 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 8e7c7ac7ae [FIX] Add more JMX disclaimers
 new 39886e3947 JAMES-3944 Add more tests with filter forwards with self 
forward use cases
 new 45356a83d1 JAMES-3944 Forcing local copy out of forwards
 new b99353a17d JAMES-3944 Forcing local copy out of forwards rule
 new c08a1bbb29 JAMES-3944 Rename CommonProcessor: rrtError
 new d7b0c26128 JAMES-3944 Record forward loops as rrt-error
 new c86910953c JAMES-3944 Keep original name
 new e21f85beec JAMES-3944 IsSenderInRRTLoop should also rely on recorded 
recipients
 new 8b418eb6de JAMES-3944 Configure rrt-error in more places
 new d7475326f1 JAMES-3944 Reprocessing should reset loop detection

The 9 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:
 .../src/test/resources/mailetcontainer.xml |   4 +
 .../org/apache/james/cli/DomainManageTest.java |   2 +-
 .../src/test/resources/mailetcontainer.xml |   6 +
 .../main/resources/defaultJmapMailetContainer.xml  |   5 +
 .../apache/james/mailets/TemporaryJamesServer.java |   2 +
 .../mailets/configuration/CommonProcessors.java|   2 +-
 .../mailets/FilterForwardIntegrationTest.java  |  55 -
 .../james/mailets/ForwardIntegrationTest.java  |  76 ++-
 .../james/mailets/ForwardLoopIntegrationTest.java  | 221 ++---
 .../org/apache/james/mailets/MailetErrorsTest.java |   7 +
 .../james/transport/mailets/AliasMappingTest.java  |   2 +-
 .../james/transport/mailets/DomainMappingTest.java |   2 +-
 .../transport/mailets/GroupMappingRelayTest.java   |   2 +-
 .../james/transport/mailets/GroupMappingTest.java  |   2 +-
 .../src/main/resources/mailetcontainer.xml |   9 +
 .../mailets/RecipientRewriteTableProcessor.java|  37 +++-
 .../transport/matchers/IsSenderInRRTLoop.java  |  11 +-
 .../transport/matchers/IsSenderInRRTLoopTest.java  |  27 +++
 .../RemoteDeliveryForwardIntegrationTest.java  |   2 +-
 .../james/jmap/mailet/filter/ActionApplier.java|  38 +++-
 .../james/jmap/mailet/filter/JMAPFiltering.java|  11 +-
 .../src/test/resources/mailetcontainer.xml |   6 +
 .../src/test/resources/mailetcontainer.xml |   5 +
 .../src/test/resources/mailetcontainer.xml |   5 +
 .../WebAdminServerIntegrationImmutableTest.java|   6 +-
 .../integration/WebAdminServerIntegrationTest.java |   6 +-
 .../webadmin/service/ReprocessingService.java  |   3 +
 .../routes/MailRepositoriesRoutesTest.java |  30 +++
 testing/base/src/main/resources/logback-test.xml   |   4 -
 upgrade-instructions.md|   3 +
 30 files changed, 530 insertions(+), 61 deletions(-)


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



(james-project) 04/09: JAMES-3944 Rename CommonProcessor: rrtError

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

commit c08a1bbb293983dc105ebf60c42ea1f385e15d06
Author: Benoit TELLIER 
AuthorDate: Mon Dec 18 18:27:21 2023 +0100

JAMES-3944 Rename CommonProcessor: rrtError
---
 .../java/org/apache/james/mailets/configuration/CommonProcessors.java   | 2 +-
 .../test/java/org/apache/james/transport/mailets/AliasMappingTest.java  | 2 +-
 .../test/java/org/apache/james/transport/mailets/DomainMappingTest.java | 2 +-
 .../java/org/apache/james/transport/mailets/GroupMappingRelayTest.java  | 2 +-
 .../test/java/org/apache/james/transport/mailets/GroupMappingTest.java  | 2 +-
 .../org/apache/james/mailets/RemoteDeliveryForwardIntegrationTest.java  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/CommonProcessors.java
 
b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/CommonProcessors.java
index 8f34dfc5be..5d69f617a1 100644
--- 
a/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/CommonProcessors.java
+++ 
b/server/mailet/integration-testing/src/main/java/org/apache/james/mailets/configuration/CommonProcessors.java
@@ -158,7 +158,7 @@ public class CommonProcessors {
 .addMailetsFrom(CommonProcessors.deliverOnlyTransport());
 }
 
-public static ProcessorConfiguration.Builder rrtErrorProcessor() {
+public static ProcessorConfiguration.Builder rrtError() {
 return ProcessorConfiguration.builder()
 .state(RRT_ERROR)
 .addMailet(MailetConfiguration.builder()
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AliasMappingTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AliasMappingTest.java
index 574ac5e152..bbfbcac290 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AliasMappingTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AliasMappingTest.java
@@ -96,7 +96,7 @@ class AliasMappingTest {
 void setup(@TempDir File temporaryFolder) throws Exception {
 MailetContainer.Builder mailetContainer = 
TemporaryJamesServer.simpleMailetContainerConfiguration()
 .putProcessor(CommonProcessors.rrtErrorEnabledTransport())
-.putProcessor(CommonProcessors.rrtErrorProcessor());
+.putProcessor(CommonProcessors.rrtError());
 
 jamesServer = TemporaryJamesServer.builder()
 .withMailetContainer(mailetContainer)
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java
index 84fa477337..ddeba40234 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/DomainMappingTest.java
@@ -80,7 +80,7 @@ class DomainMappingTest {
 void setup(@TempDir File temporaryFolder) throws Exception {
 MailetContainer.Builder mailetContainer = 
TemporaryJamesServer.simpleMailetContainerConfiguration()
 .putProcessor(CommonProcessors.rrtErrorEnabledTransport())
-.putProcessor(CommonProcessors.rrtErrorProcessor());
+.putProcessor(CommonProcessors.rrtError());
 
 jamesServer = TemporaryJamesServer.builder()
 .withMailetContainer(mailetContainer)
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingRelayTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingRelayTest.java
index 349625f6dd..6e97495143 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingRelayTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingRelayTest.java
@@ -80,7 +80,7 @@ class GroupMappingRelayTest {
 .addMailet(MailetConfiguration.remoteDeliveryBuilder()
 .matcher(All.class)
 .addProperty("gateway", 
fakeSmtp.getContainer().getContainerIp(
-.putProcessor(CommonProcessors.rrtErrorProcessor());
+.putProcessor(CommonProcessors.rrtError());
 
 jamesServer = TemporaryJamesServer.builder()
 .withMailetContainer(mailetContainer)
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/GroupMappingTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james

(james-project) 09/09: JAMES-3944 Reprocessing should reset loop detection

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

commit d7475326f14602cf33d40dba15952cbea4d7c278
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 10:21:30 2023 +0100

JAMES-3944 Reprocessing should reset loop detection

Otherwise, there is no chance to reprocess correctly
a mail in rrt-error after fixing the loop.
---
 .../webadmin/service/ReprocessingService.java  |  3 +++
 .../routes/MailRepositoriesRoutesTest.java | 30 ++
 2 files changed, 33 insertions(+)

diff --git 
a/server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingService.java
 
b/server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingService.java
index af5d104620..b6f5f978ec 100644
--- 
a/server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingService.java
+++ 
b/server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingService.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.webadmin.service;
 
+import static 
org.apache.mailet.LoopPrevention.RECORDED_RECIPIENTS_ATTRIBUTE_NAME;
+
 import java.io.Closeable;
 import java.io.IOException;
 import java.util.Optional;
@@ -112,6 +114,7 @@ public class ReprocessingService {
 try {
 incrementRetries(mail);
 configuration.getTargetProcessor().ifPresent(mail::setState);
+mail.removeAttribute(RECORDED_RECIPIENTS_ATTRIBUTE_NAME);
 mailQueue.enQueue(mail);
 if (configuration.isConsume()) {
 repository.remove(key);
diff --git 
a/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
 
b/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
index 499afc7ba1..7dee3d9f6f 100644
--- 
a/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
+++ 
b/server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
@@ -85,6 +85,7 @@ import 
org.apache.james.webadmin.service.WebAdminClearMailRepositoryTaskAddition
 import org.apache.james.webadmin.utils.ErrorResponder;
 import org.apache.james.webadmin.utils.JsonTransformer;
 import org.apache.mailet.Attribute;
+import org.apache.mailet.LoopPrevention;
 import org.apache.mailet.Mail;
 import org.apache.mailet.PerRecipientHeaders.Header;
 import org.apache.mailet.base.test.FakeMail;
@@ -1428,6 +1429,35 @@ class MailRepositoriesRoutesTest {
 .containsOnly(NAME_1, NAME_2);
 }
 
+@Test
+void reprocessingAllTaskShouldResetLoopDetection() throws Exception {
+MailRepository mailRepository1 = 
mailRepositoryStore.create(URL_MY_REPO);
+MailRepository mailRepository2 = 
mailRepositoryStore.create(URL_MY_REPO_OTHER);
+FakeMail mail = FakeMail.builder()
+.name(NAME_1)
+.mimeMessage(MimeMessageUtil.mimeMessageFromBytes(MESSAGE_BYTES))
+.build();
+LoopPrevention.RecordedRecipients.fromMail(mail).merge(new 
MailAddress("b...@domain.tld")).recordOn(mail);
+mailRepository1.store(mail);
+
+String taskId = with()
+.param("action", "reprocess")
+.patch(PATH_ESCAPED_MY_REPO + "/mails")
+.jsonPath()
+.get("taskId");
+
+with()
+.basePath(TasksRoutes.BASE)
+.get(taskId + "/await");
+
+assertThat(spoolQueue.browse())
+.toIterable()
+.extracting(ManageableMailQueue.MailQueueItemView::getMail)
+.extracting(LoopPrevention.RecordedRecipients::fromMail)
+.extracting(LoopPrevention.RecordedRecipients::getRecipients)
+.allSatisfy(recordedRecipients -> 
assertThat(recordedRecipients).isEmpty());
+}
+
 @Test
 void reprocessingAllTaskShouldPreserveStateWhenProcessorIsNotSpecified() 
throws Exception {
 MailRepository mailRepository = 
mailRepositoryStore.create(URL_MY_REPO);


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



(james-project) 05/09: JAMES-3944 Record forward loops as rrt-error

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

commit d7b0c26128e0c84ab6d01c41221f67d171426aca
Author: Benoit TELLIER 
AuthorDate: Mon Dec 18 20:58:05 2023 +0100

JAMES-3944 Record forward loops as rrt-error
---
 .../mailets/FilterForwardIntegrationTest.java  | 43 +++
 .../james/mailets/ForwardIntegrationTest.java  | 45 +++
 .../james/mailets/ForwardLoopIntegrationTest.java  | 88 +-
 .../mailets/RecipientRewriteTableProcessor.java| 24 +-
 .../james/jmap/mailet/filter/ActionApplier.java| 34 +++--
 .../james/jmap/mailet/filter/JMAPFiltering.java| 11 ++-
 6 files changed, 233 insertions(+), 12 deletions(-)

diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
index adeb67b63b..aded25a862 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
@@ -21,9 +21,11 @@ package org.apache.james.mailets;
 
 import static 
org.apache.james.jmap.api.filtering.Rule.Condition.Comparator.CONTAINS;
 import static org.apache.james.jmap.api.filtering.Rule.Condition.Field.FROM;
+import static 
org.apache.james.mailets.configuration.CommonProcessors.RRT_ERROR_REPOSITORY;
 import static org.apache.james.mailets.configuration.Constants.DEFAULT_DOMAIN;
 import static org.apache.james.mailets.configuration.Constants.LOCALHOST_IP;
 import static org.apache.james.mailets.configuration.Constants.PASSWORD;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.File;
 
@@ -46,6 +48,7 @@ import org.apache.james.utils.FilteringManagementProbeImpl;
 import org.apache.james.utils.GuiceProbe;
 import org.apache.james.utils.MailRepositoryProbeImpl;
 import org.apache.james.utils.SMTPMessageSender;
+import org.apache.james.utils.SpoolerProbe;
 import org.apache.mailet.Mail;
 import org.assertj.core.api.SoftAssertions;
 import org.junit.jupiter.api.AfterEach;
@@ -95,6 +98,7 @@ public class FilterForwardIntegrationTest {
 .mailet(ToRepository.class)
 .addProperty("repositoryPath", 
CUSTOM_REPOSITORY.asString(
 .putProcessor(CommonProcessors.error())
+.putProcessor(CommonProcessors.rrtError())
 .putProcessor(CommonProcessors.transport())
 .putProcessor(CommonProcessors.bounces()))
 .build(temporaryFolder);
@@ -152,4 +156,43 @@ public class FilterForwardIntegrationTest {
 SoftAssertions.assertSoftly(Throwing.consumer(softly -> 
softly.assertThat(mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
 .anyMatch(Throwing.predicate(mail -> 
mail.getRecipients().contains(BOB.asMailAddress().isFalse()));
 }
+
+@Test
+void regularForwardShouldNotLeadToRecordingRRTError() throws Exception {
+filteringManagementProbe.defineRulesForUser(BOB, 
asRule(Forward.to(CEDRIC.asMailAddress()).withoutACopy()));
+
+messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+.authenticate(ALICE.asString(), PASSWORD)
+.sendMessage(ALICE.asString(), BOB.asString());
+
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
+
+
assertThat(mailRepositoryProbe.getRepositoryMailCount(RRT_ERROR_REPOSITORY)).isZero();
+}
+
+@Test
+void localCopyShouldNotLeadToRecordingRRTError() throws Exception {
+filteringManagementProbe.defineRulesForUser(BOB, 
asRule(Forward.to(CEDRIC.asMailAddress()).keepACopy()));
+
+messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+.authenticate(ALICE.asString(), PASSWORD)
+.sendMessage(ALICE.asString(), BOB.asString());
+
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 2L);
+
+
assertThat(mailRepositoryProbe.getRepositoryMailCount(RRT_ERROR_REPOSITORY)).isZero();
+}
+
+@Test
+void localCopyAloneShouldNotLeadToRecordingRRTError() throws Exception {
+filteringManagementProbe.defineRulesForUser(BOB, 
asRule(Forward.to().keepACopy()));
+
+messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+.authenticate(ALICE.asString(), PASSWORD)
+.sendMessage(ALICE.asString(), BOB.asString());
+
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L

(james-project) 03/09: JAMES-3944 Forcing local copy out of forwards rule

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

commit b99353a17dd1e1e9163fba45425b520bca8c5e48
Author: Benoit TELLIER 
AuthorDate: Mon Dec 18 17:54:10 2023 +0100

JAMES-3944 Forcing local copy out of forwards rule
---
 .../mailets/FilterForwardIntegrationTest.java  | 12 ++-
 .../james/mailets/ForwardLoopIntegrationTest.java  | 24 --
 .../james/jmap/mailet/filter/ActionApplier.java|  9 ++--
 3 files changed, 18 insertions(+), 27 deletions(-)

diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
index a3e8654734..adeb67b63b 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/FilterForwardIntegrationTest.java
@@ -126,14 +126,16 @@ public class FilterForwardIntegrationTest {
 .authenticate(ALICE.asString(), PASSWORD)
 .sendMessage(ALICE.asString(), BOB.asString());
 
-Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 2L);
 
 SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
-Mail mail1 = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
-.findAny().get();
+Mail mail1 = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY, 
BOB.asMailAddress()).get(0);
+
softly.assertThat(mail1.getRecipients()).containsOnly(BOB.asMailAddress());
+
softly.assertThat(mail1.getMaybeSender().asOptional()).contains(ALICE.asMailAddress());
 
-
softly.assertThat(mail1.getRecipients()).containsOnly(BOB.asMailAddress(), 
CEDRIC.asMailAddress());
-
softly.assertThat(mail1.getMaybeSender().asOptional()).contains(BOB.asMailAddress());
+Mail mail2 = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY, 
CEDRIC.asMailAddress()).get(0);
+
softly.assertThat(mail2.getRecipients()).containsOnly(CEDRIC.asMailAddress());
+
softly.assertThat(mail2.getMaybeSender().asOptional()).contains(BOB.asMailAddress());
 }));
 }
 
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
index a2f665a869..5c86a41d6e 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
@@ -27,6 +27,7 @@ import static 
org.apache.james.mailets.configuration.Constants.PASSWORD;
 
 import java.io.File;
 import java.util.List;
+import java.util.stream.Stream;
 
 import org.apache.james.core.Username;
 import org.apache.james.jmap.api.filtering.Rule;
@@ -140,14 +141,7 @@ public class ForwardLoopIntegrationTest {
 .sendMessage(SENDER.asString(), ALICE.asString());
 
 Awaitility.await().until(() -> 
jamesServer.getProbe(SpoolerProbe.class).processingFinished());
-Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
-
-SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
-List mails = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
-.collect(ImmutableList.toImmutableList());
-
-
softly.assertThat(mails.get(0).getRecipients()).containsOnly(CEDRIC.asMailAddress());
-}));
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 0L);
 }
 
 @Test
@@ -161,14 +155,11 @@ public class ForwardLoopIntegrationTest {
 .sendMessage(SENDER.asString(), ALICE.asString());
 
 Awaitility.await().until(() -> 
jamesServer.getProbe(SpoolerProbe.class).processingFinished());
-Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 2L);
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
 
 SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
 List mailListOne = 
mailRepositoryProbe.listMails(CUSTOM_REPOSITORY, ALICE.asMailAddress());
 
softly.assertThat(mailListOne.get(0).getRecipients()).containsOnly(ALICE.asMailAddress());
-
-List mailListTwo = 
mailRepositoryProbe.listMails(CUSTOM_REPOSITORY, CEDRIC.asMailAddress());
-
so

(james-project) 02/09: JAMES-3944 Forcing local copy out of forwards

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

commit 45356a83d168bd6db714c7ae7f5d612d3d9f26ad
Author: Rene Cordier 
AuthorDate: Fri Dec 15 11:37:12 2023 +0700

JAMES-3944 Forcing local copy out of forwards
---
 .../james/mailets/ForwardIntegrationTest.java  | 13 +++--
 .../james/mailets/ForwardLoopIntegrationTest.java  | 62 --
 .../mailets/RecipientRewriteTableProcessor.java| 16 --
 3 files changed, 67 insertions(+), 24 deletions(-)

diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
index b4dff71d2f..2c93ef3617 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
@@ -27,6 +27,7 @@ import static 
org.apache.james.mailets.configuration.Constants.PASSWORD;
 import java.io.File;
 
 import org.apache.james.core.MailAddress;
+import org.apache.james.core.MaybeSender;
 import org.apache.james.core.Username;
 import org.apache.james.mailets.configuration.CommonProcessors;
 import org.apache.james.mailets.configuration.MailetConfiguration;
@@ -323,13 +324,19 @@ public class ForwardIntegrationTest {
 .authenticate(FROM, PASSWORD)
 .sendMessage(FROM, BOB.asString());
 
-Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 2L);
 
 SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
 Mail forwardedMail = 
mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
+.filter(mail -> 
mail.getMaybeSender().asString().equals(BOB.asString()))
+.findAny().get();
+Mail originalMail = 
mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
+.filter(mail -> mail.getMaybeSender().asString().equals(FROM))
 .findAny().get();
-
softly.assertThat(forwardedMail.getRecipients()).containsOnly(DELPHINE.asMailAddress(),
 BOB.asMailAddress());
+
softly.assertThat(forwardedMail.getRecipients()).containsOnly(DELPHINE.asMailAddress());
 
softly.assertThat(forwardedMail.getMaybeSender().asOptional()).contains(BOB.asMailAddress());
+
softly.assertThat(originalMail.getRecipients()).containsOnly(BOB.asMailAddress());
+
softly.assertThat(originalMail.getMaybeSender().asOptional().map(MailAddress::asString)).contains(FROM);
 }));
 }
 
@@ -349,7 +356,7 @@ public class ForwardIntegrationTest {
 Mail forwardedMail = 
mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
 .findAny().get();
 
softly.assertThat(forwardedMail.getRecipients()).containsOnly(BOB.asMailAddress());
-
softly.assertThat(forwardedMail.getMaybeSender().asOptional()).contains(BOB.asMailAddress());
+
softly.assertThat(forwardedMail.getMaybeSender().asOptional().map(MailAddress::asString)).contains(FROM);
 }));
 }
 
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
index b892ff7258..a2f665a869 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
@@ -183,14 +183,7 @@ public class ForwardLoopIntegrationTest {
 .sendMessage(SENDER.asString(), ALICE.asString());
 
 Awaitility.await().until(() -> 
jamesServer.getProbe(SpoolerProbe.class).processingFinished());
-Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
-
-SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
-List mails = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
-.collect(ImmutableList.toImmutableList());
-
-
softly.assertThat(mails.get(0).getRecipients()).containsOnly(CEDRIC.asMailAddress());
-}));
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 0L);
 }
 
 @Test
@@ -208,10 +201,9 @@ public class ForwardLoopIntegrationTest {
 Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
 
 SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
-List mail

(james-project) 07/09: JAMES-3944 IsSenderInRRTLoop should also rely on recorded recipients

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

commit e21f85beec484153358d2b2a40d75f7b59ca1423
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 08:11:57 2023 +0100

JAMES-3944 IsSenderInRRTLoop should also rely on recorded recipients

This allows detecting and breaking loops involving
filtering rules.

Note that it enabled using the classing "rrt-error"
processor involving a bounce in order to notify the
sender (if possible).
---
 .../james/mailets/ForwardLoopIntegrationTest.java  |  7 +-
 .../transport/matchers/IsSenderInRRTLoop.java  | 11 -
 .../transport/matchers/IsSenderInRRTLoopTest.java  | 27 ++
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
index 1168a86d28..2e5ddd4474 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
@@ -108,12 +108,7 @@ public class ForwardLoopIntegrationTest {
 .mailet(ToRepository.class)
 .addProperty("repositoryPath", 
CUSTOM_REPOSITORY.asString(
 .putProcessor(CommonProcessors.error())
-.putProcessor(ProcessorConfiguration.builder()
-.state("rrt-error")
-.addMailet(MailetConfiguration.builder()
-.matcher(All.class)
-.mailet(ToRepository.class)
-.addProperty("repositoryPath", 
RRT_ERROR_REPOSITORY.asString(
+.putProcessor(CommonProcessors.rrtError())
 .putProcessor(CommonProcessors.transport())
 .putProcessor(CommonProcessors.bounces()))
 .build(temporaryFolder);
diff --git 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/matchers/IsSenderInRRTLoop.java
 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/matchers/IsSenderInRRTLoop.java
index 31cb937e94..9c52eb2ce2 100644
--- 
a/server/mailet/mailets/src/main/java/org/apache/james/transport/matchers/IsSenderInRRTLoop.java
+++ 
b/server/mailet/mailets/src/main/java/org/apache/james/transport/matchers/IsSenderInRRTLoop.java
@@ -25,6 +25,7 @@ import javax.inject.Inject;
 
 import org.apache.james.core.MailAddress;
 import org.apache.james.rrt.api.RecipientRewriteTable;
+import org.apache.mailet.LoopPrevention;
 import org.apache.mailet.Mail;
 import org.apache.mailet.base.GenericMatcher;
 import org.slf4j.LoggerFactory;
@@ -64,6 +65,14 @@ public class IsSenderInRRTLoop extends GenericMatcher {
 } catch (Exception e) {
 LoggerFactory.getLogger(IsSenderInRRTLoop.class).warn("Error while 
executing RRT");
 }
-return ImmutableList.of();
+return mail.getMaybeSender()
+.asOptional()
+.filter(sender -> recordedRecipientsContainSender(mail, sender))
+.map(any -> mail.getRecipients())
+.orElse(ImmutableList.of());
+}
+
+private static boolean recordedRecipientsContainSender(Mail mail, 
MailAddress sender) {
+return 
LoopPrevention.RecordedRecipients.fromMail(mail).getRecipients().contains(sender);
 }
 }
diff --git 
a/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/IsSenderInRRTLoopTest.java
 
b/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/IsSenderInRRTLoopTest.java
index 775be5f851..e4999fd59d 100644
--- 
a/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/IsSenderInRRTLoopTest.java
+++ 
b/server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/IsSenderInRRTLoopTest.java
@@ -34,6 +34,7 @@ import org.apache.james.rrt.api.RecipientRewriteTable;
 import org.apache.james.rrt.api.RecipientRewriteTableConfiguration;
 import org.apache.james.rrt.lib.MappingSource;
 import org.apache.james.rrt.memory.MemoryRecipientRewriteTable;
+import org.apache.mailet.LoopPrevention;
 import org.apache.mailet.base.test.FakeMail;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -66,6 +67,32 @@ class IsSenderInRRTLoopTest {
 assertThat(result).isEmpty();
 }
 
+@Test
+void matchShouldReturnRecipientsWhenSenderIsRecorded() throws Exception {
+FakeMail mail = FakeMail.builder()
+.name("name")
+.sender(SENDER)
+.recipient(RECIPIENT1)
+.build();
+
LoopPrevention.RecordedRecipients.fromMail(mail).merge

(james-project) 01/09: JAMES-3944 Add more tests with filter forwards with self forward use cases

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

commit 39886e3947704f4f96b92f8a41c200b6ed68d6d9
Author: Rene Cordier 
AuthorDate: Fri Dec 15 11:03:45 2023 +0700

JAMES-3944 Add more tests with filter forwards with self forward use cases
---
 .../james/mailets/ForwardIntegrationTest.java  | 20 ++
 .../james/mailets/ForwardLoopIntegrationTest.java  | 80 ++
 2 files changed, 100 insertions(+)

diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
index 6c6189d715..b4dff71d2f 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardIntegrationTest.java
@@ -333,6 +333,26 @@ public class ForwardIntegrationTest {
 }));
 }
 
+@Test
+void forwardShouldKeepMessageWhenOnlyLocalCopy() throws Exception {
+jamesServer.getProbe(DataProbeImpl.class)
+.addMapping(MappingSource.fromUser(BOB),
+Mapping.forward(BOB.asString()));
+
+messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+.authenticate(FROM, PASSWORD)
+.sendMessage(FROM, BOB.asString());
+
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
+
+SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
+Mail forwardedMail = 
mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
+.findAny().get();
+
softly.assertThat(forwardedMail.getRecipients()).containsOnly(BOB.asMailAddress());
+
softly.assertThat(forwardedMail.getMaybeSender().asOptional()).contains(BOB.asMailAddress());
+}));
+}
+
 @Test
 void forwardShouldSupportSeveralTargets() throws Exception {
 jamesServer.getProbe(DataProbeImpl.class)
diff --git 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
index da24d6703e..b892ff7258 100644
--- 
a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
+++ 
b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/ForwardLoopIntegrationTest.java
@@ -235,4 +235,84 @@ public class ForwardLoopIntegrationTest {
 
softly.assertThat(mails.get(0).getRecipients()).containsOnly(CEDRIC.asMailAddress());
 }));
 }
+
+@Test
+void regularForwardToSelfShouldNotCreateLoopError() throws Exception {
+dataProbe.addMapping(MappingSource.fromUser(ALICE), 
Mapping.forward(ALICE.asString()));
+
+messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+.authenticate(SENDER.asString(), PASSWORD)
+.sendMessage(SENDER.asString(), ALICE.asString());
+
+Awaitility.await().until(() -> 
jamesServer.getProbe(SpoolerProbe.class).processingFinished());
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
+
+SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
+List mails = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
+.collect(ImmutableList.toImmutableList());
+
+
softly.assertThat(mails.get(0).getRecipients()).containsOnly(ALICE.asMailAddress());
+}));
+}
+
+@Test
+void filterForwardToSelfShouldNotCreateLoopError() throws Exception {
+filteringManagementProbe.defineRulesForUser(ALICE, 
asRule(Forward.to(ALICE.asMailAddress()).withoutACopy()));
+
+messageSender.connect(LOCALHOST_IP, 
jamesServer.getProbe(SmtpGuiceProbe.class).getSmtpPort())
+.authenticate(SENDER.asString(), PASSWORD)
+.sendMessage(SENDER.asString(), ALICE.asString());
+
+Awaitility.await().until(() -> 
jamesServer.getProbe(SpoolerProbe.class).processingFinished());
+Awaitility.await().until(() -> 
mailRepositoryProbe.getRepositoryMailCount(CUSTOM_REPOSITORY) == 1L);
+
+SoftAssertions.assertSoftly(Throwing.consumer(softly -> {
+List mails = mailRepositoryProbe.listMails(CUSTOM_REPOSITORY)
+.collect(ImmutableList.toImmutableList());
+
+
softly.assertThat(mails.get(0).getRecipients()).containsOnly(ALICE.asMailAddress());
+}));
+}
+
+@Test
+void filterForwardToSelfWithLocalCopyShouldNotCreateLoopError() throws 
Exception {
+filteringManagementProbe.defineRulesForUser(A

(james-project) 06/09: JAMES-3944 Keep original name

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

commit c86910953c841fa0eab4da253d9d208546286e9d
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 08:03:42 2023 +0100

JAMES-3944 Keep original name

 - 1. This allows linking the mail together as the
 duplicated mail name is suffixed by the original.
 - 2. Names getting longer is used as a loop
 detection and prevention measure, resetting it
 prevents loop detection.
 - 3. And it is not needed.
---
 .../apache/james/transport/mailets/RecipientRewriteTableProcessor.java   | 1 -
 .../src/main/java/org/apache/james/jmap/mailet/filter/ActionApplier.java | 1 -
 2 files changed, 2 deletions(-)

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 a6dd91e2d5..88124ee853 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
@@ -252,7 +252,6 @@ public class RecipientRewriteTableProcessor {
 try {
 copy.setRecipients(ImmutableList.of(originalRecipient));
 copy.setState(errorProcessor.getValue());
-copy.setName(MailImpl.getId());
 
 context.sendMail(copy, errorProcessor.getValue());
 } finally {
diff --git 
a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/mailet/filter/ActionApplier.java
 
b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/mailet/filter/ActionApplier.java
index 0017dba5ca..742b06380f 100644
--- 
a/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/mailet/filter/ActionApplier.java
+++ 
b/server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/mailet/filter/ActionApplier.java
@@ -238,7 +238,6 @@ public class ActionApplier {
 try {
 copy.setRecipients(ImmutableList.of(mailAddress));
 copy.setState(RRT_ERROR.getValue());
-copy.setName(MailImpl.getId());
 
 mailetContext.sendMail(copy);
 } finally {


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



(james-project) branch 3.8.x updated (a27065d322 -> 3f02586be8)

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

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


from a27065d322 JAMES-3604 Do not apply queue arguments twice (#1735)
 new 5d84512e29 [FIX] Set up JMX auth filter for Guice
 new 3f02586be8 [FIX] Set up JMX auth for Spring

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:
 .../src/main/java/org/apache/james/cli/ServerCmd.java  | 12 +++-
 .../spring-app/src/main/resources/jmxremote.access |  1 +
 .../spring-app/src/main/resources/jmxremote.password   |  1 +
 .../james/app/spring/JamesAppSpringMainTest.java   | 17 +
 .../james/app/spring/JamesSpringContextTest.java   | 18 +-
 .../org/apache/james/modules/server/JMXServer.java |  5 +++--
 .../META-INF/org/apache/james/spring-server.xml|  7 +++
 7 files changed, 57 insertions(+), 4 deletions(-)
 create mode 100644 server/apps/spring-app/src/main/resources/jmxremote.access
 create mode 100644 server/apps/spring-app/src/main/resources/jmxremote.password


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



(james-project) 01/02: [FIX] Set up JMX auth filter for Guice

2023-12-21 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

commit 5d84512e29ea48ec5197126f26e50ac211e8
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 16:55:52 2023 +0100

[FIX] Set up JMX auth filter for Guice

This prevents un-authenticated user from triggering
deserialization exploits which could be exploited
for privilege escalation.
---
 .../jmx/src/main/java/org/apache/james/modules/server/JMXServer.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
 
b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
index 901926dad2..d880208f35 100644
--- 
a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
+++ 
b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
@@ -129,8 +129,9 @@ public class JMXServer implements Startable {
 Map environment = 
Optional.of(existJmxPasswordFile())
 .filter(FunctionalUtils.identityPredicate())
 .map(hasJmxPasswordFile -> 
ImmutableMap.of("jmx.remote.x.password.file", jmxPasswordFilePath,
-"jmx.remote.x.access.file", jmxAccessFilePath))
-.orElse(ImmutableMap.of());
+"jmx.remote.x.access.file", jmxAccessFilePath,
+"jmx.remote.rmi.server.credentials.filter.pattern", 
"java.lang.String;!*"))
+
.orElse(ImmutableMap.of("jmx.remote.rmi.server.credentials.filter.pattern", 
"java.lang.String;!*"));
 
 jmxConnectorServer = 
JMXConnectorServerFactory.newJMXConnectorServer(new JMXServiceURL(serviceURL),
 environment,


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



(james-project) 02/02: [FIX] Set up JMX auth for Spring

2023-12-21 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

commit 3f02586be84c0394bbe90900f0957354ea41e02c
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 18:13:25 2023 +0100

[FIX] Set up JMX auth for Spring

This prevents un-authenticated user from triggering
deserialization exploits which could be exploited
for privilege escalation.
---
 .../src/main/java/org/apache/james/cli/ServerCmd.java  | 12 +++-
 .../spring-app/src/main/resources/jmxremote.access |  1 +
 .../spring-app/src/main/resources/jmxremote.password   |  1 +
 .../james/app/spring/JamesAppSpringMainTest.java   | 17 +
 .../james/app/spring/JamesSpringContextTest.java   | 18 +-
 .../META-INF/org/apache/james/spring-server.xml|  7 +++
 6 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java 
b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
index 77b3aa1496..eddc34c8ae 100644
--- a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
+++ b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
@@ -121,7 +121,7 @@ public class ServerCmd {
 public static void executeAndOutputToStream(String[] args, PrintStream 
printStream) throws Exception {
 Stopwatch stopWatch = Stopwatch.createStarted();
 CommandLine cmd = parseCommandLine(args);
-JmxConnection jmxConnection = new JmxConnection(getHost(cmd), 
getPort(cmd), getAuthCredential(cmd, JMX_PASSWORD_FILE_PATH_DEFAULT));
+JmxConnection jmxConnection = new JmxConnection(getHost(cmd), 
getPort(cmd), getAuthCredential(cmd, locateJmxConfiguration()));
 
 CmdType cmdType = new ServerCmd(
 new JmxDataProbe().connect(jmxConnection),
@@ -135,6 +135,16 @@ public class ServerCmd {
 stopWatch.stop();
 }
 
+private static String locateJmxConfiguration() {
+if (!new File(JMX_PASSWORD_FILE_PATH_DEFAULT).exists()) {
+return JMX_PASSWORD_FILE_PATH_DEFAULT;
+}
+if (!new File("conf/jmxremote.password").exists()) {
+return "conf/jmxremote.password";
+}
+return "../conf/jmxremote.password";
+}
+
 private final JmxDataProbe probe;
 private final JmxMailboxProbe mailboxProbe;
 private final JmxQuotaProbe quotaProbe;
diff --git a/server/apps/spring-app/src/main/resources/jmxremote.access 
b/server/apps/spring-app/src/main/resources/jmxremote.access
new file mode 100644
index 00..09a7b6612a
--- /dev/null
+++ b/server/apps/spring-app/src/main/resources/jmxremote.access
@@ -0,0 +1 @@
+james-admin readwrite
\ No newline at end of file
diff --git a/server/apps/spring-app/src/main/resources/jmxremote.password 
b/server/apps/spring-app/src/main/resources/jmxremote.password
new file mode 100644
index 00..f2ad9e9aee
--- /dev/null
+++ b/server/apps/spring-app/src/main/resources/jmxremote.password
@@ -0,0 +1 @@
+james-admin changeme
\ No newline at end of file
diff --git 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
index 3acc3a596d..52726603ee 100644
--- 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
+++ 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
@@ -18,11 +18,28 @@
  /
 package org.apache.james.app.spring;
 
+import java.io.File;
+import java.io.FileOutputStream;
+
 import org.junit.jupiter.api.Test;
 
 class JamesAppSpringMainTest {
 @Test
 void testServer() throws Exception {
+File accessFile = new File("../conf/jmxremote.access");
+accessFile.getParentFile().mkdirs();
+accessFile.createNewFile();
+try (FileOutputStream out = new FileOutputStream(accessFile)) {
+out.write("james-admin readwrite\r\n".getBytes());
+out.flush();
+}
+File passwordFile = new File("../conf/jmxremote.password");
+passwordFile.createNewFile();
+try (FileOutputStream out = new FileOutputStream(passwordFile)) {
+out.write("james-admin changeme\r\n".getBytes());
+out.flush();
+}
+
 JamesAppSpringMain.main(null);
 }
 }
diff --git 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index 8d2560a1fa..b65462d8cf 100644
--- 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
+

(james-project) 02/04: [FIX] Set up JMX auth for Spring

2023-12-21 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 877e361c3e4348445c2cb54ba9a2b63d22390389
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 18:13:25 2023 +0100

[FIX] Set up JMX auth for Spring

This prevents un-authenticated user from triggering
deserialization exploits which could be exploited
for privilege escalation.
---
 .../src/main/java/org/apache/james/cli/ServerCmd.java  | 12 +++-
 .../spring-app/src/main/resources/jmxremote.access |  1 +
 .../spring-app/src/main/resources/jmxremote.password   |  1 +
 .../james/app/spring/JamesAppSpringMainTest.java   | 17 +
 .../james/app/spring/JamesSpringContextTest.java   | 18 +-
 .../META-INF/org/apache/james/spring-server.xml|  7 +++
 upgrade-instructions.md|  8 
 7 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java 
b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
index aa25f95de3..b1f4058791 100644
--- a/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
+++ b/server/apps/cli/src/main/java/org/apache/james/cli/ServerCmd.java
@@ -121,7 +121,7 @@ public class ServerCmd {
 public static void executeAndOutputToStream(String[] args, PrintStream 
printStream) throws Exception {
 Stopwatch stopWatch = Stopwatch.createStarted();
 CommandLine cmd = parseCommandLine(args);
-JmxConnection jmxConnection = new JmxConnection(getHost(cmd), 
getPort(cmd), getAuthCredential(cmd, JMX_PASSWORD_FILE_PATH_DEFAULT));
+JmxConnection jmxConnection = new JmxConnection(getHost(cmd), 
getPort(cmd), getAuthCredential(cmd, locateJmxConfiguration()));
 
 CmdType cmdType = new ServerCmd(
 new JmxDataProbe().connect(jmxConnection),
@@ -135,6 +135,16 @@ public class ServerCmd {
 stopWatch.stop();
 }
 
+private static String locateJmxConfiguration() {
+if (!new File(JMX_PASSWORD_FILE_PATH_DEFAULT).exists()) {
+return JMX_PASSWORD_FILE_PATH_DEFAULT;
+}
+if (!new File("conf/jmxremote.password").exists()) {
+return "conf/jmxremote.password";
+}
+return "../conf/jmxremote.password";
+}
+
 private final JmxDataProbe probe;
 private final JmxMailboxProbe mailboxProbe;
 private final JmxQuotaProbe quotaProbe;
diff --git a/server/apps/spring-app/src/main/resources/jmxremote.access 
b/server/apps/spring-app/src/main/resources/jmxremote.access
new file mode 100644
index 00..09a7b6612a
--- /dev/null
+++ b/server/apps/spring-app/src/main/resources/jmxremote.access
@@ -0,0 +1 @@
+james-admin readwrite
\ No newline at end of file
diff --git a/server/apps/spring-app/src/main/resources/jmxremote.password 
b/server/apps/spring-app/src/main/resources/jmxremote.password
new file mode 100644
index 00..f2ad9e9aee
--- /dev/null
+++ b/server/apps/spring-app/src/main/resources/jmxremote.password
@@ -0,0 +1 @@
+james-admin changeme
\ No newline at end of file
diff --git 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
index 3acc3a596d..52726603ee 100644
--- 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
+++ 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
@@ -18,11 +18,28 @@
  /
 package org.apache.james.app.spring;
 
+import java.io.File;
+import java.io.FileOutputStream;
+
 import org.junit.jupiter.api.Test;
 
 class JamesAppSpringMainTest {
 @Test
 void testServer() throws Exception {
+File accessFile = new File("../conf/jmxremote.access");
+accessFile.getParentFile().mkdirs();
+accessFile.createNewFile();
+try (FileOutputStream out = new FileOutputStream(accessFile)) {
+out.write("james-admin readwrite\r\n".getBytes());
+out.flush();
+}
+File passwordFile = new File("../conf/jmxremote.password");
+passwordFile.createNewFile();
+try (FileOutputStream out = new FileOutputStream(passwordFile)) {
+out.write("james-admin changeme\r\n".getBytes());
+out.flush();
+}
+
 JamesAppSpringMain.main(null);
 }
 }
diff --git 
a/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
 
b/server/apps/spring-app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index 8d2560a1fa..b65462d8cf 100644
--- 
a/server/apps/spring-app/src/te

(james-project) 03/04: [FIX] Document JMX auth for Spring

2023-12-21 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 a14ddfa1f91aafa9d9cb95fc2b74c9a28047a3cb
Author: Benoit TELLIER 
AuthorDate: Wed Dec 20 17:07:29 2023 +0100

[FIX] Document JMX auth for Spring
---
 src/site/xdoc/server/config-system.xml | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/site/xdoc/server/config-system.xml 
b/src/site/xdoc/server/config-system.xml
index 68db2898b7..67afc64bc9 100644
--- a/src/site/xdoc/server/config-system.xml
+++ b/src/site/xdoc/server/config-system.xml
@@ -149,8 +149,6 @@
 
 JMX Security
 
-Guice only
-
 In order to set up JMX authentication, we need to put 
jmxremote.password and jmxremote.access file
 to /conf directory.
 
@@ -168,11 +166,11 @@
 james-admin readwrite
 
 
-When James runs with option 
-Djames.jmx.credential.generation=true, James will automatically
+(Guice only) When James runs with option 
-Djames.jmx.credential.generation=true, James will automatically
 generate jmxremote.password if the file does 
not exist.
 Then the default username is james-admin and 
a random password. This option defaults to true.
 
-
+(Spring only) Presence of JMX credentials is compulsory to 
start the server.
 
 
 


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



(james-project) 01/04: [FIX] Set up JMX auth filter for Guice

2023-12-21 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 75a776dbf8bfe7b19d2a0542e11691070b4fd5b2
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 16:55:52 2023 +0100

[FIX] Set up JMX auth filter for Guice

This prevents un-authenticated user from triggering
deserialization exploits which could be exploited
for privilege escalation.
---
 .../jmx/src/main/java/org/apache/james/modules/server/JMXServer.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
 
b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
index b8d3547ed5..68da3a885a 100644
--- 
a/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
+++ 
b/server/container/guice/jmx/src/main/java/org/apache/james/modules/server/JMXServer.java
@@ -131,8 +131,9 @@ public class JMXServer implements Startable {
 Map environment = 
Optional.of(existJmxPasswordFile())
 .filter(FunctionalUtils.identityPredicate())
 .map(hasJmxPasswordFile -> 
ImmutableMap.of("jmx.remote.x.password.file", jmxPasswordFilePath,
-"jmx.remote.x.access.file", jmxAccessFilePath))
-.orElse(ImmutableMap.of());
+"jmx.remote.x.access.file", jmxAccessFilePath,
+"jmx.remote.rmi.server.credentials.filter.pattern", 
"java.lang.String;!*"))
+
.orElse(ImmutableMap.of("jmx.remote.rmi.server.credentials.filter.pattern", 
"java.lang.String;!*"));
 
 jmxConnectorServer = 
JMXConnectorServerFactory.newJMXConnectorServer(new JMXServiceURL(serviceURL),
 environment,


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



(james-project) 04/04: [FIX] Add more JMX disclaimers

2023-12-21 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 8e7c7ac7aedfd6c1a3731fd281e1ab585425a3ab
Author: Benoit TELLIER 
AuthorDate: Wed Dec 20 17:10:16 2023 +0100

[FIX] Add more JMX disclaimers
---
 .../docs/modules/ROOT/pages/configure/jmx.adoc| 11 ++-
 src/site/xdoc/server/config-system.xml|  7 ++-
 src/site/xdoc/server/feature-security.xml |  7 +++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git 
a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmx.adoc 
b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmx.adoc
index 00215bf53d..04e88db20c 100644
--- a/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmx.adoc
+++ b/server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmx.adoc
@@ -1,6 +1,16 @@
 = Distributed James Server  jmx.properties
 :navtitle: jmx.properties
 
+== Disclaimer
+
+JMX poses several security concerns and had been leveraged to conduct 
arbitrary code execution.
+This threat is mitigated by not allowing remote connections to JMX, setting up 
authentication and pre-authentication filters.
+However, we recommend to either run James in isolation (docker / own virtual 
machine) or disable JMX altogether.
+
+James JMX endpoint provides command line utilities and exposes a few metrics, 
also available on the metric endpoint.
+
+== Configuration
+
 This is used to configure the JMX MBean server via which all management is 
achieved.
 
 Consult this 
link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/jmx.properties[example]
@@ -23,7 +33,6 @@ in GIT to get some examples and hints.
 To access from a remote location, it has been reported that 
`-Dcom.sun.management.jmxremote.ssl=false` is needed as
 a JVM argument.
 
-
 == JMX Security
 
 In order to set up JMX authentication, we need to put `jmxremote.password` and 
`jmxremote.access` file
diff --git a/src/site/xdoc/server/config-system.xml 
b/src/site/xdoc/server/config-system.xml
index 67afc64bc9..ff4cbc0c07 100644
--- a/src/site/xdoc/server/config-system.xml
+++ b/src/site/xdoc/server/config-system.xml
@@ -131,6 +131,11 @@
 
 
 
+Disclaimer:  JMX poses several security concerns and 
had been leveraged to conduct arbitrary code execution.
+This threat is mitigated by not allowing remote connections to 
JMX, setting up authentication and pre-authentication filters.
+However, we recommend to either run James in isolation (docker 
/ own virtual machine) or disable JMX altogether.
+James JMX endpoint provides command line utilities and exposes 
a few metrics, also available on the metric endpoint.
+
 Consult https://github.com/apache/james-project/tree/master/server/apps/spring-app/src/main/resources/jmx.properties;>jmx.properties
 in GIT to get some examples and hints.
 
 This is used to configure the JMX MBean server via which 
all management is achieved (also used by via the james-cli).
@@ -145,7 +150,7 @@
 
 
 To access from a remote location, it has been reported that 
-Dcom.sun.management.jmxremote.ssl=false is
-needed in the startup script.
+needed in the startup script. Exposing JMX remotely poses 
numerous security issues and as such is strongly discouraged.
 
 JMX Security
 
diff --git a/src/site/xdoc/server/feature-security.xml 
b/src/site/xdoc/server/feature-security.xml
index 00986b1bb6..ce135df3d8 100644
--- a/src/site/xdoc/server/feature-security.xml
+++ b/src/site/xdoc/server/feature-security.xml
@@ -48,6 +48,13 @@
 
   
 
+  
+  Disclaimer:  JMX poses several security concerns and had been 
leveraged to conduct arbitrary code execution.
+  This threat is mitigated by not allowing remote connections to JMX, 
setting up authentication and pre-authentication filters.
+  However, we recommend to either run James in isolation (docker / own 
virtual machine) or disable JMX altogether.
+  James JMX endpoint provides command line utilities and exposes a few 
metrics, also available on the metric endpoint.
+  
+
 
 
 We follow the standard procedures within the ASF regarding


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



(james-project) branch master updated (00334457dc -> 8e7c7ac7ae)

2023-12-21 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 00334457dc JAMES-3967 RelayLimit: add error log
 new 75a776dbf8 [FIX] Set up JMX auth filter for Guice
 new 877e361c3e [FIX] Set up JMX auth for Spring
 new a14ddfa1f9 [FIX] Document JMX auth for Spring
 new 8e7c7ac7ae [FIX] Add more JMX disclaimers

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:
 .../src/main/java/org/apache/james/cli/ServerCmd.java  | 12 +++-
 .../docs/modules/ROOT/pages/configure/jmx.adoc | 11 ++-
 .../spring-app/src/main/resources/jmxremote.access |  1 +
 .../spring-app/src/main/resources/jmxremote.password   |  1 +
 .../james/app/spring/JamesAppSpringMainTest.java   | 17 +
 .../james/app/spring/JamesSpringContextTest.java   | 18 +-
 .../org/apache/james/modules/server/JMXServer.java |  5 +++--
 .../META-INF/org/apache/james/spring-server.xml|  7 +++
 src/site/xdoc/server/config-system.xml | 13 -
 src/site/xdoc/server/feature-security.xml  |  7 +++
 upgrade-instructions.md|  8 
 11 files changed, 90 insertions(+), 10 deletions(-)
 create mode 100644 server/apps/spring-app/src/main/resources/jmxremote.access
 create mode 100644 server/apps/spring-app/src/main/resources/jmxremote.password


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



(james-project) branch postgresql updated: JAMES-2586 Message body deduplication (#1873)

2023-12-21 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 ee731c57ba JAMES-2586 Message body deduplication (#1873)
ee731c57ba is described below

commit ee731c57ba8199e296e06f21f08f47c69d941ba5
Author: Trần Hồng Quân <55171818+quantranhong1...@users.noreply.github.com>
AuthorDate: Thu Dec 21 19:21:49 2023 +0700

JAMES-2586 Message body deduplication (#1873)
---
 .../postgres/mail/PostgresMessageMapper.java   |  56 +-
 .../postgres/mail/PostgresMessageModule.java   |   4 +-
 .../mail/dao/PostgresMailboxMessageDAO.java|  17 ++-
 .../dao/PostgresMailboxMessageFetchStrategy.java   |   2 +-
 .../postgres/mail/dao/PostgresMessageDAO.java  |   6 +-
 .../james/BodyDeduplicationIntegrationTest.java| 124 +
 .../src/test/resources/mailetcontainer.xml |   1 +
 7 files changed, 164 insertions(+), 46 deletions(-)

diff --git 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageMapper.java
 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageMapper.java
index f158744c38..faa785ab79 100644
--- 
a/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageMapper.java
+++ 
b/mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/PostgresMessageMapper.java
@@ -21,8 +21,9 @@ package org.apache.james.mailbox.postgres.mail;
 
 import static org.apache.james.blob.api.BlobStore.StoragePolicy.LOW_COST;
 import static org.apache.james.blob.api.BlobStore.StoragePolicy.SIZE_BASED;
+import static 
org.apache.james.mailbox.postgres.mail.PostgresMessageModule.MessageTable.BODY_BLOB_ID;
+import static 
org.apache.james.mailbox.postgres.mail.PostgresMessageModule.MessageTable.HEADER_CONTENT;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.time.Clock;
@@ -48,6 +49,7 @@ import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.ComposedMessageId;
 import org.apache.james.mailbox.model.ComposedMessageIdWithMetaData;
 import org.apache.james.mailbox.model.Content;
+import org.apache.james.mailbox.model.HeaderAndBodyByteContent;
 import org.apache.james.mailbox.model.Mailbox;
 import org.apache.james.mailbox.model.MailboxCounters;
 import org.apache.james.mailbox.model.MessageMetaData;
@@ -63,6 +65,7 @@ import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
 import org.apache.james.util.streams.Limit;
+import org.jooq.Record;
 
 import com.google.common.io.ByteSource;
 
@@ -71,11 +74,11 @@ import reactor.core.publisher.Mono;
 
 public class PostgresMessageMapper implements MessageMapper {
 
-private static final Function 
MESSAGE_FULL_CONTENT_LOADER = (mailboxMessage) -> new ByteSource() {
+private static final Function 
MESSAGE_BODY_CONTENT_LOADER = (mailboxMessage) -> new ByteSource() {
 @Override
 public InputStream openStream() {
 try {
-return mailboxMessage.getFullContent();
+return mailboxMessage.getBodyContent();
 } catch (IOException e) {
 throw new RuntimeException(e);
 }
@@ -83,7 +86,7 @@ public class PostgresMessageMapper implements MessageMapper {
 
 @Override
 public long size() {
-return mailboxMessage.metaData().getSize();
+return mailboxMessage.getBodyOctets();
 }
 };
 
@@ -128,14 +131,13 @@ public class PostgresMessageMapper implements 
MessageMapper {
 
 @Override
 public Flux findInMailboxReactive(Mailbox mailbox, 
MessageRange messageRange, FetchType fetchType, int limitAsInt) {
-Flux> 
fetchMessageWithoutFullContentPublisher = 
fetchMessageWithoutFullContent(mailbox, messageRange, fetchType, limitAsInt);
+Flux> 
fetchMessageWithoutFullContentPublisher = 
fetchMessageWithoutFullContent(mailbox, messageRange, fetchType, limitAsInt);
 if (fetchType == FetchType.FULL) {
 return fetchMessageWithoutFullContentPublisher
-.flatMap(messageBuilderAndBlobId -> {
-SimpleMailboxMessage.Builder messageBuilder = 
messageBuilderAndBlobId.getLeft();
-String blobIdAsString = messageBuilderAndBlobId.getRight();
-return retrieveFullContent(blobIdAsString)
-.map(content -> 
messageBuilder.content(content).build());
+.flatMap(messageBuilderAndRecord -> {
+SimpleMailboxMessage.Builder messageBuilder = 
messageBuilderAndRecord.getLeft();
+

(james-project) branch postgresql updated: JAMES-2586 Add an Id for SieveScript (#1863)

2023-12-19 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 23b3efa252 JAMES-2586 Add an Id for SieveScript (#1863)
23b3efa252 is described below

commit 23b3efa252812397d5ce014632adf62a12714c2f
Author: Benoit TELLIER 
AuthorDate: Tue Dec 19 15:59:28 2023 +0100

JAMES-2586 Add an Id for SieveScript (#1863)

While not needed now this extra field would
significantly ease a future JMAP Sieve
implementation and avoid a migration.
---
 .../james/sieve/postgres/PostgresSieveModule.java  |  6 +++-
 .../sieve/postgres/PostgresSieveRepository.java|  2 ++
 .../sieve/postgres/PostgresSieveScriptDAO.java |  4 +++
 .../sieve/postgres/model/PostgresSieveScript.java  | 18 --
 .../postgres/model/PostgresSieveScriptId.java  | 38 ++
 5 files changed, 65 insertions(+), 3 deletions(-)

diff --git 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
index a7f7e018e5..74759c8183 100644
--- 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
+++ 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
@@ -20,6 +20,7 @@
 package org.apache.james.sieve.postgres;
 
 import java.time.OffsetDateTime;
+import java.util.UUID;
 
 import org.apache.james.backends.postgres.PostgresIndex;
 import org.apache.james.backends.postgres.PostgresModule;
@@ -36,6 +37,7 @@ public interface PostgresSieveModule {
 
 Field USERNAME = DSL.field("username", 
SQLDataType.VARCHAR(255).notNull());
 Field SCRIPT_NAME = DSL.field("script_name", 
SQLDataType.VARCHAR.notNull());
+Field SCRIPT_ID = DSL.field("script_id", 
SQLDataType.UUID.notNull());
 Field SCRIPT_SIZE = DSL.field("script_size", 
SQLDataType.BIGINT.notNull());
 Field SCRIPT_CONTENT = DSL.field("script_content", 
SQLDataType.VARCHAR.notNull());
 Field IS_ACTIVE = DSL.field("is_active", 
SQLDataType.BOOLEAN.notNull());
@@ -43,13 +45,15 @@ public interface PostgresSieveModule {
 
 PostgresTable TABLE = PostgresTable.name(TABLE_NAME.getName())
 .createTableStep(((dsl, tableName) -> 
dsl.createTableIfNotExists(tableName)
+.column(SCRIPT_ID)
 .column(USERNAME)
 .column(SCRIPT_NAME)
 .column(SCRIPT_SIZE)
 .column(SCRIPT_CONTENT)
 .column(IS_ACTIVE)
 .column(ACTIVATION_DATE_TIME)
-.primaryKey(USERNAME, SCRIPT_NAME)))
+.primaryKey(SCRIPT_ID)
+.constraint(DSL.unique(USERNAME, SCRIPT_NAME
 .disableRowLevelSecurity()
 .build();
 
diff --git 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveRepository.java
 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveRepository.java
index 662915c523..f9b09e8eab 100644
--- 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveRepository.java
+++ 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveRepository.java
@@ -34,6 +34,7 @@ import org.apache.james.core.Username;
 import org.apache.james.core.quota.QuotaSizeLimit;
 import org.apache.james.core.quota.QuotaSizeUsage;
 import org.apache.james.sieve.postgres.model.PostgresSieveScript;
+import org.apache.james.sieve.postgres.model.PostgresSieveScriptId;
 import org.apache.james.sieverepository.api.ScriptContent;
 import org.apache.james.sieverepository.api.ScriptName;
 import org.apache.james.sieverepository.api.ScriptSummary;
@@ -74,6 +75,7 @@ public class PostgresSieveRepository implements 
SieveRepository {
 .scriptContent(content.getValue())
 .scriptSize(content.length())
 .isActive(false)
+.id(PostgresSieveScriptId.generate())
 .build())
 .flatMap(upsertedScripts -> {
 if (upsertedScripts > 0) {
diff --git 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveScriptDAO.java
 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveScriptDAO.java
index b87778db9f..a1d8b93b49 100644
--- 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveScriptDAO.java
+++ 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveScriptDAO.java
@@ -23,6 +23,7 @@ import static 
org.apache.j

(james-project) branch postgresql updated (4020a3904e -> d3162c0726)

2023-12-18 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 4020a3904e JAMES-2586 Fix compilation errors
 add d3162c0726 JAMES-2586 Fix repositoryPath in postgres-app 
mailetcontainer.xml

No new revisions were added by this update.

Summary of changes:
 server/apps/postgres-app/sample-configuration/mailetcontainer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


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



(james-project) 02/03: JAMES-2586 Delete JPASieveScript.java

2023-12-17 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

commit c3ee8db7ee9970682bb307de71f53258add1935b
Author: Benoit TELLIER 
AuthorDate: Tue Dec 12 10:02:02 2023 +0100

JAMES-2586 Delete JPASieveScript.java

Co-authored-by: Quan Tran 
---
 .../src/main/resources/META-INF/persistence.xml|   1 -
 server/data/data-postgres/pom.xml  |   6 +-
 .../james/sieve/postgres/model/JPASieveScript.java | 200 -
 .../src/test/resources/persistence.xml |   1 -
 4 files changed, 2 insertions(+), 206 deletions(-)

diff --git 
a/server/apps/postgres-app/src/main/resources/META-INF/persistence.xml 
b/server/apps/postgres-app/src/main/resources/META-INF/persistence.xml
index a5837560c7..9c79e80651 100644
--- a/server/apps/postgres-app/src/main/resources/META-INF/persistence.xml
+++ b/server/apps/postgres-app/src/main/resources/META-INF/persistence.xml
@@ -25,7 +25,6 @@
 
 
 org.apache.james.mailrepository.jpa.model.JPAMail
-org.apache.james.sieve.postgres.model.JPASieveScript
 
 
 
diff --git a/server/data/data-postgres/pom.xml 
b/server/data/data-postgres/pom.xml
index 88b2b88b9c..f3be0c4f27 100644
--- a/server/data/data-postgres/pom.xml
+++ b/server/data/data-postgres/pom.xml
@@ -155,8 +155,7 @@
 openjpa-maven-plugin
 ${apache.openjpa.version}
 
-
org/apache/james/sieve/postgres/model/JPASieveScript.class,
-org/apache/james/mailrepository/jpa/model/JPAUrl.class,
+
org/apache/james/mailrepository/jpa/model/JPAUrl.class,
 
org/apache/james/mailrepository/jpa/model/JPAMail.class
 true
 
true
@@ -167,8 +166,7 @@
 
 
 metaDataFactory
-
jpa(Types=org.apache.james.sieve.postgres.model.JPASieveScript;
-
org.apache.james.mailrepository.jpa.model.JPAUrl;
+
jpa(Types=org.apache.james.mailrepository.jpa.model.JPAUrl;
 
org.apache.james.mailrepository.jpa.model.JPAMail)
 
 
diff --git 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/model/JPASieveScript.java
 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/model/JPASieveScript.java
deleted file mode 100644
index 8575b34a17..00
--- 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/model/JPASieveScript.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/
- * Licensed to the Apache Software Foundation (ASF) under one   *
- * or more contributor license agreements.  See the NOTICE file *
- * distributed with this work for additional information*
- * regarding copyright ownership.  The ASF licenses this file   *
- * to you under the Apache License, Version 2.0 (the*
- * "License"); you may not use this file except in compliance   *
- * with the License.  You may obtain a copy of the License at   *
- *  *
- *   http://www.apache.org/licenses/LICENSE-2.0 *
- *  *
- * Unless required by applicable law or agreed to in writing,   *
- * software distributed under the License is distributed on an  *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
- * KIND, either express or implied.  See the License for the*
- * specific language governing permissions and limitations  *
- * under the License.   *
- /
-
-package org.apache.james.sieve.postgres.model;
-
-import java.time.OffsetDateTime;
-import java.util.Objects;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
-import javax.persistence.Table;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.james.sieverepository.api.ScriptContent;
-import org.apache.james.sieverepository.api.ScriptName;
-import org.apache.james.sieverepository.api.ScriptSummary;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Preconditions;
-
-@Entity(name = "JamesSieveScript")
-@Table(name = "JAMES_SIEVE_SCRIPT")
-@NamedQueries({
-@NamedQuery(name = "findAllByUsername", query = "SELECT sieveScript 
FROM JamesSieveScript sieveScript WHERE sieveScript.username=:userna

(james-project) 03/03: JAMES-2586 Guice binding for PostgresSieveScriptDAO

2023-12-17 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

commit 2059be497ea98f072d6f0f0bbb68818fb5487bf1
Author: Quan Tran 
AuthorDate: Tue Dec 12 16:07:14 2023 +0700

JAMES-2586 Guice binding for PostgresSieveScriptDAO
---
 .../james/modules/data/SievePostgresRepositoryModules.java| 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/server/container/guice/sieve-postgres/src/main/java/org/apache/james/modules/data/SievePostgresRepositoryModules.java
 
b/server/container/guice/sieve-postgres/src/main/java/org/apache/james/modules/data/SievePostgresRepositoryModules.java
index b2784c6be7..a319135262 100644
--- 
a/server/container/guice/sieve-postgres/src/main/java/org/apache/james/modules/data/SievePostgresRepositoryModules.java
+++ 
b/server/container/guice/sieve-postgres/src/main/java/org/apache/james/modules/data/SievePostgresRepositoryModules.java
@@ -19,18 +19,27 @@
 
 package org.apache.james.modules.data;
 
+import org.apache.james.backends.postgres.PostgresModule;
+import org.apache.james.sieve.postgres.PostgresSieveModule;
+import org.apache.james.sieve.postgres.PostgresSieveQuotaDAO;
 import org.apache.james.sieve.postgres.PostgresSieveRepository;
+import org.apache.james.sieve.postgres.PostgresSieveScriptDAO;
 import org.apache.james.sieverepository.api.SieveQuotaRepository;
 import org.apache.james.sieverepository.api.SieveRepository;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Scopes;
+import com.google.inject.multibindings.Multibinder;
 
 public class SievePostgresRepositoryModules extends AbstractModule {
 @Override
 protected void configure() {
-bind(PostgresSieveRepository.class).in(Scopes.SINGLETON);
+Multibinder.newSetBinder(binder(), 
PostgresModule.class).addBinding().toInstance(PostgresSieveModule.MODULE);
+
+bind(PostgresSieveQuotaDAO.class).in(Scopes.SINGLETON);
+bind(PostgresSieveScriptDAO.class).in(Scopes.SINGLETON);
 
+bind(PostgresSieveRepository.class).in(Scopes.SINGLETON);
 bind(SieveRepository.class).to(PostgresSieveRepository.class);
 bind(SieveQuotaRepository.class).to(PostgresSieveRepository.class);
 }


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



(james-project) 01/03: JAMES-2586 Implement PostgresSieveScriptDAO + PostgresSieveRepository

2023-12-17 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

commit 4e56c426df82e2adad36a0bbc019b44e02ccf260
Author: Quan Tran 
AuthorDate: Mon Dec 11 17:45:11 2023 +0700

JAMES-2586 Implement PostgresSieveScriptDAO + PostgresSieveRepository
---
 .../backends/postgres/utils/PostgresExecutor.java  |   8 +
 .../lib/SieveRepositoryContract.java   |  11 +
 .../james/sieve/postgres/PostgresSieveModule.java  |  65 +
 .../sieve/postgres/PostgresSieveRepository.java| 279 -
 .../sieve/postgres/PostgresSieveScriptDAO.java | 152 +++
 .../sieve/postgres/model/PostgresSieveScript.java  | 148 +++
 .../postgres/PostgresSieveRepositoryTest.java  |  18 +-
 7 files changed, 493 insertions(+), 188 deletions(-)

diff --git 
a/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
 
b/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
index 686145dbeb..dceb4ac06f 100644
--- 
a/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
+++ 
b/backends-common/postgres/src/main/java/org/apache/james/backends/postgres/utils/PostgresExecutor.java
@@ -111,6 +111,14 @@ public class PostgresExecutor {
 .map(Record1::value1);
 }
 
+public Mono executeReturnAffectedRowsCount(Function> queryFunction) {
+return dslContext()
+.flatMap(queryFunction)
+.cast(Long.class)
+.retryWhen(Retry.backoff(MAX_RETRY_ATTEMPTS, MIN_BACKOFF)
+.filter(preparedStatementConflictException()));
+}
+
 public Mono connection() {
 return connection;
 }
diff --git 
a/server/data/data-library/src/test/java/org/apache/james/sieverepository/lib/SieveRepositoryContract.java
 
b/server/data/data-library/src/test/java/org/apache/james/sieverepository/lib/SieveRepositoryContract.java
index 97f5841423..91531749a6 100644
--- 
a/server/data/data-library/src/test/java/org/apache/james/sieverepository/lib/SieveRepositoryContract.java
+++ 
b/server/data/data-library/src/test/java/org/apache/james/sieverepository/lib/SieveRepositoryContract.java
@@ -185,6 +185,17 @@ public interface SieveRepositoryContract {
 .isInstanceOf(ScriptNotFoundException.class);
 }
 
+@Test
+default void 
setActiveScriptOnNonExistingScriptShouldNotDeactivateTheCurrentActiveScript() 
throws Exception {
+sieveRepository().putScript(USERNAME, SCRIPT_NAME, SCRIPT_CONTENT);
+sieveRepository().setActive(USERNAME, SCRIPT_NAME);
+
+assertThatThrownBy(() -> sieveRepository().setActive(USERNAME, 
OTHER_SCRIPT_NAME))
+.isInstanceOf(ScriptNotFoundException.class);
+
+
assertThat(getScriptContent(sieveRepository().getActive(USERNAME))).isEqualTo(SCRIPT_CONTENT);
+}
+
 @Test
 default void setActiveScriptShouldWork() throws Exception {
 sieveRepository().putScript(USERNAME, SCRIPT_NAME, SCRIPT_CONTENT);
diff --git 
a/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
new file mode 100644
index 00..b6780f9e63
--- /dev/null
+++ 
b/server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveModule.java
@@ -0,0 +1,65 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.sieve.postgres;
+
+import java.time.OffsetDateTime;
+
+import org.apache.james.backends.postgres.PostgresIndex;
+import org.apache.james.backends.postgr

(james-project) branch postgresql updated (b6ef595fc3 -> 2059be497e)

2023-12-17 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 b6ef595fc3 JAMES-2586 ADR for Posgres mailbox tables structure (#1857)
 new 4e56c426df JAMES-2586 Implement PostgresSieveScriptDAO + 
PostgresSieveRepository
 new c3ee8db7ee JAMES-2586 Delete JPASieveScript.java
 new 2059be497e JAMES-2586 Guice binding for PostgresSieveScriptDAO

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/postgres/utils/PostgresExecutor.java  |   8 +
 .../src/main/resources/META-INF/persistence.xml|   1 -
 .../data/SievePostgresRepositoryModules.java   |  11 +-
 .../lib/SieveRepositoryContract.java   |  11 +
 server/data/data-postgres/pom.xml  |   6 +-
 .../postgres/PostgresSieveModule.java} |  44 ++--
 .../sieve/postgres/PostgresSieveRepository.java| 279 -
 .../sieve/postgres/PostgresSieveScriptDAO.java | 152 +++
 .../james/sieve/postgres/model/JPASieveScript.java | 200 ---
 .../sieve/postgres/model/PostgresSieveScript.java  | 148 +++
 .../postgres/PostgresSieveRepositoryTest.java  |  18 +-
 .../src/test/resources/persistence.xml |   1 -
 12 files changed, 465 insertions(+), 414 deletions(-)
 copy 
server/data/data-postgres/src/main/java/org/apache/james/{rrt/postgres/PostgresRecipientRewriteTableModule.java
 => sieve/postgres/PostgresSieveModule.java} (56%)
 create mode 100644 
server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/PostgresSieveScriptDAO.java
 delete mode 100644 
server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/model/JPASieveScript.java
 create mode 100644 
server/data/data-postgres/src/main/java/org/apache/james/sieve/postgres/model/PostgresSieveScript.java


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



(james-project) branch postgresql updated: JAMES-2586 ADR for Posgres mailbox tables structure (#1857)

2023-12-17 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 b6ef595fc3 JAMES-2586 ADR for Posgres mailbox tables structure (#1857)
b6ef595fc3 is described below

commit b6ef595fc398aaab7ca32416d1cadf517b051f19
Author: hungphan227 <45198168+hungphan...@users.noreply.github.com>
AuthorDate: Mon Dec 18 14:44:53 2023 +0700

JAMES-2586 ADR for Posgres mailbox tables structure (#1857)
---
 src/adr/0070-postgresql-adoption.md|   2 +-
 .../0071-postgresql-mailbox-tables-structure.md|  58 +
 src/adr/img/adr-71-mailbox-tables-diagram.png  | Bin 0 -> 146780 bytes
 3 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/src/adr/0070-postgresql-adoption.md 
b/src/adr/0070-postgresql-adoption.md
index 115594daa0..5d1caf4f26 100644
--- a/src/adr/0070-postgresql-adoption.md
+++ b/src/adr/0070-postgresql-adoption.md
@@ -1,4 +1,4 @@
-# 68. Native PostgreSQL adoption
+# 70. Native PostgreSQL adoption
 
 Date: 2023-10-31
 
diff --git a/src/adr/0071-postgresql-mailbox-tables-structure.md 
b/src/adr/0071-postgresql-mailbox-tables-structure.md
new file mode 100644
index 00..df859422d4
--- /dev/null
+++ b/src/adr/0071-postgresql-mailbox-tables-structure.md
@@ -0,0 +1,58 @@
+# 71.  Postgresql Mailbox tables structure
+
+Date: 2023-12-14
+
+## Status
+
+Implemented
+
+## Context
+
+As described in [ADR-70](link), we are willing to provide a Postgres 
implementation for Apache James.
+The current document is willing to detail the inner working of the mailbox of 
the target implementation.
+
+## Decision
+
+![diagram for mailbox tables](img/adr-71-mailbox-tables-diagram.png)
+
+Table list:
+- mailbox
+- mailbox_annotations
+- message
+- message_mailbox
+- subscription
+
+Indexes in table message_mailbox: 
+- message_mailbox_message_id_index (message_id)
+- mailbox_id_mail_uid_index (mailbox_id, message_uid)
+- mailbox_id_is_seen_mail_uid_index (mailbox_id, is_seen, message_uid)
+- mailbox_id_is_recent_mail_uid_index (mailbox_id, is_recent, message_uid)
+- mailbox_id_is_delete_mail_uid_index (mailbox_id, is_deleted, message_uid)
+
+Indexes are used to find records faster.
+
+The table structure is mostly normalized which mitigates storage costs and 
achieves consistency easily.
+
+Foreign key constraints (mailbox_id in mailbox_annotations, message_id in 
message_mailbox) help to ensure data consistency. For example, message_id 1 in 
table message_mailbox could not exist if message_id 1 in table message does not 
exist  
+
+For some fields, hstore data type are used. Hstore is key-value hashmap data 
structure. Hstore allows us to model complex data types without the need for 
complex joins.
+
+Special postgres clauses such as RETURNING, ON CONFLICT are used to ensure 
consistency without the need of combining multiple queries in a single 
transaction.
+
+## Consequences
+
+Pros:
+- Indexes could increase query performance significantly
+
+Cons:
+- Too many indexes in a table could reduce the performance of updating data in 
the table
+
+## Alternatives
+
+## References
+
+- [JIRA](https://issues.apache.org/jira/browse/JAMES-2586)
+- [PostgreSQL](https://www.postgresql.org/)
+
+
+
diff --git a/src/adr/img/adr-71-mailbox-tables-diagram.png 
b/src/adr/img/adr-71-mailbox-tables-diagram.png
new file mode 100644
index 00..c9b2d11b5f
Binary files /dev/null and b/src/adr/img/adr-71-mailbox-tables-diagram.png 
differ


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



(james-project) 01/02: JAMES-3967 Store mails when relay is exceeded

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

commit a4d751b147f166db76af073d8b34667a2633e786
Author: Benoit TELLIER 
AuthorDate: Fri Dec 15 11:59:37 2023 +0100

JAMES-3967 Store mails when relay is exceeded

This prevents data loss.
---
 server/apps/cassandra-app/sample-configuration/mailetcontainer.xml| 4 +++-
 server/apps/distributed-app/sample-configuration/mailetcontainer.xml  | 4 +++-
 .../distributed-pop3-app/sample-configuration/mailetcontainer.xml | 4 +++-
 server/apps/jpa-app/sample-configuration/mailetcontainer.xml  | 4 +++-
 server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml | 4 +++-
 server/apps/memory-app/sample-configuration/mailetcontainer.xml   | 4 +++-
 .../apps/scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml | 4 +++-
 server/apps/spring-app/src/main/resources/mailetcontainer.xml | 4 +++-
 8 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml 
b/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml
index 7bdb153d21..f9c62031f0 100644
--- a/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/cassandra-app/sample-configuration/mailetcontainer.xml
@@ -37,7 +37,9 @@
 
 
 
-
+
+
cassandra://var/mail/relay-limit-exceeded/
+
 
 transport
 
diff --git 
a/server/apps/distributed-app/sample-configuration/mailetcontainer.xml 
b/server/apps/distributed-app/sample-configuration/mailetcontainer.xml
index 7bdb153d21..f9c62031f0 100644
--- a/server/apps/distributed-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/distributed-app/sample-configuration/mailetcontainer.xml
@@ -37,7 +37,9 @@
 
 
 
-
+
+
cassandra://var/mail/relay-limit-exceeded/
+
 
 transport
 
diff --git 
a/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml 
b/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml
index 5aceaf4ef8..945deba91f 100644
--- a/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/distributed-pop3-app/sample-configuration/mailetcontainer.xml
@@ -37,7 +37,9 @@
 
 
 
-
+
+
cassandra://var/mail/relay-limit-exceeded/
+
 
 transport
 
diff --git a/server/apps/jpa-app/sample-configuration/mailetcontainer.xml 
b/server/apps/jpa-app/sample-configuration/mailetcontainer.xml
index acc048b8a9..90cbcedef1 100644
--- a/server/apps/jpa-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/jpa-app/sample-configuration/mailetcontainer.xml
@@ -37,7 +37,9 @@
 
 
 
-
+
+
file://var/mail/relay-limit-exceeded/
+
 
 transport
 
diff --git a/server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml 
b/server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml
index a050bbea55..4360a22d81 100644
--- a/server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml
@@ -37,7 +37,9 @@
 
 
 
-
+
+
file://var/mail/relay-limit-exceeded/
+
 
 transport
 
diff --git a/server/apps/memory-app/sample-configuration/mailetcontainer.xml 
b/server/apps/memory-app/sample-configuration/mailetcontainer.xml
index 15a356398c..a05cf3ca74 100644
--- a/server/apps/memory-app/sample-configuration/mailetcontainer.xml
+++ b/server/apps/memory-app/sample-configuration/mailetcontainer.xml
@@ -37,7 +37,9 @@
 
 
 
-
+
+
memory://var/mail/relay-limit-exceeded/
+
 
 transport
 
diff --git 
a/server/apps/scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml 
b/server/apps/scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml
index 97ab8ee993..f95729d6b7 100644
--- a/server/apps/scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml
+++ b/server/apps/scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml
@@ -32,7 +32,9 @@
 
 
 
-
+
+
blob://var/mail/relay-limit-exceeded/
+
 
 
 transport
diff --git a/server/apps/spring-app/src/main/resources/mailetcontainer.xml 
b/server/apps/spring-app/src/main/resources/mailetcontainer.xml
index ce4c038c56

(james-project) branch master updated (aad590c27c -> 00334457dc)

2023-12-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 aad590c27c [ENHANCEMENT] More tests for ReactiveThrottler (#1854)
 new a4d751b147 JAMES-3967 Store mails when relay is exceeded
 new 00334457dc JAMES-3967 RelayLimit: add error log

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:
 .../main/java/org/apache/james/transport/matchers/RelayLimit.java| 5 -
 server/apps/cassandra-app/sample-configuration/mailetcontainer.xml   | 4 +++-
 server/apps/distributed-app/sample-configuration/mailetcontainer.xml | 4 +++-
 .../distributed-pop3-app/sample-configuration/mailetcontainer.xml| 4 +++-
 server/apps/jpa-app/sample-configuration/mailetcontainer.xml | 4 +++-
 server/apps/jpa-smtp-app/sample-configuration/mailetcontainer.xml| 4 +++-
 server/apps/memory-app/sample-configuration/mailetcontainer.xml  | 4 +++-
 .../scaling-pulsar-smtp/sample-configuration/mailetcontainer.xml | 4 +++-
 server/apps/spring-app/src/main/resources/mailetcontainer.xml| 4 +++-
 9 files changed, 28 insertions(+), 9 deletions(-)


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



(james-project) 02/02: JAMES-3967 RelayLimit: add error log

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

commit 00334457dcc4ae4e1720a044433ccc85fc57dfae
Author: Benoit TELLIER 
AuthorDate: Fri Dec 15 12:03:12 2023 +0100

JAMES-3967 RelayLimit: add error log

Eases loop diagnostic...
---
 .../main/java/org/apache/james/transport/matchers/RelayLimit.java| 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/mailet/standard/src/main/java/org/apache/james/transport/matchers/RelayLimit.java
 
b/mailet/standard/src/main/java/org/apache/james/transport/matchers/RelayLimit.java
index 04a2385a04..d8cbb4abe4 100644
--- 
a/mailet/standard/src/main/java/org/apache/james/transport/matchers/RelayLimit.java
+++ 
b/mailet/standard/src/main/java/org/apache/james/transport/matchers/RelayLimit.java
@@ -33,13 +33,15 @@ import org.apache.mailet.Mail;
 import org.apache.mailet.base.GenericMatcher;
 import org.apache.mailet.base.MailetUtil;
 import org.apache.mailet.base.RFC2822Headers;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Matches mail which has been relayed more than a given number of times.
  * @version 1.0.0, 1/5/2000
  */
-
 public class RelayLimit extends GenericMatcher {
+private static final Logger LOGGER = 
LoggerFactory.getLogger(RelayLimit.class);
 int limit = 30;
 
 @Override
@@ -58,6 +60,7 @@ public class RelayLimit extends GenericMatcher {
 }
 }
 if (count >= limit) {
+LOGGER.error("{} with Message-ID {} exceeded relay limit: {} 
Received headers", mail.getName(), mail.getMessage().getMessageID(), count);
 return mail.getRecipients();
 } else {
 return null;


-
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] More tests for ReactiveThrottler (#1854)

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


The following commit(s) were added to refs/heads/master by this push:
 new aad590c27c [ENHANCEMENT] More tests for ReactiveThrottler (#1854)
aad590c27c is described below

commit aad590c27cb564ce7999450812a579737ef8efa2
Author: Benoit TELLIER 
AuthorDate: Fri Dec 15 08:14:37 2023 +0100

[ENHANCEMENT] More tests for ReactiveThrottler (#1854)
---
 .../imapserver/netty/ReactiveThrottlerTest.java| 81 ++
 1 file changed, 81 insertions(+)

diff --git 
a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/ReactiveThrottlerTest.java
 
b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/ReactiveThrottlerTest.java
index d107f90ee5..c11ab260a8 100644
--- 
a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/ReactiveThrottlerTest.java
+++ 
b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/ReactiveThrottlerTest.java
@@ -29,9 +29,12 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.james.imap.api.ImapMessage;
 import org.apache.james.metrics.api.NoopGaugeRegistry;
+import org.apache.james.util.concurrency.ConcurrentTestRunner;
+import org.junit.jupiter.api.RepeatedTest;
 import org.junit.jupiter.api.Test;
 import org.testcontainers.shaded.org.awaitility.Awaitility;
 
+import reactor.core.Disposable;
 import reactor.core.publisher.Mono;
 
 class ReactiveThrottlerTest {
@@ -115,6 +118,84 @@ class ReactiveThrottlerTest {
 // And the task is not executed
 assertThat(executed.get()).isFalse();
 }
+@Test
+void throttleShouldRecoverFromABurst() throws Exception {
+// Given a throttler
+ReactiveThrottler testee = new ReactiveThrottler(new 
NoopGaugeRegistry(), 2, 2);
+
+// When I submit too many tasks task
+AtomicBoolean executed = new AtomicBoolean(false);
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+
+Thread.sleep(500);
+Mono.from(testee.throttle(Mono.fromRunnable(() -> 
executed.getAndSet(true)), NO_IMAP_MESSAGE)).block();
+// And the task is executed
+assertThat(executed.get()).isTrue();
+}
+
+@Test
+void throttleShouldHandleDisposal() throws Exception {
+// Given a throttler
+ReactiveThrottler testee = new ReactiveThrottler(new 
NoopGaugeRegistry(), 2, 2);
+
+// When I submit too many tasks task
+AtomicBoolean executed = new AtomicBoolean(false);
+Disposable subscribe1 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposable subscribe2 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposable subscribe3 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposable subscribe4 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposable subscribe5 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposable subscribe6 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposable subscribe7 = 
Mono.from(testee.throttle(Mono.delay(Duration.ofMillis(50)).then(), 
NO_IMAP_MESSAGE)).subscribe();
+Disposa

(james-project) branch master updated: [FIX] LdapRepositoryConfiguration should interoperate with UsersRepositoryImpl (#1855)

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


The following commit(s) were added to refs/heads/master by this push:
 new d1affd2426 [FIX] LdapRepositoryConfiguration should interoperate with 
UsersRepositoryImpl (#1855)
d1affd2426 is described below

commit d1affd2426bd19709a514d3599b4ae362df10c2f
Author: Benoit TELLIER 
AuthorDate: Fri Dec 15 08:14:14 2023 +0100

[FIX] LdapRepositoryConfiguration should interoperate with 
UsersRepositoryImpl (#1855)
---
 server/data/data-ldap/pom.xml  |  4 ++
 .../user/ldap/LdapRepositoryConfiguration.java |  4 +-
 .../user/ldap/LdapRepositoryConfigurationTest.java | 66 ++
 .../src/test/resources/usersrepository-default.xml |  8 +++
 .../usersrepository-enableVirtualHosting.xml   |  9 +++
 .../usersrepository-supportsVirtualHosting.xml |  9 +++
 6 files changed, 99 insertions(+), 1 deletion(-)

diff --git a/server/data/data-ldap/pom.xml b/server/data/data-ldap/pom.xml
index e73cd85777..7bc5740b22 100644
--- a/server/data/data-ldap/pom.xml
+++ b/server/data/data-ldap/pom.xml
@@ -69,6 +69,10 @@
 com.unboundid
 unboundid-ldapsdk
 
+
+commons-beanutils
+commons-beanutils
+
 
 javax.annotation
 javax.annotation-api
diff --git 
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
 
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
index 2a962790ac..4548d5d01d 100644
--- 
a/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
+++ 
b/server/data/data-ldap/src/main/java/org/apache/james/user/ldap/LdapRepositoryConfiguration.java
@@ -39,6 +39,7 @@ import com.google.common.collect.ImmutableMap;
 
 public class LdapRepositoryConfiguration {
 public static final String SUPPORTS_VIRTUAL_HOSTING = 
"supportsVirtualHosting";
+public static final String SUPPORTS_VIRTUAL_HOSTING_FALLBACK = 
"enableVirtualHosting";
 
 private static final int NO_CONNECTION_TIMEOUT = 0;
 private static final int NO_READ_TIME_OUT = 0;
@@ -183,7 +184,8 @@ public class LdapRepositoryConfiguration {
 // Default is to use connection pooling
 int connectionTimeout = configuration.getInt("[@connectionTimeout]", 
NO_CONNECTION_TIMEOUT);
 int readTimeout = configuration.getInt("[@readTimeout]", 
NO_READ_TIME_OUT);
-boolean supportsVirtualHosting = 
configuration.getBoolean(SUPPORTS_VIRTUAL_HOSTING, !ENABLE_VIRTUAL_HOSTING);
+boolean supportsVirtualHostingFallback = 
configuration.getBoolean(SUPPORTS_VIRTUAL_HOSTING_FALLBACK, 
!ENABLE_VIRTUAL_HOSTING);
+boolean supportsVirtualHosting = 
configuration.getBoolean(SUPPORTS_VIRTUAL_HOSTING, 
supportsVirtualHostingFallback);
 
 HierarchicalConfiguration restrictionConfig = null;
 // Check if we have a restriction we can use
diff --git 
a/server/data/data-ldap/src/test/java/org/apache/james/user/ldap/LdapRepositoryConfigurationTest.java
 
b/server/data/data-ldap/src/test/java/org/apache/james/user/ldap/LdapRepositoryConfigurationTest.java
new file mode 100644
index 00..4c5e4e4eef
--- /dev/null
+++ 
b/server/data/data-ldap/src/test/java/org/apache/james/user/ldap/LdapRepositoryConfigurationTest.java
@@ -0,0 +1,66 @@
+/
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information*
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the*
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *  *
+ *   http://www.apache.org/licenses/LICENSE-2.0 *
+ *  *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY   *
+ * KIND, either express or implied.  See the License for the*
+ * specific language governing permissions and limitations  *
+ * under the License.   *
+ /
+
+package org.apache.james.user.ldap;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.InputStream;
+
+import org.apache.commons.configuration2

(james-project) branch postgresql updated: JAMES-2586 PostgresDelegationStore (#1851)

2023-12-13 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 decec6ffc5 JAMES-2586 PostgresDelegationStore (#1851)
decec6ffc5 is described below

commit decec6ffc5ac8f5037572d47a099e257ed644029
Author: hungphan227 <45198168+hungphan...@users.noreply.github.com>
AuthorDate: Wed Dec 13 16:24:11 2023 +0700

JAMES-2586 PostgresDelegationStore (#1851)
---
 .../org/apache/james/PostgresJamesServerMain.java  |  3 +-
 ...ule.java => PostgresDelegationStoreModule.java} | 25 +++---
 .../data/PostgresUsersRepositoryModule.java| 22 -
 .../user/postgres/PostgresDelegationStore.java | 89 
 .../james/user/postgres/PostgresUserModule.java|  8 +-
 .../james/user/postgres/PostgresUsersDAO.java  | 98 ++
 .../user/postgres/PostgresDelegationStoreTest.java | 67 +++
 7 files changed, 272 insertions(+), 40 deletions(-)

diff --git 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
index 1191382350..24cfa7d1cd 100644
--- 
a/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
+++ 
b/server/apps/postgres-app/src/main/java/org/apache/james/PostgresJamesServerMain.java
@@ -24,6 +24,7 @@ import org.apache.james.modules.MailboxModule;
 import org.apache.james.modules.MailetProcessingModule;
 import org.apache.james.modules.RunArgumentsModule;
 import org.apache.james.modules.data.PostgresDataModule;
+import org.apache.james.modules.data.PostgresDelegationStoreModule;
 import org.apache.james.modules.data.PostgresUsersRepositoryModule;
 import org.apache.james.modules.data.SievePostgresRepositoryModules;
 import org.apache.james.modules.mailbox.DefaultEventModule;
@@ -79,7 +80,7 @@ public class PostgresJamesServerMain implements 
JamesServerMain {
 
 private static final Module POSTGRES_SERVER_MODULE = Modules.combine(
 new ActiveMQQueueModule(),
-new NaiveDelegationStoreModule(),
+new PostgresDelegationStoreModule(),
 new DefaultProcessorsConfigurationProviderModule(),
 new PostgresMailboxModule(),
 new PostgresDataModule(),
diff --git 
a/server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresUsersRepositoryModule.java
 
b/server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresDelegationStoreModule.java
similarity index 74%
copy from 
server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresUsersRepositoryModule.java
copy to 
server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresDelegationStoreModule.java
index 575f7621f0..f6e5521ead 100644
--- 
a/server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresUsersRepositoryModule.java
+++ 
b/server/container/guice/postgres-common/src/main/java/org/apache/james/modules/data/PostgresDelegationStoreModule.java
@@ -22,27 +22,29 @@ package org.apache.james.modules.data;
 import org.apache.commons.configuration2.ex.ConfigurationException;
 import org.apache.james.backends.postgres.PostgresModule;
 import org.apache.james.server.core.configuration.ConfigurationProvider;
-import org.apache.james.user.api.UsersRepository;
+import org.apache.james.user.api.DelegationStore;
+import org.apache.james.user.api.DelegationUsernameChangeTaskStep;
+import org.apache.james.user.api.UsernameChangeTaskStep;
 import org.apache.james.user.lib.UsersDAO;
+import org.apache.james.user.postgres.PostgresDelegationStore;
 import org.apache.james.user.postgres.PostgresUserModule;
 import org.apache.james.user.postgres.PostgresUsersDAO;
-import org.apache.james.user.postgres.PostgresUsersRepository;
 import org.apache.james.user.postgres.PostgresUsersRepositoryConfiguration;
-import org.apache.james.utils.InitializationOperation;
-import org.apache.james.utils.InitilizationOperationBuilder;
 
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Scopes;
 import com.google.inject.Singleton;
 import com.google.inject.multibindings.Multibinder;
-import com.google.inject.multibindings.ProvidesIntoSet;
 
-public class PostgresUsersRepositoryModule extends AbstractModule {
+public class PostgresDelegationStoreModule extends AbstractModule {
 @Override
 public void configure() {
-bind(PostgresUsersRepository.class).in(Scopes.SINGLETON);
-bind(UsersRepository.class).to(PostgresUsersRepository.class);
+bind(DelegationStore.class).to(PostgresDelegationStore.class);
+
bind(PostgresDelegationStore.UserExistencePredic

(james-project) branch postgresql updated (77fd764597 -> 94635f6a2f)

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


omit 77fd764597 JAMES-2586 PostgresRecipientRewriteTableDAO and 
PostgresRecipientRewriteTable (#1844)
omit 840ad75651 JAMES-2586 PostgresTableManager - Cleanup
omit 37b9e11444 JAMES-2586 PostgresTableManager - Check the existence of 
RLS column/policy before alter the table
omit 77ab188dd6 JAMES-2586 PostgresExecutor: better recognize prepared 
statement conflict
omit 830ea81bc5 JAMES-2586 Add a unit test for recreate RLS column should 
not fail
omit b229f5faf1 JAMES-2586 Rename JPAAttachmentContentLoader to 
PostgresAttachmentContentLoader
omit 52ca5e9dbd JAMES-2586 Postgres app – Remove server test for 
authentication database sql validation
omit c3e80734d5 JAMES-2586 Fixup - Postgres app - Use junit 5 (replace to 
junit 4)
omit 7ce58fba3a JAMES-2586 Fix missing guice binding for Postgres quota 
module
omit db9d39b27d JAMES-2586 [PGSQL] Improve 
PostresMessageManager::getMetadata method
omit 28a9895a9b JAMES-2586 [PGSQL] Optimize getMailboxCounter method
omit 6b75683248 JAMES-2586 [PGSQL] Implement correctly FetchType
omit 68e778ac7b JAMES-2586 Fully drop JPA within mailbox-postgresql
omit a38f239a50 JAMES-2586 Enable PostgresMailboxManager annotation tests
omit 7324aa0d6a JAMES-2586 Enable UniqueID support for 
PostgresMailboxManager
omit ccf4fa9b6f JAMES-2586 Remove unused method in MessageManager
omit 8238b7ddf6 JAMES-2586 Remove unused class MessageUtils.java
omit 2a1e4c7b59 JAMES-2586 Enable ACL support for PG
omit 698454a765 JAMES-2586 [PGSQL] Initialization to configure users 
repository
omit c5bd9ab41f JAMES-2586 Implement PostgresPerUserMaxQuotaManager (#1839)
omit 9081a2f5a0 JAMES-2586 PostgresExecutor: Retry only upon 
PreparedStatement conflict exception
omit dfb5d80379 JAMES-2586 PostgresExecutor: Retry upon PreparedStatement 
conflicts
omit 0798659300 JAMES-2586 Rework ConnectionThreadSafetyTest -> 
PostgresExecutorThreadSafetyTest
omit eb773f4f44 JAMES-2586 Fix Postgres Mailbox Annotation mpt imap test
omit c79a72a398 JAMES-2586 Guide binding Postgres Message/Mailbox mapper
omit 08712fdf6d JAMES-2586 - Introduce 
PostgresMailboxSessionMapperFactoryTODO and using it to mpt imap test
omit aedaea1c71 JAMES-2586 - Postgres MailboxAnnotation DAO - Fix null 
pointer
omit 7a86b4cc56 JAMES-2586 - Postgres Mailbox DAO -  Fix rename deadlock
omit b8f3b368db JAMES-2586 - Fixup PostgresMailboxMessageDAO
omit 223c353226 JAMES-2586 - Fixup PostgresMessageMapper updateFlags method 
- apply single new modSeq for all messages
omit 68f002dcca JAMES-2586 - Fixup PostgresMessageMapper findMailbox method 
- ensuring the message was sorted
omit 0d4874f4f7 JAMES-2586 - MailboxMessage table - Remove FK key to 
mailbox table
omit d13bc2d856 JAMES-2586 postgres-app should run tests against Postgresql 
container for both JPA and Postgres r2dbc
omit 09dacea43b JAMES-2586 Fix Guice bindings between PostgresDomainList 
and PostgresTableManager
omit 5da4c17336 JAMES-2586 DomainList Should throw when insert duplicate or 
delete not found domain
omit 6163298422 JAMES-2586 Guice bindings and package renaming for domain 
postgres implementation
omit eca9ed2d9c JAMES-2586 Implement PostgresDomainList
omit 877a67c1c9 JAMES-2586 Remove unused method in PostgresExecutor
omit fb28e7d8e3 JAMES-2586 postgres mailbox annotation dao and mapper 
(#1822)
omit 904345f5a5 JAMES-2586 Implement Postgres Current Quota manager
omit 691fdaa94e JAMES-2586 Implement PostgresMailboxMessageDAO (#1812)
omit b3c0cfbce1 JAMES-2586 Guice binding for SieveQuotaRepository backed by 
Postgres
omit 0628f5fdc8 JAMES-2586 Implement SieveQuotaRepository backed by Postgres
omit 3fb1370128 JAMES-2586 Clean Code – the using PostgresExecutor.Factory 
(#1816)
omit 71f383cf31 JAMES-2586 Implement PostgresQuotaLimitDAO
omit 490163ab9b JAMES-2586 Implement PostgresQuotaCurrentValueDAO (#1813)
omit 52ebcbc2c4 JAMES-2586 postgres users dao and repository (#1803)
omit b32d220f37 JAMES-2586 Create hstore extension if needed upon James 
startup
omit 69ebb847cb JAMES-2586 Implement MailboxACL support for 
PostgresMailboxMapper
omit 666c7e1b22 JAMES-2586 Implement PostgresExecutor Factory and Mailbox 
Aggregate Module
omit d18939b3be JAMES-2586 Implement PostgresModSeqProvider
omit e84d5f1e1a JAMES-2586 Implement PostgresUidProvider
omit 275a8492a2 JAMES-2586 Parameterize MailboxSession for 
getUidProvider/getModSeqProvider methods in MailboxSessionMapperFactory
omit 02fbe4e47c JAMES-2586 Clean-up the provision.sh file of postgres-app
omit be6782c7c8 JAMES-2586 LOGGER when choice implementation of Postgresql 
connection factory
omit 7808c3dba1 JAMES-2586 Introd

<    1   2   3   4   5   6   7   8   9   10   >