You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2024/04/17 03:39:46 UTC

(james-project) branch master updated (854e8d9a5a -> 143dc949fa)

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 854e8d9a5a JAMES-3498 Modify the access for CassandraEventDeadLetters, CassandraEventDeadLettersDAO
     new d09b3cb234 JAMES-4028 MailImpl: More compact version of Mail.getName
     new 143dc949fa JAMES-4028 MailImpl: More compact version of Mail.getName

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:
 .../core/src/main/java/org/apache/james/server/core/MailImpl.java  | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)


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


(james-project) 01/02: JAMES-4028 MailImpl: More compact version of Mail.getName

Posted by rc...@apache.org.
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 d09b3cb23470dd096608ea84a4d027efbb36c570
Author: Benoit TELLIER <bt...@linagora.com>
AuthorDate: Mon Apr 15 16:14:01 2024 +0200

    JAMES-4028 MailImpl: More compact version of Mail.getName
    
    On a production system we encountered a JMAP query for which the clause count
    of OpenSearch (- 1024) was exceeded. This commit makes sure that it is not
    linked to the overall right filtering strategy pushing the mailboxes to search
    in onto the search query.
---
 .../core/src/main/java/org/apache/james/server/core/MailImpl.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java b/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java
index fd6fd0d3a2..d1c5aa74c8 100644
--- a/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java
+++ b/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java
@@ -44,6 +44,7 @@ import jakarta.mail.internet.MimeMessage;
 import jakarta.mail.internet.ParseException;
 
 import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.james.core.MailAddress;
 import org.apache.james.core.MaybeSender;
@@ -323,7 +324,7 @@ public class MailImpl implements Disposable, Mail {
     @VisibleForTesting static String deriveNewName(String currentName) throws MessagingException {
         char separator = '!';
         int loopThreshold = 7;
-        int suffixLength = 9;
+        int suffixLength = 5;
         int suffixMaxLength = loopThreshold * suffixLength;
         int nameMaxLength = suffixMaxLength + 13;
 
@@ -342,7 +343,7 @@ public class MailImpl implements Disposable, Mail {
     }
 
     private static String generateRandomSuffix(int suffixLength, char separator) {
-        return "-" + separator + RandomStringUtils.randomNumeric(suffixLength - 2);
+        return separator + RandomStringUtils.randomAlphanumeric(suffixLength - 1);
     }
 
     private static void detectPossibleLoop(String currentName, int loopThreshold, char separator) throws MessagingException {
@@ -788,7 +789,7 @@ public class MailImpl implements Disposable, Mail {
      * @return the new identifier
      */
     public static String getId() {
-        return "Mail" + System.currentTimeMillis() + "-" + UUID.randomUUID();
+        return "Mail" + System.currentTimeMillis() + "-" + RandomStringUtils.randomAlphanumeric(20);
     }
 
     @Override


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


(james-project) 02/02: JAMES-4028 MailImpl: More compact version of Mail.getName

Posted by rc...@apache.org.
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 143dc949fad03ab9ced0d518aeba6de4edd68a77
Author: Benoit TELLIER <bt...@linagora.com>
AuthorDate: Mon Apr 15 21:43:51 2024 +0200

    JAMES-4028 MailImpl: More compact version of Mail.getName
    
    On a production system we encountered a JMAP query for which the clause count
    of OpenSearch (- 1024) was exceeded. This commit makes sure that it is not
    linked to the overall right filtering strategy pushing the mailboxes to search
    in onto the search query.
---
 .../core/src/main/java/org/apache/james/server/core/MailImpl.java       | 2 --
 1 file changed, 2 deletions(-)

diff --git a/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java b/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java
index d1c5aa74c8..6f2a24c736 100644
--- a/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java
+++ b/server/container/core/src/main/java/org/apache/james/server/core/MailImpl.java
@@ -31,7 +31,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-import java.util.UUID;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -44,7 +43,6 @@ import jakarta.mail.internet.MimeMessage;
 import jakarta.mail.internet.ParseException;
 
 import org.apache.commons.lang3.RandomStringUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.james.core.MailAddress;
 import org.apache.james.core.MaybeSender;


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