[PR] [DOC] Update import layout suggestion [james-project]

2024-03-26 Thread via GitHub


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

   Otherwise, the old layout would fail checkstyle against the `jakarta` 
imports.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



(james-project) 02/03: [PERF] MimeMessageWrapper should avoid synchronized input stream

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

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

commit 31b5012b4a94a1a944f08929cfbaa4a8a0c903d4
Author: Benoit TELLIER 
AuthorDate: Tue Mar 26 15:16:12 2024 +0100

[PERF] MimeMessageWrapper should avoid synchronized input stream

This causes 0.5% of overall memory allocation
---
 .../james/server/core/MimeMessageWrapper.java  | 33 +-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git 
a/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageWrapper.java
 
b/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageWrapper.java
index 53f72bebfb..164a5ef850 100644
--- 
a/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageWrapper.java
+++ 
b/server/container/core/src/main/java/org/apache/james/server/core/MimeMessageWrapper.java
@@ -19,6 +19,8 @@
 
 package org.apache.james.server.core;
 
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -35,9 +37,12 @@ import jakarta.mail.MessagingException;
 import jakarta.mail.Session;
 import jakarta.mail.internet.InternetHeaders;
 import jakarta.mail.internet.MimeMessage;
+import jakarta.mail.internet.MimeUtility;
+import jakarta.mail.internet.SharedInputStream;
 import jakarta.mail.util.SharedByteArrayInputStream;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.input.UnsynchronizedBufferedInputStream;
 import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
 import org.apache.james.lifecycle.api.Disposable;
 import org.apache.james.lifecycle.api.LifecycleUtil;
