-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
James 4099 Configurable path delimiter #2588
base: master
Are you sure you want to change the base?
James 4099 Configurable path delimiter #2588
Conversation
…hen escaping usernames
|
@Test | ||
void assertAcceptableShouldNotThrowOnPercentWhenRelaxMode() { | ||
System.setProperty("james.relaxed.mailbox.name.validation", "true"); | ||
|
||
assertThatCode(() -> MailboxPath.forUser(USER, "a%b")) | ||
.doesNotThrowAnyException(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old version of the relax-mode tests essentially asked "If I do nothing, does it throw an exception?" 😁 Obviously, that sort of mistake is easy to overlook as the resulting test trivially passes, but I still found it a bit funny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what happens when TDD is overlooked I believe!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks overall good to me.
Thanks for the quality contribution.
I did took the time to review what Cyrus does. It offers either .
or /
as a delimiter. So I am OK with the implemented behavious.
Please clearly state in the documentation AND in the configuration comment that this option is not safe to change once you have data and will result in loss of the folder hierarchy.
Currently, I'm writing everywhere |
I saw that the So, to be clear: If the |
Yes! |
Okay, so I added that. Do you know of any more locations where it would be critical to honor the new delimiter? (I did not find any, but I'm not sure that means much) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, When I read RFC documents, It tend to use /
more frequently as an example.
James-4099
Add a configuration switch for adjusting the default mailbox folder delimiter.
Currently allowed (because unit-tested) values are:
dot
(will use '.' as delimiter),slash
(will use '/' as delimiter),pipe
('|'),comma
(','),colon
(':'),semicolon
(';').Currently explicitly left-out values are: '#' (clashes with namespace prefix character), '\' (anticipated some problems with the prefixedRegex matching and because it is the escaping character, it can generally be a bit more annoying to deal with in strings).
This feature is opt in - the default configuration will still retain the current default delimiter (dot).
Notes to reviewer:
MailPathTests
andPrefixedRegexTests
into their own commits to improve diff readability.Domain.java
orMailAddress.java
is independent of the mailbox folder delimiter, but theFileIntoAction
, for example, also has a hierarchy delimiter.