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 2024/09/20 06:47:56 UTC
(james-project) 06/07: JAMES-3945 added some documentation for the SubAddressing mailet
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 d404d87da05edc25a44d7ba094f97b2c18a3947c
Author: Florent AZAVANT <fa...@linagora.com>
AuthorDate: Wed Sep 18 11:16:04 2024 +0200
JAMES-3945 added some documentation for the SubAddressing mailet
---
docs/modules/servers/partials/SubAddressing.adoc | 22 ++++++++++++++++++++++
.../servers/partials/configure/mailets.adoc | 4 +++-
.../james/transport/mailets/SubAddressing.java | 20 ++++++++++++++++++--
3 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/docs/modules/servers/partials/SubAddressing.adoc b/docs/modules/servers/partials/SubAddressing.adoc
new file mode 100644
index 0000000000..7d55af48ad
--- /dev/null
+++ b/docs/modules/servers/partials/SubAddressing.adoc
@@ -0,0 +1,22 @@
+=== SubAddressing
+
+SubAddressing positions a storage directive for the folder this email will be delivered in if the following criteria are met:
+
+* the sender has requested the storage directive by sending the mail to <strong> `recipient+folder@domain` </strong> instead of just `recipient@domain` ;
+* the folder <strong>exists</strong> and the recipient has <strong>allowed</strong> the sender to send a mail to that specific folder.
+
+These directives are used by <strong>LocalDelivery</strong> mailet when adding the email to the recipients mailboxes.
+
+The storage directive is recognized when a specific character or character sequence is present in the local part of the recipient address. <strong>By default, it is "+"</strong>.
+
+If the sender is not allowed to send a mail to the specified folder, then the mail is delivered in the recipient's inbox.
+Likewise, if the storage directive is empty or absent, the mail will simply be delivered in the recipient's inbox.
+
+Thus,
+
+ * a mail sent to `recipient+folder@domain` will be delivered to recipient's folder `folder` if allowed ;
+ * a mail sent to `recipient+my-super-folder@domain` will be delivered to recipient's folder `my-super-folder` if allowed ;
+ * a mail sent to `recipient@domain` or `recipient+@domain` will be delivered to recipient's inbox.
+
+Any user can position rights for other users and for its different folders. They may create whitelists or blacklists, for one or several folders.
+In the case where the sender is unknown, the mail will be delivered in the specified folder only if the recipient has allowed everyone for that folder.
\ No newline at end of file
diff --git a/docs/modules/servers/partials/configure/mailets.adoc b/docs/modules/servers/partials/configure/mailets.adoc
index 9c534c1274..7a8b690a6d 100644
--- a/docs/modules/servers/partials/configure/mailets.adoc
+++ b/docs/modules/servers/partials/configure/mailets.adoc
@@ -141,4 +141,6 @@ include::partial$UnwrapText.adoc[]
include::partial$UseHeaderRecipients.adoc[]
-include::partial$WrapText.adoc[]
\ No newline at end of file
+include::partial$WrapText.adoc[]
+
+include::partial$SubAddressing.adoc[]
\ No newline at end of file
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 73edff3121..fa42f2820d 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
@@ -31,7 +31,6 @@ import org.apache.james.core.Username;
import org.apache.james.mailbox.MailboxManager;
import org.apache.james.mailbox.MailboxSession;
import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.acl.MailboxACLResolver;
import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
import org.apache.james.mailbox.exception.MailboxException;
import org.apache.james.mailbox.exception.MailboxNotFoundException;
@@ -49,7 +48,24 @@ import org.slf4j.LoggerFactory;
import com.github.fge.lambdas.Throwing;
import com.google.common.collect.ImmutableList;
-
+/**
+ * SubAddressing positions a storage directive for the folder this email will be delivered in if the following criteria are met:
+ * - the sender has requested the storage directive by sending the mail to <strong>`recipient+folder@domain`</strong> instead of just `recipient@domain` ;
+ * - the folder <strong>exists</strong> and the recipient has <strong>allowed</strong> the sender to send a mail to that specific folder.
+ *
+ * These directives are used by <strong>LocalDelivery</strong> mailet when adding the email to the recipients mailboxes.
+ *
+ * The storage directive is recognized when a specific character or character sequence is present in the local part of the recipient address. <strong>By default, it is "+"</strong>.
+ * If the sender is not allowed to send a mail to the specified folder, then the mail is delivered in the recipient's inbox.
+ * Likewise, if the storage directive is empty or absent, the mail will simply be delivered in the recipient's inbox.
+ * Thus,
+ * - a mail sent to `recipient+folder@domain` will be delivered to recipient's folder `folder` if allowed ;
+ * - a mail sent to `recipient+my-super-folder@domain` will be delivered to recipient's folder `my-super-folder` if allowed ;
+ * - a mail sent to `recipient@domain` or `recipient+@domain` will be delivered to recipient's inbox.
+ *
+ * Any user can position rights for other users and for its different folders. They may create whitelists or blacklists, for one or several folders.
+ * In the case where the sender is unknown, the mail will be delivered in the specified folder only if the recipient has allowed everyone for that folder.
+ */
public class SubAddressing extends GenericMailet {
private static final Logger LOG = LoggerFactory.getLogger(SubAddressing.class);
private static final Username NO_ASSOCIATED_USER = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org