| <?xml version="1.0"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <document> |
| |
| <properties> |
| <title>Apache James Server 3 - Listeners Configuration</title> |
| </properties> |
| |
| <body> |
| |
| <section name="Mailbox listeners configuration overview"> |
| |
| <p> |
| Note: This feature requires Guice wiring. This is not implemented using Spring wiring.<br/> |
| Additionally, wiring not providing a mailbox support, like <code>jpa-smtp</code>, do not have support for |
| mailbox listeners configuration. |
| </p> |
| |
| <p>Consult <a href="https://github.com/apache/james-project/blob/master/dockerfiles/run/guice/cassandra/destination/conf/listeners.xml">listeners.xml</a> |
| to get some examples and hints.</p> |
| |
| <p>James Guice wiring allow the user to register potentially user defined additional mailbox listeners.</p> |
| |
| <p>To do so, just register the class that needs to be instantiated and added to global listeners. These JAR can be |
| part of James source code, or provided as an extension and thus should be located in the<code>extensions-jars</code> folder.</p> |
| </section> |
| |
| <section name="MailboxListener configuration"> |
| <p> |
| The <executeGroupListeners> controls whether to launch group mailbox listener consumption. |
| Defaults to true. Use with caution: |
| never disable on standalone james servers, and ensure at least some instances do consume group mailbox listeners within a |
| clustered topology. |
| </p> |
| <p> |
| Mailbox listener configuration is under the XML element <listener> |
| </p> |
| <p> |
| Some MailboxListener allows you to specify if you want to run them synchronously or asynchronously. To do so, |
| for MailboxListener that supports this, you can use the <b>async</b> attribute (optional, per mailet default) to govern the execution mode. |
| If <b>true</b> the execution will be scheduled in a reactor elastic scheduler. If <b>false</b>, the execution is synchronous. |
| </p> |
| |
| <ul> |
| Already provided additional listeners includes: |
| |
| <li><code>org.apache.james.mailbox.spamassassin.SpamAssassinListener</code>: |
| Provides per user real-time HAM/SPAM feedback to a SpamAssassin server depending on user actions. |
| Please note that a <code>spamassassin.properties</code> file is needed.<br/> |
| This mailet is asynchronous by default, but this behaviour can be overridden by the <b>async</b> |
| configuration property.</li> |
| <li><code>org.apache.james.mailbox.cassandra.MailboxOperationLoggingListener</code>: |
| For Cassandra guice wiring. Provides more insights on mailbox operations</li> |
| <li><code>org.apache.james.mailbox.quota.mailing.listeners.QuotaThresholdCrossingListener</code>: |
| For Cassandra guice wiring. Sends emails to users exceeding 80% and 99% of their quota to warn them</li> |
| </ul> |
| </section> |
| <section name="PreDeletionHook configuration"> |
| <p> |
| Before deleting a message in James, this message and some related information about the deletion will be passed to a set of PreDeletionHook instances, |
| This process is called notifying, and it acts sequentially. If the notifying process for all PreDeletionHooks finish successfully, then the message will be processed to be deleted. |
| Otherwise, that message won't be deleted. |
| </p> |
| <p> |
| Pre Deletion Hook configuration is under the XML element <preDeletionHook> |
| </p> |
| <ul> |
| Already provided additional pre deletion hooks includes: |
| <li> |
| <code>org.apache.james.vault.DeletedMessageVaultHook</code>: |
| Storing messages about being deleted into <code>org.apache.james.vault.DeletedMessageVault</code> |
| </li> |
| </ul> |
| </section> |
| |
| <section name="Add custom Guice injections for extensions"> |
| <p>Upon injections, the user can reference additional guice modules, that are going to be used only upon extensions instantiation. |
| In order to do that:</p> |
| <p> 1. Place the jar containing the guice module that should be used to instantiate your extensions within the /extensions-jars folder</p> |
| <p> 2. Register your module fully qualified class name within <a href="https://github.com/apache/james-projectdockerfiles/run/guice/memory/destination/conf/extensions.properties"> |
| extensions.properties</a> under the <code>guice.extension.module</code> key.</p> |
| </section> |
| </body> |
| |
| </document> |