chibenwa commented on code in PR #2391:
URL: https://github.com/apache/james-project/pull/2391#discussion_r1732352080


##########
docs/modules/servers/pages/distributed/configure/jvm.adoc:
##########
@@ -103,3 +103,15 @@ Ex in `jvm.properties`
 # james.reactor.inputstream.prefetch=4
 ----
 
+== Relax mailbox name validation
+
+The property `james.relax.mailbox.name.validation` allows to accept `*` and 
`%` characters in mailbox name.
+
+Optional. Boolean. Default to true.
+
+Ex in `jvm.properties`
+----
+james.relax.mailbox.name.validation=false

Review Comment:
   ```suggestion
   james.relaxed.mailbox.name.validation=false
   ```
   



##########
docs/modules/servers/pages/distributed/configure/jvm.adoc:
##########
@@ -103,3 +103,15 @@ Ex in `jvm.properties`
 # james.reactor.inputstream.prefetch=4
 ----
 
+== Relax mailbox name validation
+
+The property `james.relax.mailbox.name.validation` allows to accept `*` and 
`%` characters in mailbox name.
+
+Optional. Boolean. Default to true.

Review Comment:
   Default to false. Let's avoid breaking changes?



##########
docs/modules/servers/pages/distributed/configure/jvm.adoc:
##########
@@ -103,3 +103,15 @@ Ex in `jvm.properties`
 # james.reactor.inputstream.prefetch=4
 ----
 
+== Relax mailbox name validation
+
+The property `james.relax.mailbox.name.validation` allows to accept `*` and 
`%` characters in mailbox name.
+
+Optional. Boolean. Default to true.
+
+Ex in `jvm.properties`
+----
+james.relax.mailbox.name.validation=false
+----
+To strictly validate `*` and `%` characters in the mailbox name.

Review Comment:
   Please explain that % and * are ambiguous for the LIST / LSUB commands that 
interprete those as wildcard thus returning all mailboxes mating the pattern.



##########
mailbox/api/src/test/java/org/apache/james/mailbox/model/MailboxPathTest.java:
##########
@@ -367,17 +367,17 @@ void assertAcceptableShouldNotThrowWhenSharpInTheMiddle() 
{
     }
 
     @Test
-    void assertAcceptableShouldThrowOnPercent() {
-        assertThatThrownBy(() -> MailboxPath.forUser(USER, "a%b")
+    void assertAcceptableShouldNotThrowOnPercentByDefault() {
+        assertThatCode(() -> MailboxPath.forUser(USER, "a%b")
             .assertAcceptable('.'))
-            .isInstanceOf(MailboxNameException.class);
+            .doesNotThrowAnyException();
     }
 
     @Test
-    void assertAcceptableShouldThrowOnWildcard() {
-        assertThatThrownBy(() -> MailboxPath.forUser(USER, "a*b")
+    void assertAcceptableShouldNotThrowOnWildcardByDefault() {
+        assertThatCode(() -> MailboxPath.forUser(USER, "a*b")
             .assertAcceptable('.'))
-            .isInstanceOf(MailboxNameException.class);
+            .doesNotThrowAnyException();
     }

Review Comment:
   Please check the two modes.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to