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 2022/12/05 02:51:45 UTC

[james-project] 02/02: JAMES-3754 - IMAP support List command extension RFC-5258 - REMOTE

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 a886ba7f0c4300c5a874a064274d3d6861520c25
Author: Tung Van TRAN <vt...@linagora.com>
AuthorDate: Mon Nov 28 18:20:45 2022 +0700

    JAMES-3754 - IMAP support List command extension RFC-5258 - REMOTE
---
 .../main/resources/org/apache/james/imap/scripts/ListSubscribed.test | 4 ++++
 .../main/java/org/apache/james/imap/message/request/ListRequest.java | 5 ++++-
 .../src/main/java/org/apache/james/imap/processor/ListProcessor.java | 5 +++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListSubscribed.test b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListSubscribed.test
index 7c317a7194..28b745fc26 100644
--- a/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListSubscribed.test
+++ b/mpt/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/ListSubscribed.test
@@ -102,6 +102,10 @@ S: A15 OK UNSUBSCRIBE completed.
 C: A16 DELETE another1
 S: A16 OK DELETE completed.
 
+# REMOTE should return empty (not yet support)
+C: A31 LIST (REMOTE) "" "*"
+S: A31 OK LIST completed.
+
 # Response should has `NonExistent` attribute when the subscribed mailbox is not exist
 C: a03 SUBSCRIBE subscribeNonExistent
 S: a03 OK SUBSCRIBE completed.
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/message/request/ListRequest.java b/protocols/imap/src/main/java/org/apache/james/imap/message/request/ListRequest.java
index 24de0dc4f0..fb1e18e794 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/message/request/ListRequest.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/message/request/ListRequest.java
@@ -20,7 +20,6 @@ package org.apache.james.imap.message.request;
 
 import java.util.EnumSet;
 import java.util.Optional;
-import java.util.stream.Collectors;
 
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
@@ -86,6 +85,10 @@ public class ListRequest extends AbstractImapRequest {
         return getSelectOptions().contains(ListSelectOption.SUBSCRIBED);
     }
 
+    public boolean selectRemote() {
+        return getSelectOptions().contains(ListSelectOption.REMOTE);
+    }
+
     public Optional<StatusDataItems> getStatusDataItems() {
         return statusDataItems;
     }
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
index 15aa1a6584..c4bb28302f 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
@@ -158,6 +158,11 @@ public class ListProcessor<T extends ListRequest> extends AbstractMailboxProcess
 
     private Mono<Void> respondMailboxList(T request, ImapSession session,
                                           Responder responder, MailboxSession mailboxSession) {
+        if (request.selectRemote()) {
+            // https://www.rfc-editor.org/rfc/rfc5258.html. NOT YET SUPPORT `REMOTE`
+            return Mono.empty();
+        }
+
         // If the mailboxPattern is fully qualified, ignore the
         // reference name.
         String finalReferencename = request.getBaseReferenceName();


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