You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/03/22 02:03:34 UTC

[james-project] 05/25: JAMES-3722 Avoid sending empty VANISHED responses

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 f5fa4d40b97827d280d00062b09a5c999e87c0d3
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Mar 7 22:39:09 2022 +0700

    JAMES-3722 Avoid sending empty VANISHED responses
    
    We currently return empty vanished response whose syntax is invalid.
    
    We don't match RFC-3501 sequence-set formal syntax that guaranty at least one element
---
 .../org/apache/james/imap/processor/AbstractMailboxProcessor.java     | 4 +++-
 .../test/java/org/apache/james/imapserver/netty/IMAPServerTest.java   | 2 --
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
index 919445f..3d1c892 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
@@ -551,7 +551,9 @@ public abstract class AbstractMailboxProcessor<R extends ImapRequest> extends Ab
 
         }
         UidRange[] vanishedIdRanges = uidRanges(MessageRange.toRanges(vanishedUids));
-        responder.respond(new VanishedResponse(vanishedIdRanges, true));
+        if (vanishedIdRanges.length > 0) {
+            responder.respond(new VanishedResponse(vanishedIdRanges, true));
+        }
     }
     
     
diff --git a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
index 4799857..b568b38 100644
--- a/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
+++ b/server/protocols/protocols-imap4/src/test/java/org/apache/james/imapserver/netty/IMAPServerTest.java
@@ -1461,8 +1461,6 @@ class IMAPServerTest {
             imapServer.destroy();
         }
 
-        @Disabled("JAMES-3722 We currently return empty vanished response whose syntax is invalid." +
-            "We don't match RFC-3501 sequence-set formal syntax that guaranty at least one element")
         @Test
         void selectShouldNotAnswerEmptyVanishedResponses() throws Exception {
             MailboxSession mailboxSession = memoryIntegrationResources.getMailboxManager().createSystemSession(USER);

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