@@ -569,10 +574,36 @@ public class MimeMessageWrapper extends MimeMessage 
implements Disposable {
 protected void parse(InputStream is) throws MessagingException {
 // the super implementation calls
 // headers = createInternetHeaders(is);
-super.parse(is);
+parseUnsynchronized(is);
 messageParsed = true;
 }
 
+protected void parseUnsynchronized(InputStream is) throws 
MessagingException {
+if (!(is instanceof ByteArrayInputStream) && !(is instanceof 
BufferedInputStream) && !(is instanceof SharedInputStream)) {
+try {
+is = UnsynchronizedBufferedInputStream.builder()
+.setBufferSize(8192)
+.setInputStream(is)
+.get();
+} catch (IOException e) {
+throw new MessagingException("Failure buffering stream", e);
+}
+}
+
+this.headers = this.createInternetHeaders(is);
+if (is instanceof SharedInputStream) {
+SharedInputStream sharedInputStream = (SharedInputStream)is;
+this.contentStream = 
sharedInputStream.newStream(sharedInputStream.getPosition(), -1L);
+} else {
+try {
+this.content = MimeUtility.getBytes(is);
+} catch (IOException var3) {
+throw new MessagingException("IOException", var3);
+}
+}
+this.modified = false;
+}
+
 /**
  * If we already parsed the headers then we simply return the updated ones.
  * Otherwise we parse


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



(james-project) 03/03: [PERF] JMAP download: simplify part parsing

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

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

commit fd83dae0bf5b626c6d0276523307ec1816f48b3e
Author: Benoit TELLIER 
AuthorDate: Tue Mar 26 15:21:19 2024 +0100

[PERF] JMAP download: simplify part parsing

Overall computing unused message sizes takes up to 2% of the CPU of the 
JMAP pods
---
 .../org/apache/james/jmap/mail/EmailBodyPart.scala |  20 +--
 .../james/jmap/mail/MinimalEmailBodyPart.scala | 138 +
 .../apache/james/jmap/routes/DownloadRoutes.scala  |  14 +--
 3 files changed, 148 insertions(+), 24 deletions(-)

diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailBodyPart.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailBodyPart.scala
index 28ecc58c62..b885e079fd 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailBodyPart.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/EmailBodyPart.scala
@@ -19,7 +19,6 @@
 
 package org.apache.james.jmap.mail
 
-import java.io.OutputStream
 import java.time.ZoneId
 
 import cats.implicits._
@@ -33,15 +32,13 @@ import org.apache.james.jmap.api.model.Size.Size
 import org.apache.james.jmap.core.Properties
 import org.apache.james.jmap.mail.EmailBodyPart.{FILENAME_PREFIX, MDN_TYPE, 
MULTIPART_ALTERNATIVE, TEXT_HTML, TEXT_PLAIN, of}
 import org.apache.james.jmap.mail.PartId.PartIdValue
-import org.apache.james.jmap.mime4j.{ JamesBodyDescriptorBuilder, SizeUtils}
-import org.apache.james.mailbox.model.{Cid, MessageAttachmentMetadata, 
MessageResult}
+import org.apache.james.jmap.mime4j. SizeUtils
+import org.apache.james.mailbox.model.{Cid, MessageAttachmentMetadata}
 import org.apache.james.mime4j.Charsets.ISO_8859_1
 import org.apache.james.mime4j.codec.{DecodeMonitor, DecoderUtil}
 import org.apache.james.mime4j.dom.field.{ContentDispositionField, 
ContentLanguageField, ContentTypeField, FieldName}
 import org.apache.james.mime4j.dom.{Entity, Message, Multipart, TextBody => 
Mime4JTextBody}
-import org.apache.james.mime4j.field.LenientFieldParser
-import org.apache.james.mime4j.message.{BasicBodyFactory, 
DefaultMessageBuilder}
-import org.apache.james.mime4j.stream.{Field, MimeConfig, RawField}
+import org.apache.james.mime4j.stream.{Field, RawField}
 import org.apache.james.util.html.HtmlTextExtractor
 
 import scala.jdk.CollectionConverters._
@@ -77,17 +74,6 @@ object EmailBodyPart {
   val defaultProperties: Properties = Properties("partId", "blobId", "size", 
"name", "type", "charset", "disposition", "cid", "language", "location")
   val allowedProperties: Properties = defaultProperties ++ 
Properties("subParts", "headers")
 
-  def ofMessage(properties: Option[Properties], zoneId: ZoneId, blobId: 
BlobId, message: MessageResult): Try[EmailBodyPart] = {
-val defaultMessageBuilder = new DefaultMessageBuilder
-defaultMessageBuilder.setMimeEntityConfig(MimeConfig.PERMISSIVE)
-defaultMessageBuilder.setDecodeMonitor(DecodeMonitor.SILENT)
-defaultMessageBuilder.setBodyDescriptorBuilder(new 
JamesBodyDescriptorBuilder(null, LenientFieldParser.getParser, 
DecodeMonitor.SILENT))
-defaultMessageBuilder.setBodyFactory(new 
BasicBodyFactory(Email.defaultCharset))
-
-val mime4JMessage = 
Try(defaultMessageBuilder.parseMessage(message.getFullContent.getInputStream))
-mime4JMessage.flatMap(of(properties, zoneId, blobId, _))
-  }
-
   def fromAttachment(properties: Option[Properties], zoneId: ZoneId, 
attachment: MessageAttachmentMetadata, entity: Message): EmailBodyPart = {
 def parseDisposition(attachment: MessageAttachmentMetadata): 
Option[Disposition] =
   if (attachment.isInline) {
diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/MinimalEmailBodyPart.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/MinimalEmailBodyPart.scala
new file mode 100644
index 00..56a03904f3
--- /dev/null
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/MinimalEmailBodyPart.scala
@@ -0,0 +1,138 @@
+/
+ * 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   *
+ *  *
+ * 

(james-project) 01/03: [PERF] Avoid calling Session::getAttachment on each SMTP line

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

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

commit 15ec572e9e3af42128eefb1fb98e1ee7a0904b93
Author: Benoit TELLIER 
AuthorDate: Tue Mar 26 15:15:22 2024 +0100

[PERF] Avoid calling Session::getAttachment on each SMTP line

2% of the memory allocation was spent doing this.
---
 .../protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java| 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
index a2f90e9d67..6e6774acaa 100644
--- 
a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
+++ 
b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/MailSizeEsmtpExtension.java
@@ -50,7 +50,6 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 private static final Logger LOGGER = 
LoggerFactory.getLogger(MailSizeEsmtpExtension.class);
 
 private static final ProtocolSession.AttachmentKey MESG_SIZE = 
ProtocolSession.AttachmentKey.of("MESG_SIZE", Integer.class); // The size of the
-private static final ProtocolSession.AttachmentKey MESG_FAILED = 
ProtocolSession.AttachmentKey.of("MESG_FAILED", Boolean.class);   // Message 
failed flag
 private static final String[] MAIL_PARAMS = { "SIZE" };
 
 private static final HookResult SYNTAX_ERROR = HookResult.builder()
@@ -70,6 +69,7 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 public HookResult doMailParameter(SMTPSession session, String paramName,
   String paramValue) {
 MaybeSender tempSender = session.getAttachment(SMTPSession.SENDER, 
State.Transaction).orElse(MaybeSender.nullSender());
+session.setMessageFailed(false);
 return doMailSize(session, paramValue, tempSender);
 }
 
@@ -135,10 +135,10 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 
 @Override
 public Response onLine(SMTPSession session, byte[] line, 
LineHandler next) {
-Optional failed = session.getAttachment(MESG_FAILED, 
State.Transaction);
+boolean failed = session.messageFailed();
 // If we already defined we failed and sent a reply we should simply
 // wait for a CRLF.CRLF to be sent by the client.
-if (failed.isPresent() && failed.get()) {
+if (failed) {
 if (isDataTerminated(line)) {
 next.onLine(session, line);
 return new SMTPResponse(SMTPRetCode.QUOTA_EXCEEDED, "Quota 
exceeded");
@@ -160,7 +160,7 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 // logging of extra lines of data
 // that are sent after the size limit has
 // been hit.
-session.setAttachment(MESG_FAILED, Boolean.TRUE, 
State.Transaction);
+session.setMessageFailed(true);
 
 return null;
 } else {
@@ -176,8 +176,8 @@ public class MailSizeEsmtpExtension implements 
MailParametersHook, EhloExtension
 
 @Override
 public HookResult onMessage(SMTPSession session, MailEnvelope mail) {
-Optional failed = session.getAttachment(MESG_FAILED, 
State.Transaction);
-if (failed.orElse(false)) {
+boolean failed = session.messageFailed();
+if (failed) {
 LOGGER.info("Rejected message from {} from {} exceeding system 
maximum message size of {}",
 session.getAttachment(SMTPSession.SENDER, 
State.Transaction).orElse(MaybeSender.nullSender()).asPrettyString(),
 session.getRemoteAddress().getAddress().getHostAddress(), 
session.getConfiguration().getMaxMessageSize());


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



[PR] [FIX] JamesMailSpooler should be more resilient on JVM Error [james-project]

2024-03-26 Thread via GitHub


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

   Upon JVM Error, the error would not be caught to be retried. Therefore, the 
message would not be acked -> RabbitMQ would disconnect the MailQueue consumer 
after the [Delivery Acknowledgement 
Timeout](https://www.rabbitmq.com/docs/consumers#acknowledgement-timeout).
   
   For example, a custom mailet that depends on the old `javax` APIs caused 
`java.lang.NoSuchMethodError: 'javax.mail.internet.MimeMessage 
org.apache.mailet.Mail.getMessage()` that caused the RabbitMQ consumer being 
disconnected.
   
   And `NoSuchMethodError` is a subclass of `Throwable`, not `Exception`.
   
   ```json
   {
   "timestamp": "2024-03-26T11:34:42.677Z",
   "level": "WARN",
   "thread": "spooler-39",
   "logger": "reactor.core.Exceptions",
   "message": "throwIfFatal detected a jvm fatal exception, which is thrown 
and logged below:",
   "context": "default",
   "exception": "java.lang.NoSuchMethodError: 
'javax.mail.internet.MimeMessage org.apache.mailet.Mail.getMessage()'\n\tat 
com.linagora.workathome.james.JsonSummaryAsAttribute.extractJsonSummary(JsonSummaryAsAttribute.java:79)\n\tat
 
com.linagora.workathome.james.JsonSummaryAsAttribute.service(JsonSummaryAsAttribute.java:70)\n\tat
 
org.apache.james.mailetcontainer.impl.ProcessorImpl.process(ProcessorImpl.java:81)\n\tat
 
com.github.fge.lambdas.consumers.ConsumerChainer.lambda$sneakyThrow$9(ConsumerChainer.java:73)\n\tat
 java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown 
Source)\n\tat java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown 
Source)\n\tat java.base/java.util.Collections$2.tryAdvance(Unknown 
Source)\n\tat java.base/java.util.Collections$2.forEachRemaining(Unknown 
Source)\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(Unknown 
Source)\n\tat 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown 
Source)\n\tat java.base/java.
 util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)\n\tat 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown
 Source)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(Unknown 
Source)\n\tat java.base/java.util.stream.ReferencePipeline.forEach(Unknown 
Source)\n\tat 
org.apache.james.mailetcontainer.impl.MailetProcessorImpl.executeProcessingStep(MailetProcessorImpl.java:163)\n\tat
 
org.apache.james.mailetcontainer.impl.MailetProcessorImpl.lambda$service$0(MailetProcessorImpl.java:131)\n\tat
 java.base/java.util.stream.ReduceOps$1ReducingSink.accept(Unknown 
Source)\n\tat 
java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown 
Source)\n\tat java.base/java.util.stream.AbstractPipeline.copyInto(Unknown 
Source)\n\tat 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown 
Source)\n\tat 
java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown 
Source)\n\tat java.base/java.util.stream.AbstractPip
 eline.evaluate(Unknown Source)\n\tat 
java.base/java.util.stream.ReferencePipeline.reduce(Unknown Source)\n\tat 
org.apache.james.mailetcontainer.impl.MailetProcessorImpl.service(MailetProcessorImpl.java:129)\n\tat
 
org.apache.james.mailetcontainer.lib.AbstractStateCompositeProcessor.handleWithProcessor(AbstractStateCompositeProcessor.java:99)\n\tat
 
org.apache.james.mailetcontainer.lib.AbstractStateCompositeProcessor.service(AbstractStateCompositeProcessor.java:81)\n\tat
 
org.apache.james.mailetcontainer.lib.AbstractStateMailetProcessor.toProcessor(AbstractStateMailetProcessor.java:152)\n\tat
 
org.apache.james.mailetcontainer.impl.MailetProcessorImpl.lambda$executeProcessingStep$7(MailetProcessorImpl.java:168)\n\tat
 
com.github.fge.lambdas.consumers.ConsumerChainer.lambda$sneakyThrow$9(ConsumerChainer.java:73)\n\tat
 java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown 
Source)\n\tat java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown 
Source)\n\tat java.base/java
 .util.stream.ReferencePipeline$2$1.accept(Unknown Source)\n\tat 
java.base/java.util.Collections$2.tryAdvance(Unknown Source)\n\tat 
java.base/java.util.Collections$2.forEachRemaining(Unknown Source)\n\tat 
java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)\n\tat 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown 
Source)\n\tat 
java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown 
Source)\n\tat 
java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown
 Source)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(Unknown 
Source)\n\tat java.base/java.util.stream.ReferencePipeline.forEach(Unknown 
Source)\n\tat 
org.apache.james.mailetcontainer.impl.MailetProcessorImpl.executeProcessingStep(MailetProcessorImpl.java:168)\n\tat
 
org.apache.james.mailetcontainer.impl.MailetProcessorImpl.lambda$service$0(MailetProcessorImpl.java:131)\n\tat
 

Re: [PR] [PERF] Collection of profiling improvments [james-project]

2024-03-26 Thread via GitHub


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



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

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

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


from 6e7bc6be51 [ENHANCEMENT] IMAP configuration for netty high/low write 
buffer watermarks
 new 15ec572e9e [PERF] Avoid calling Session::getAttachment on each SMTP 
line
 new 31b5012b4a [PERF] MimeMessageWrapper should avoid synchronized input 
stream
 new fd83dae0bf [PERF] JMAP download: simplify part parsing

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:
 .../smtp/core/esmtp/MailSizeEsmtpExtension.java|  12 +-
 .../james/server/core/MimeMessageWrapper.java  |  33 -
 .../org/apache/james/jmap/mail/EmailBodyPart.scala |  20 +--
 .../james/jmap/mail/MinimalEmailBodyPart.scala | 138 +
 .../apache/james/jmap/routes/DownloadRoutes.scala  |  14 +--
 5 files changed, 186 insertions(+), 31 deletions(-)
 create mode 100644 
server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/MinimalEmailBodyPart.scala


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



Re: [PR] [FIX] IMAP STATUS should better handle MailboxNotFoundException [james-project]

2024-03-26 Thread via GitHub


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

   (doubled checked against cyrus for the actual behaviour)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



[PR] [FIX] IMAP STATUS should better handle MailboxNotFoundException [james-project]

2024-03-26 Thread via GitHub


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

   Some MUA requests mailboxes that no longer exist nor are subscribed.
   
- Explicit IMAP message
- Stacktrace is not necessary in the error message
- INFO log
   
   Overall computing unused message sizes takes up to 2% of the CPU of the JMAP 
pods


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



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

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

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


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

commit 9448387e0c20692057c9589c7654f28b21d09f6b
Author: jenkins 
AuthorDate: Tue Mar 26 16:41:30 2024 +

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

diff --git a/sitemap-james-project.xml b/sitemap-james-project.xml
index a0f55596a..9cb016c8b 100644
--- a/sitemap-james-project.xml
+++ b/sitemap-james-project.xml
@@ -2,186 +2,186 @@
 http://www.sitemaps.org/schemas/sitemap/0.9;>
 
 
https://james.apache.org/james-project/3.8.1/community/contributing.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/community/download.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/community/guidelines.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/community/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/community/mailing-lists.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/community/release.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/community/support.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/community/website.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/configuration.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/concepts/glossary.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/concepts/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/mail/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/messages/imf.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/messages/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/messages/mime.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/processing/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/esmtp.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/imap.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/jmap.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/lmtp.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/pop.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/protocols/smtp.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/storage/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/storage/mailbox.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/storage/users.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/concepts/user/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/customization/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/development/deployment-tests.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 https://james.apache.org/james-project/3.8.1/development/index.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 
https://james.apache.org/james-project/3.8.1/development/logging.html
-2024-03-26T07:33:42.966Z
+2024-03-26T16:40:50.036Z
 
 
 

[PR] [PERF] Collection of profiling improvments [james-project]

2024-03-26 Thread via GitHub


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

- Avoid needlessly computing part sizes with JMAP message part downloads
- Avoid using synchronized imput stream
- Avoid calling session::getAttachment on each SMTP line


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



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

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

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

commit 6e7bc6be51ed94deb022209310a6a662880c1813
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 16:56:07 2024 +0100

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

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

Re: [PR] [ENHANCEMENT] More Netty tunning options [james-project]

2024-03-26 Thread via GitHub


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



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

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

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


from effc90e222 [FIX] Avoid a worring error log upon state not found (#2155)
 new e4fb4c6984 [ENHANCEMENT] Allow James to use native Netty Epoll
 new 45e53c306a [ENHANCEMENT] Netty Epoll transport for Cassandra driver
 new 6e7bc6be51 [ENHANCEMENT] IMAP configuration for netty high/low write 
buffer watermarks

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


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


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



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

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

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

commit 45e53c306a08b8d751d35eab6efa3b1992939d6c
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 16:52:40 2024 +0100

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

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


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



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

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

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

commit e4fb4c6984824e6e4bd581642ff146198e8f28e1
Author: Benoit TELLIER 
AuthorDate: Mon Mar 18 15:26:01 2024 +0100

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

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

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

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

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


The following commit(s) were added to refs/heads/master by this push:
 new effc90e222 [FIX] Avoid a worring error log upon state not found (#2155)
effc90e222 is described below

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

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

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


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



Re: [PR] [FIX] Avoid a worring error log upon state not found [james-project]

2024-03-26 Thread via GitHub


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



(james-project) branch master updated: [FIX] Filter too big values for Cassandra TTLs (#2156)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new de80310717 [FIX] Filter too big values for Cassandra TTLs (#2156)
de80310717 is described below

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

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

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


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



Re: [PR] [CHANGELOG] Changelog update (25/03/2024) [james-project]

2024-03-26 Thread via GitHub


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



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

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

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


from f3f9f24805 JAMES-3961 data-file RRT test should not fail unstable test 
phase
 add 288e25c2df [CHANGELOG] Changelog update (25/03/2024) (#2153)

No new revisions were added by this update.

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


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



Re: [PR] [FIX] Filter too big values for Cassandra TTLs [james-project]

2024-03-26 Thread via GitHub


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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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