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 2026/02/20 23:18:27 UTC
(james-project) branch master updated: [ENHANCEMENT] Allow extending subaddressing (#2946)
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
The following commit(s) were added to refs/heads/master by this push:
new 66833c340f [ENHANCEMENT] Allow extending subaddressing (#2946)
66833c340f is described below
commit 66833c340f6fb0af14d005f6543b9d16b299246c
Author: Benoit TELLIER <bt...@linagora.com>
AuthorDate: Sat Feb 21 00:18:22 2026 +0100
[ENHANCEMENT] Allow extending subaddressing (#2946)
---
.../java/org/apache/james/transport/mailets/SubAddressing.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SubAddressing.java b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SubAddressing.java
index 9e0cd4b767..c103041ada 100644
--- a/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SubAddressing.java
+++ b/server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/SubAddressing.java
@@ -97,7 +97,8 @@ public class SubAddressing extends GenericMailet {
getPathWithCorrectCase(recipient, targetFolder)))));
}
- private Optional<MailboxPath> getPathWithCorrectCase(MailAddress recipient, String encodedTargetFolder) throws UsersRepositoryException, MailboxException {
+ // protected for being extended by extensions that provides non #private email-addressable entities
+ protected Optional<MailboxPath> getPathWithCorrectCase(MailAddress recipient, String encodedTargetFolder) throws UsersRepositoryException, MailboxException {
Username recipientUsername = usersRepository.getUsername(recipient);
MailboxSession session = mailboxManager.createSystemSession(recipientUsername);
String decodedTargetFolder = URLDecoder.decode(encodedTargetFolder, StandardCharsets.UTF_8);
@@ -117,7 +118,7 @@ public class SubAddressing extends GenericMailet {
});
}
- private void postIfHasRight(Mail mail, MailAddress recipient, Optional<MailboxPath> targetFolderPath) throws UsersRepositoryException, MailboxException {
+ protected void postIfHasRight(Mail mail, MailAddress recipient, Optional<MailboxPath> targetFolderPath) throws UsersRepositoryException, MailboxException {
if (hasPostRight(mail, recipient, targetFolderPath)) {
StorageDirective.builder().targetFolders(ImmutableList.of(targetFolderPath.get().getName())).build()
.encodeAsAttributes(usersRepository.getUsername(recipient))
@@ -128,7 +129,7 @@ public class SubAddressing extends GenericMailet {
}
}
- private Boolean hasPostRight(Mail mail, MailAddress recipient, Optional<MailboxPath> targetFolderPath) throws MailboxException, UsersRepositoryException {
+ protected Boolean hasPostRight(Mail mail, MailAddress recipient, Optional<MailboxPath> targetFolderPath) throws MailboxException, UsersRepositoryException {
try {
return targetFolderPath.isPresent() && resolvePostRight(retrieveMailboxACL(recipient, targetFolderPath.get()), mail.getMaybeSender(), recipient);
} catch (MailboxNotFoundException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org