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 9df83dee10 JAMES-2182 Support LIST "" "#user.*" (#2511)
9df83dee10 is described below

commit 9df83dee108f68eecb841e3d4abc6fa54c8811e8
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Tue Nov 19 14:40:25 2024 +0700

    JAMES-2182 Support LIST "" "#user.*" (#2511)
---
 .../org/apache/james/imap/scripts/ListWithSharedMailbox.test     | 9 +++++++++
 .../src/main/java/org/apache/james/imap/main/PathConverter.java  | 6 ++++++
 2 files changed, 15 insertions(+)

diff --git 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListWithSharedMailbox.test
 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListWithSharedMailbox.test
index 6378cf5be5..3295f2995a 100644
--- 
a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListWithSharedMailbox.test
+++ 
b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListWithSharedMailbox.test
@@ -100,6 +100,15 @@ S: \* LIST \(\\HasNoChildren\) \".\" \"#user.boby.Sent\"
 }
 S: a12 OK LIST completed.
 
+C: a13 LIST "" "#user.*"
+SUB {
+S: \* LIST \(\\HasNoChildren\) \".\" \"#user.diana.sharedMailbox\"
+S: \* LIST \(\\HasChildren\) \".\" \"#user.boby.sharedMailbox\"
+S: \* LIST \(\\HasNoChildren\) \".\" \"#user.boby.sharedMailbox.child\"
+S: \* LIST \(\\HasNoChildren\) \".\" \"#user.boby.Sent\"
+}
+S: a13 OK LIST completed.
+
 C: b01 SUBSCRIBE INBOX
 S: b01 OK SUBSCRIBE completed.
 C: b02 SUBSCRIBE #user.diana.sharedMailbox
diff --git 
a/protocols/imap/src/main/java/org/apache/james/imap/main/PathConverter.java 
b/protocols/imap/src/main/java/org/apache/james/imap/main/PathConverter.java
index b8bb7093c1..5164f14602 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/main/PathConverter.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/main/PathConverter.java
@@ -177,6 +177,12 @@ public interface PathConverter {
                         .matchesAllMailboxNames()
                         .build();
                 }
+                int delimiterPosition = 
mailboxName.indexOf(mailboxSession.getPathDelimiter());
+                if (mailboxName.startsWith("#") && delimiterPosition > 0 && 
delimiterPosition + 1 < mailboxName.length()) {
+                    return mailboxQuery(mailboxName.substring(0, 
delimiterPosition),
+                        mailboxName.substring(delimiterPosition + 1),
+                        session);
+                }
                 return MailboxQuery.builder()
                     .expression(new PrefixedRegex(
                         "",


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

Reply via email to