På torsdag 10. juni 2021 kl. 15:44:17, skrev btell...@apache.org <mailto:btell...@apache.org> <btell...@apache.org <mailto:btell...@apache.org>>:
[...] We only use JAMES for IMAP. So you only use the content of /protocols/imap, correct? This means that you had been implementing / will be implementing some mailbox-api implementation of your own, correct? Yes, we have a working implementation based on a custom, extended, version on James-3.0.4-beta. We've used that for a long time and are now looking at upgrading to v3.6. But the usage of the Username-class, with its current "non-POJO restrictions", in the API makes things a little more difficult for us that we'd like.... [...] @Test void arbitraryCharInLocalPart() { assertThatCode(() -> Username.of( "Whatever_I- want3$$$###_! as lons I do not give a domain")) .doesNotThrowAnyException(); } The only constraint if a domain part is unspecified, is the size of 256 character and the absence of @. To come back to your original problem, what prevents, for instance the user scheme to be: <username>_<customer-key> ? In short; What prevents us from using Username is (we only user "userid", ie. Username.localPart, we don't use "domain"): 1. The "userid"-part must allow any character, including '@'. Many of our customers have '@' in their usernames, for various reasons. (well, \n and other control-characters are really not needed). 2. The "userid" should be case-sensitive. Both of these are according to the IMAP-spec, so it's sad that James prevents this. As said, using Base32 encoding lets us get around this, but it doesn't "feel right". The fact that Username uses toLowercase(Locale.US) actually lets one use other interesting encodings likeecoji <https://github.com/keith-turner/ecoji>, as it doesn't touch multibyte-characters/codepoints when lowercasing. So - again; What about having a Username-class which is just that, any username? -- Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963 andr...@visena.com <mailto:andr...@visena.com> www.visena.com <https://www.visena.com> <https://www.visena.com>
--------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org