You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/10/14 03:29:15 UTC

[james-project] branch master updated (a6ca5cb -> d0f4a63)

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.


    from a6ca5cb  JAMES-2813 deserialize task additional information with the embeded type
     new f165ae2  JAMES-2915 Delete all unecessarry server/app test configuration
     new 2e97883  JAMES-2915 Solve minor issue in server/app configuration
     new d4b5109  JAMES-2915 Remove no longer maintained (and failing!) cassandra backend support for Spring
     new d0f4a63  MAILBOX-380 Bind CassandraEventsDeadLetters inside cassandra-guice

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../mailbox/events/CassandraEventDeadLetters.java  |   4 +-
 .../lucene/search/LuceneMessageSearchIndex.java    |   2 +-
 .../store/event/MailboxAnnotationListener.java     |   2 +-
 pom.xml                                            |   5 +
 server/app/src/main/resources/mailetcontainer.xml  |   2 +-
 server/app/src/main/resources/quota.xml            |   8 -
 .../james/app/spring/JamesSpringContextTest.java   |  14 +-
 server/app/src/test/resources/indexer.xml          |  33 -
 server/app/src/test/resources/log4j.properties     | 138 ----
 server/app/src/test/resources/mailbox.xml          |  32 -
 server/app/src/test/resources/mailetcontainer.xml  | 693 ---------------------
 server/container/guice/cassandra-guice/pom.xml     |   4 +
 .../CassandraDeadLetterModule.java}                |  25 +-
 .../modules/mailbox/CassandraMailboxModule.java    |   1 +
 .../java/org/apache/james/JPAJamesServerMain.java  |   2 +
 .../james/modules/mailbox/DefaultEventModule.java  |   4 -
 .../modules/mailbox/MemoryDeadLetterModule.java}   |  10 +-
 .../james/modules/mailbox/MemoryMailboxModule.java |   1 +
 ...ilboxConfigurationBeanFactoryPostProcessor.java |   9 +-
 .../QuotaBeanFactoryPostProcessor.java             |   7 +-
 src/site/xdoc/server/config-mailbox.xml            |   3 +-
 src/site/xdoc/server/config-quota.xml              |   9 +-
 22 files changed, 46 insertions(+), 962 deletions(-)
 delete mode 100644 server/app/src/test/resources/indexer.xml
 delete mode 100644 server/app/src/test/resources/log4j.properties
 delete mode 100644 server/app/src/test/resources/mailbox.xml
 delete mode 100644 server/app/src/test/resources/mailetcontainer.xml
 copy server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/{eventstore/CassandraEventStoreModule.java => mailbox/CassandraDeadLetterModule.java} (65%)
 copy server/container/guice/{jpa-guice/src/main/java/org/apache/james/modules/mailbox/JPAQuotaSearchModule.java => mailbox/src/main/java/org/apache/james/modules/mailbox/MemoryDeadLetterModule.java} (81%)


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 01/04: JAMES-2915 Delete all unecessarry server/app test configuration

Posted by bt...@apache.org.
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 f165ae222386e17203063d823a18540387fcf6a8
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 9 13:54:16 2019 +0700

    JAMES-2915 Delete all unecessarry server/app test configuration
    
        This enables testing default configuration files.
    
        The overriding of some configuration prevented our test suite to detect
        issues within default server/app configuration (mailetconainer.xml went
        untested).
    
        Note that protocol related configuration is required to bind a random port.
---
 .../james/app/spring/JamesAppSpringMainTest.java   |   2 +
 server/app/src/test/resources/indexer.xml          |  33 -
 server/app/src/test/resources/log4j.properties     | 138 ----
 server/app/src/test/resources/mailbox.xml          |  32 -
 server/app/src/test/resources/mailetcontainer.xml  | 693 ---------------------
 5 files changed, 2 insertions(+), 896 deletions(-)

diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
index 411e66e..5e0e11f 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
@@ -18,10 +18,12 @@
  ****************************************************************/
 package org.apache.james.app.spring;
 
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class JamesAppSpringMainTest {
 
+    @Ignore("JAMES-2915 James default configuration in server/app fails")
     @Test
     public void testServer() throws Exception {
         JamesAppSpringMain.main(null);
diff --git a/server/app/src/test/resources/indexer.xml b/server/app/src/test/resources/indexer.xml
deleted file mode 100644
index 8fd7248..0000000
--- a/server/app/src/test/resources/indexer.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?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.                                           
- -->
- 
-<!--
-   This template file can be used as example for James Server configuration
-   DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
--->
- 
-<!-- See http://james.apache.org/server/3/config.html for usage -->
- 
-<indexer>
-   <!-- supported providers are: -->
-   <!-- lazyIndex, luceneIndex, elasticsearch -->
-   <!--  -->
-  <provider>luceneIndex</provider>
-</indexer>
diff --git a/server/app/src/test/resources/log4j.properties b/server/app/src/test/resources/log4j.properties
deleted file mode 100644
index df90418..0000000
--- a/server/app/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,138 +0,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.
-
-###############################################################################
-# Configuration file used to run a local James server from the IDE.
-# See http://james.apache.org/server/3/config.html for usage.
-###############################################################################
-
-log4j.rootLogger=DEBUG
-
-log4j.appender.CONS=org.apache.log4j.ConsoleAppender
-log4j.appender.CONS.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONS.layout.ConversionPattern=(%C.java:%L):%M - %-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.FILE.File=../log/james-server.log
-log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.FILE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.MAILBOXMANAGER=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.MAILBOXMANAGER.File=../log/mailboxmanager.log
-log4j.appender.MAILBOXMANAGER.DatePattern='.'yyyy-MM-dd
-log4j.appender.MAILBOXMANAGER.layout=org.apache.log4j.PatternLayout
-log4j.appender.MAILBOXMANAGER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.IMAPSERVER=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.IMAPSERVER.File=../log/imapserver.log
-log4j.appender.IMAPSERVER.DatePattern='.'yyyy-MM-dd
-log4j.appender.IMAPSERVER.layout=org.apache.log4j.PatternLayout
-log4j.appender.IMAPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.MAILETCONTAINER=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.MAILETCONTAINER.File=../log/mailetcontainer.log
-log4j.appender.MAILETCONTAINER.DatePattern='.'yyyy-MM-dd
-log4j.appender.MAILETCONTAINER.layout=org.apache.log4j.PatternLayout
-log4j.appender.MAILETCONTAINER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.DNSSERVICE=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.DNSSERVICE.File=../log/dnsservice.log
-log4j.appender.DNSSERVICE.DatePattern='.'yyyy-MM-dd
-log4j.appender.DNSSERVICE.layout=org.apache.log4j.PatternLayout
-log4j.appender.DNSSERVICE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.POP3SERVER=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.POP3SERVER.File=../log/pop3server.log
-log4j.appender.POP3SERVER.DatePattern='.'yyyy-MM-dd
-log4j.appender.POP3SERVER.layout=org.apache.log4j.PatternLayout
-log4j.appender.POP3SERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.SMTPSERVER=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.SMTPSERVER.File=../log/smtpserver.log
-log4j.appender.SMTPSERVER.DatePattern='.'yyyy-MM-dd
-log4j.appender.SMTPSERVER.layout=org.apache.log4j.PatternLayout
-log4j.appender.SMTPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.LMTPSERVER=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.LMTPSERVER.File=../log/lmtpserver.log
-log4j.appender.LMTPSERVER.DatePattern='.'yyyy-MM-dd
-log4j.appender.LMTPSERVER.layout=org.apache.log4j.PatternLayout
-log4j.appender.LMTPSERVER.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.MAILREPOSITORYSTORE=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.MAILREPOSITORYSTORE.File=../log/mailrepositorystore.log
-log4j.appender.MAILREPOSITORYSTORE.DatePattern='.'yyyy-MM-dd
-log4j.appender.MAILREPOSITORYSTORE.layout=org.apache.log4j.PatternLayout
-log4j.appender.MAILREPOSITORYSTORE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.USERSREPOSITORY=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.USERSREPOSITORY.File=../log/usersrepository.log
-log4j.appender.USERSREPOSITORY.DatePattern='.'yyyy-MM-dd
-log4j.appender.USERSREPOSITORY.layout=org.apache.log4j.PatternLayout
-log4j.appender.USERSREPOSITORY.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.FETCHMAIL=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.FETCHMAIL.File=../log/fetchmail.log
-log4j.appender.FETCHMAIL.DatePattern='.'yyyy-MM-dd
-log4j.appender.FETCHMAIL.layout=org.apache.log4j.PatternLayout
-log4j.appender.FETCHMAIL.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.DOMAINLIST=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.DOMAINLIST.File=../log/domainlist.log
-log4j.appender.DOMAINLIST.DatePattern='.'yyyy-MM-dd
-log4j.appender.DOMAINLIST.layout=org.apache.log4j.PatternLayout
-log4j.appender.DOMAINLIST.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.VIRTUALUSERTABLE=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.VIRTUALUSERTABLE.File=../log/virtualusertable.log
-log4j.appender.VIRTUALUSERTABLE.DatePattern='.'yyyy-MM-dd
-log4j.appender.VIRTUALUSERTABLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.VIRTUALUSERTABLE.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.appender.MAILQUEUEFACTORY=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.MAILQUEUEFACTORY.File=../log/mailqueuefactory.log
-log4j.appender.MAILQUEUEFACTORY.DatePattern='.'yyyy-MM-dd
-log4j.appender.MAILQUEUEFACTORY.layout=org.apache.log4j.PatternLayout
-log4j.appender.MAILQUEUEFACTORY.layout.ConversionPattern=%-5p %d{HH:mm:ss,SSS} | %c | %m%n
-
-log4j.logger.org.apache.xbean.spring=WARN, CONS, FILE
-log4j.logger.org.apache.activemq=WARN, CONS, FILE
-
-log4j.logger.org.apache.camel=WARN, CONS, FILE
-log4j.logger.org.springframework=WARN, CONS, FILE
-log4j.logger.org.apache.james=INFO, CONS, FILE
-
-log4j.logger.james=WARN, CONS, FILE
-log4j.logger=DEBUG, CONS, FILE
-
-log4j.logger.james.mailboxmanager=INFO, MAILBOXMANAGER
-log4j.logger.james.imapserver=INFO, IMAPSERVER
-log4j.logger.james.mailetcontainer=INFO, MAILETCONTAINER
-log4j.logger.james.mailetcontext=INFO, MAILETCONTAINER
-log4j.logger.james.mailspooler=INFO, MAILETCONTAINER
-log4j.logger.james.mailprocessor=INFO, MAILETCONTAINER
-log4j.logger.james.dnsservice=INFO, DNSSERVICE
-log4j.logger.james.pop3server=INFO, POP3SERVER
-log4j.logger.james.smtpserver=INFO, SMTPSERVER
-log4j.logger.james.lmtpserver=INFO, LMTPSERVER
-log4j.logger.james.mailrepositorystore=INFO, MAILREPOSITORYSTORE
-log4j.logger.james.usersrepository=INFO, USERSREPOSITORY
-log4j.logger.james.fetchmail=INFO, FETCHMAIL
-log4j.logger.james.domainlist=INFO, DOMAINLIST
-log4j.logger.james.virtualusertable=INFO, VIRTUALUSERTABLE
-log4j.logger.james.mailqueuefactory=INFO, MAILQUEUEFACTORY
-log4j.logger.etm.core.monitor.EtmMonitor= INFO, CONS, FILE
diff --git a/server/app/src/test/resources/mailbox.xml b/server/app/src/test/resources/mailbox.xml
deleted file mode 100644
index 4172558..0000000
--- a/server/app/src/test/resources/mailbox.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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.                                           
- -->
- 
-<!--
-   Configuration file used to run a local James server from the IDE.
-   See http://james.apache.org/server/3/config.html for usage.
--->
-
-<mailbox>
-    <!-- supported providers are: -->
-    <!-- jpa, maildir, memory -->
-    <!--  -->
-    <!-- Be aware that maildir will only work on unix like operation systems! -->
-    <provider>jpa</provider>
-</mailbox>
diff --git a/server/app/src/test/resources/mailetcontainer.xml b/server/app/src/test/resources/mailetcontainer.xml
deleted file mode 100644
index e396b3a..0000000
--- a/server/app/src/test/resources/mailetcontainer.xml
+++ /dev/null
@@ -1,693 +0,0 @@
-<?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.                                           
- -->
-
-<!--
-   Configuration file used to run a local James server from the IDE.
-   See http://james.apache.org/server/3/config.html for usage.
--->
-
-<mailetcontainer enableJmx="true">
- 
-    <!-- MailAddress used for PostMaster -->
-    <context>
-        <postmaster>postmaster@localhost</postmaster>
-    </context>
-
-    <!-- Number of spool threads -->
-    <spooler>
-      <threads>20</threads>
-    </spooler>
-      
-  <processors>
-  
-    <!-- The root processor is a required processor - James routes all mail on the spool -->
-    <!-- through this processor first. -->
-    <!-- -->
-    <!-- This configuration is a sample configuration for the root processor. -->
-    <processor state="root" enableJmx="true">
-
-       <!-- This mailet redirects mail for the user 'postmaster' at any local domain to -->
-       <!-- the postmaster address specified for the server. The postmaster address -->
-       <!-- is required by rfc822. Do not remove this mailet unless you are meeting -->
-       <!-- this requirement through other means (e.g. a XML/JDBCRecipientRewriteTable defined in recipientrewritetable-store.xml) -->
-       <mailet match="All" class="PostmasterAlias"/>
-
-       <!-- Checks that the email Sender is associated with a valid domain. -->
-       <!-- Useful for detecting and eliminating spam. -->
-       <!-- For this block to function, the spam processor must be configured. -->
-       <!--
-       <mailet match="SenderInFakeDomain=64.55.105.9,64.94.110.11,194.205.62.122,194.205.62.62,195.7.77.20,206.253.214.102,212.181.91.6,219.88.106.80,194.205.62.42,216.35.187.246,203.119.4.6" class="ToProcessor">
-          <processor>spam</processor>
-       </mailet>
-         -->
-
-       <!-- Important check to avoid looping -->
-       <mailet match="RelayLimit=30" class="Null"/>
-
-       <!-- Check for viruses -->
-       <!-- -->
-       <!-- Does an antivirus scan check using a ClamAV daemon (CLAMD). -->
-       <!-- -->
-       <!-- Interacts directly with the daemon using the "stream" method, -->
-       <!-- which should have the lowest possible overhead. -->
-       <!-- The CLAMD daemon will typically reside on localhost, but could reside on a -->
-       <!-- different host. -->
-       <!-- It may also consist on a set of multiple daemons, each residing on a different -->
-       <!-- server and on different IP number. -->
-       <!-- In such case a DNS host name with multiple IP addresses (round-robin load sharing) -->
-       <!-- is supported by the mailet (but on the same port number). -->
-       <!-- -->
-       <!-- Handles the following init parameters: -->
-       <!--<debug>-->
-       <!--<host>: the host name of the server where CLAMD runs. It can either be -->
-       <!--     a machine name, such as -->
-       <!--     "java.sun.com", or a textual representation of its -->
-       <!--     IP address. If a literal IP address is supplied, only the -->
-       <!--     validity of the address format is checked. -->
-       <!--     If the machine name resolves to multiple IP addresses, round-robin load sharing will -->
-       <!--     be used. -->
-       <!--     The default is "localhost". -->
-       <!--<port>: the port on which CLAMD listens. The default is "3310". -->
-       <!--<maxPings>: the maximum number of connection retries during startup. -->
-       <!--     If the value is "0" no startup test will be done. -->
-       <!--     The default is "6". -->
-       <!--<pingIntervalMilli>: the interval (in milliseconds) -->
-       <!--     between each connection retry during startup. -->
-       <!--     The default is "30000" (30 seconds). -->
-       <!--<streamBufferSize>: the BufferedOutputStream buffer size to use  -->
-       <!--     writing to the stream connection. The default is "8192". -->
-       <!--
-       <mailet match="All" class="ClamAVScan" onMailetException="ignore">
-          <debug>true</debug>
-       </mailet>
-         -->
-
-       <!-- If infected go to virus processor -->
-       <mailet match="HasMailAttributeWithValue=org.apache.james.infected, true" class="ToProcessor">
-          <processor>virus</processor>
-       </mailet>
-
-       <!-- Check attachment extensions for possible viruses -->
-       <!-- The "-z" option requests the check to be non-recursively applied -->
-       <!-- to the contents of any attached '*.zip' file. -->
-       <!-- 
-       <mailet match="AttachmentFileNameIs=-d -z *.exe *.com *.bat *.cmd *.pif *.scr *.vbs *.avi *.mp3 *.mpeg *.shs" class="Bounce" onMatchException="error">
-          <inline>heads</inline>
-          <attachment>none</attachment>
-          <passThrough>false</passThrough>
-          <prefix>[REJECTED]</prefix>
-          <notice>
-The Security Policy of XXX does not allow to forward messages containing attachments having any of the extensions .exe, .com, .bat, .cmd, .pif, .scr, .vbs, .avi, .mp3, .mpeg, .shs, therefore your message has been rejected.
-
-Please don't reply to this e-mail as it has been automatically sent by the antivirus system.
-
-Regards, Postmaster XXX.YYY
-.....................................
-          </notice>
-       </mailet>
-         -->
-
-       <!-- Whitelist Management -->
-       <!-- Manages for each local user a "white list" of remote addresses whose messages -->
-       <!-- should never be blocked as spam. -->
-       <!-- -->
-       <!-- If<automaticInsert>is true, it will check, for a local sender, if a remote recipient -->
-       <!-- is already in the list: if not, it will be automatically inserted. -->
-       <!-- This is under the interpretation that if a local sender X sends a message to a -->
-       <!-- remote recipient Y, then later on if a message is sent by Y to X it should be -->
-       <!-- considered always valid and never blocked; hence Y should be in the white list -->
-       <!-- of X. -->
-       <!-- -->
-       <!-- Another mode of operations is when a local sender sends a message to<whitelistManagerAddress>-->
-       <!-- with one of three specific values in the subject, to -->
-       <!-- (i) send back a message displaying a list of the addresses in his own list (<displayFlag>); -->
-       <!-- (ii) insert some new addresses in his own list (<insertFlag>); -->
-       <!-- (iii) remove some addresses from his own list (<removeFlag>). -->
-       <!-- In all of the three above cases the message will be ghosted and the postmaster will reply -->
-       <!-- to the sender. -->
-       <!-- -->
-       <!-- The sender name is always converted to its primary name (handling aliases). -->
-       <!--
-       <mailet match="SMTPAuthSuccessful" class="WhiteListManager" onMailetException="ignore">
-          <repositoryPath>db://maildb</repositoryPath>
-          <automaticInsert>true</automaticInsert>
-          <whitelistManagerAddress>whitelist.manager@xxx.yyy</whitelistManagerAddress>
-          <displayFlag>display</displayFlag>
-          <insertFlag>insert</insertFlag>
-          <removeFlag>remove</removeFlag>
-       </mailet>
-         -->
-
-       <!-- "not spam" bayesian analysis feeder. -->
-       <!--
-       <mailet match="RecipientIs=not.spam@xxx.yyy" class="BayesianAnalysisFeeder">
-          <repositoryPath>db://maildb</repositoryPath>
-          <feedType>ham</feedType>
-          <maxSize>200000</maxSize>
-       </mailet>
-         -->
-     
-       <!-- "spam" bayesian analysis feeder. -->
-       <!--
-       <mailet match="RecipientIs=spam@xxx.yyy" class="BayesianAnalysisFeeder">
-          <repositoryPath>db://maildb</repositoryPath>
-          <feedType>spam</feedType>
-          <maxSize>200000</maxSize>
-       </mailet>
-         -->
-
-       <!-- sample SMIME mailets configuration -->
-       <!-- 
-       <mailet match="IsSMIMEEncrypted" class="SMIMEDecrypt">
-          <keyStoreType>pkcs12</keyStoreType>
-          <keyStoreFileName>c:/path.pfx</keyStoreFileName>
-          <keyStorePassword>myKeyStorePass</keyStorePassword>
-          <keyAlias>myKeyAlias</keyAlias>
-          <keyAliasPassword>myKeyPass</keyAliasPassword>
-       </mailet>
-         
-       <mailet match="IsSMIMESigned" class="SMIMECheckSignature">
-          <keyStoreType>pkcs12</keyStoreType>
-          <keyStoreFileName>c:/path.pfx</keyStoreFileName>
-          <keyStorePassword>myKeyStorePass</keyStorePassword>
-          <strip>false</strip>
-          <onlyTrusted>true</onlyTrusted>
-       </mailet>
-         -->
-
-       <!--
-         
-         XMLRecipientRewriteTable is deprecated - Use the definitions in recipientrewritetable-store.xml
-         
-       <mailet match="All" class="XMLRecipientRewriteTable">
-          <!- 1:1 mapping ->
-          <mapping>morgoth@middle-earth=sauron@mordor</mapping>
-          <!- 1:n mapping ->
-          <mapping>istari@middle-earth=saruman@isengard;radigast;gandalf</mapping>
-          <!- DSN mapping ->
-          <mapping>boromir@osgilliath=error:550 Requested action not taken: no such user here</mapping>
-          <!- regex based mapping ->
-          <mapping>*@osgilliath=regex:(.*)@osgilliath:${1}@minas-tirith</mapping>
-          <!- both standard and regex mapping ->
-          <mapping>ring@*=onering@mordor;regex:ring@(.*):ring@${1}</mapping>
-          <!- conditional regex mapping example ->
-          <mapping>*@listserver=regex:(.*)-on@listserver:${1}-subscribe@listserver;
-                                  regex:(.*)-off@listserver:${1}-unsubscribe@listserver
-          </mapping>
-       </mailet>
-         
-         -->
-
-       <!-- Anti-spam processing -->
-       <!-- The following two entries avoid double anti-spam analysis -->
-       <!-- for forwarded messages. -->
-       <!-- Has spam checking already been done? -->
-       <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
-          <processor>transport</processor>
-       </mailet>
-       <!-- Spam checking will not be done twice -->
-       <mailet match="All" class="SetMailAttribute">
-          <spamChecked>true</spamChecked>
-       </mailet>
-
-       <!-- White List:
-              If you use block lists, you will probably want to check
-              for known permitted senders.  This is particularly true
-              if you use more aggressive block lists, such as SPEWS,
-              that are prone to block entire subnets without regard
-              for non-spamming senders.
-         -->
-
-       <!-- Messages from authenticated senders never are spam -->
-       <mailet match="SMTPAuthSuccessful" class="ToProcessor">
-          <processor>transport</processor>
-       </mailet>
-
-       <!-- Messages signed by trusted users never are spam -->
-       <!-- Uncommenting the following entry, messages with valid signatures will never be considered spam. -->
-       <!-- This can be a valid policy *if* SMIMECheckSignature was invoked -->
-       <!-- with<onlyTrusted>true</onlyTrusted>set -->
-       <!--
-       <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="ToProcessor">
-          <processor>transport</processor>
-       </mailet>
-         -->
-
-       <!-- specific known senders -->
-       <!--
-       <mailet match="SenderIs=goodboy@goodhost"
-                 class="ToProcessor">
-          <processor>transport</processor>
-       </mailet>
-         -->
-
-       <!-- People on this list agree to pay a penalty if they send spam -->
-       <mailet match="InSpammerBlacklist=query.bondedsender.org."
-                 class="ToProcessor">
-         <processor>transport</processor>
-       </mailet>
-
-       <!-- E-mail legally required not to be spam (see: http://www.habeas.com) -->
-       <!--
-       <mailet match="HasHabeasWarrantMark" class="ToProcessor">
-          <processor>transport</processor>
-       </mailet>
-         -->
-
-       <!-- If the sender is in a recipient's whitelist, it is a valid sender, -->
-       <!-- and as such the message should not be considered spam for such recipient. -->
-       <!--
-       <mailet match="IsInWhiteList=db://maildb" class="ToProcessor" onMatchException="noMatch">
-          <processor>transport</processor>
-       </mailet>
-         -->
-
-       <!-- End of White List -->
-
-       <!-- Check for delivery from a known spam server -->
-       <!-- This set of matchers/mailets redirect all emails from known -->
-       <!-- black holes, open relays, and spam servers to the spam processor -->
-       <!-- For this set to function properly, the spam processor must be configured. -->
-       <mailet match="InSpammerBlacklist=dnsbl.njabl.org."
-                 class="ToProcessor">
-         <processor>spam</processor>
-         <notice>550 Requested action not taken: rejected - see http://njabl.org/</notice>
-       </mailet>
-         
-       <!-- Sample matching to kill a message (send to Null) -->
-       <!--
-       <mailet match="RecipientIs=badboy@badhost" class="Null"/>
-         -->
-
-       <!-- Anti spam bayesian analysis -->
-       <!--
-       <mailet match="All" class="BayesianAnalysis" onMailetException="ignore">
-          <repositoryPath>db://maildb</repositoryPath>
-          <maxSize>200000</maxSize>
-          <headerName>X-MessageIsSpamProbability</headerName>
-          <ignoreLocalSender>true</ignoreLocalSender>
-       </mailet>
-
-       <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability >0.90" class="SetMailAttribute" onMatchException="noMatch">
-          <isSpam>true</isSpam>
-       </mailet>
-
-       <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability >0.90" class="SetMimeHeader" onMatchException="noMatch">
-          <name>X-MessageIsSpam</name>
-          <value>true</value>
-       </mailet>
-
-       <mailet match="CompareNumericHeaderValue=X-MessageIsSpamProbability >0.99" class="ToProcessor" onMatchException="noMatch">
-          <processor>spam</processor>
-          <notice>Spam not accepted</notice>
-       </mailet>
-         -->
-         
-       <mailet notmatch="SenderHostIsLocal" class="SpamAssassin">
-          <spamdHost>localhost</spamdHost>
-          <spamdPort>783</spamdPort>
-       </mailet>
-
-       <!-- Send remaining mails to the transport processor for either local or remote delivery -->
-       <mailet match="All" class="ToProcessor">
-          <processor>transport</processor>
-       </mailet>
-
-    </processor>
-
-    <!-- The error processor is required.  James may internally set emails to the -->
-    <!-- error state.  The error processor is generally invoked when there is an -->
-    <!-- unexpected error either in the mailet chain or internal to James. -->
-    <!-- -->
-    <!-- By default configuration all email that generates an error in placed in -->
-    <!-- an error repository. -->
-    <processor state="error" enableJmx="true">
-       <!-- If you want to notify the sender their message generated an error, uncomment this       -->
-       <!--
-       <mailet match="All" class="Bounce"/>
-         -->
-       <!-- If you want to notify the postmaster that a message generated an error, uncomment this  -->
-       <!--
-       <mailet match="All" class="NotifyPostmaster"/>
-         -->
-
-       <!-- Logs any messages to the repository specified -->
-       <mailet match="All" class="ToRepository">
-          <repositoryPath>file://var/mail/error/</repositoryPath>
-          <!-- An alternative database repository example follows. -->
-          <!--
-          <repositoryPath>db://maildb/deadletter/error</repositoryPath>
-            -->
-       </mailet>
-    </processor>
-
-    <!-- Processor CONFIGURATION SAMPLE: transport is a sample custom processor for local or -->
-    <!-- remote delivery -->
-    <processor state="transport" enableJmx="true">
-
-      <!-- This is an example configuration including configuration for a list server. -->
-      <!-- CHECKME: before uncommenting this, edit the configuration file's contents   -->
-      <!--
-          &listserverConfig;
-        -->
-
-       <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
-          <name>X-UserIsAuth</name>
-          <value>true</value>
-       </mailet>
-    
-       <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
-          <name>X-WasSigned</name>
-          <value>true</value>
-       </mailet>
-
-       <!-- Add a server-side signature -->
-       <!--
-       <mailet match="All" class="SMIMESign" onMailetException="ignore">
-          <keyStoreType>jks</keyStoreType>
-          <keyStoreFileName>path.keystore</keyStoreFileName>
-          <keyStorePassword>myKeyStorePass</keyStorePassword>
-          <keyAlias>myKeyAlias</keyAlias>
-          <keyAliasPassword>myKeyPass</keyAliasPassword>
-          <signerName>XXX Trusted Server</signerName>
-          <rebuildFrom>true</rebuildFrom>
-          <postmasterSigns>true</postmasterSigns>
-          <debug>true</debug>
-       </mailet>
-         -->
-
-       <!-- Experimental quota Matcher -->
-       <!-- This matcher need to calculate the mailbox size everytime it is called. This can slow down things if there are many mails in -->
-       <!-- the mailbox. Some users also report big problems with the matcher if a JDBC based mailrepository is used. -->
-       <!-- Check if over quota -->
-       <!-- 
-       <mailet match="RecipientIsOverFixedQuota=20M" class="Resend">
-          <sender>postmaster</sender>
-          <replyTo>postmaster</replyTo>
-          <reversePath>null</reversePath>
-          <inline>none</inline>
-          <attachment>message</attachment>
-          <prefix>[OVER QUOTA WARNING]</prefix>
-          <message>
-When receiving the attached message, your mailbox is larger than 20 MB, which is the maximum allowed quota. The mailbox will not be blocked, but we ask you to empty it ASAP.
-
-It is likely that you have set, in your mail client account, the option "leave a copy of messages on server". For any help ask your administrators.
-
-Regards, Postmaster XXX.YYY
-.....................................
-          </message>
-       </mailet>
-         -->
-
-       <!--  The RecipientRewriteTable will use the definitions found in recipientrewritetablexml -->
-        <mailet match="All" class="RecipientRewriteTable">
-            <errorProcessor>rrt-error</errorProcessor>
-        </mailet>
-        
-         <!-- Place a copy in the user Sent folder -->
-         <mailet match="SenderIsLocal" class="ToSenderFolder">
-           <folder>Sent</folder>
-           <consume>false</consume>
-         </mailet>
-    
-       <!-- Is the recipient is for a local account, deliver it locally -->
-       <mailet match="RecipientIsLocal" class="LocalDelivery"/>
-
-       <!-- If the host is handled by this server and it did not get -->
-       <!-- locally delivered, this is an invalid recipient -->
-       <mailet match="HostIsLocal" class="ToProcessor">
-          <processor>local-address-error</processor>
-          <notice>550 - Requested action not taken: no such user here</notice>
-       </mailet>
-
-<!-- CHECKME! -->
-       <!-- This is an anti-relay matcher/mailet combination -->
-       <!-- -->
-       <!-- Emails sent from servers not in the network list are  -->
-       <!-- rejected as spam.  This is one method of preventing your -->
-       <!-- server from being used as an open relay.  Make sure you understand -->
-       <!-- how to prevent your server from becoming an open relay before -->
-       <!-- changing this configuration. See also<authorizedAddresses>in SMTP Server -->
-       <!-- -->
-       <!-- This matcher/mailet combination must come after local delivery has -->
-       <!-- been performed.  Otherwise local users will not be able to receive -->
-       <!-- email from senders not in this remote address list. -->
-       <!-- -->
-       <!-- If you are using this matcher/mailet you will probably want to -->
-       <!-- update the configuration to include your own network/addresses.  The -->
-       <!-- matcher can be configured with a comma separated list of IP addresses  -->
-       <!-- wildcarded IP subnets, and wildcarded hostname subnets. -->
-       <!-- e.g. "RemoteAddrNotInNetwork=127.0.0.1, abc.de.*, 192.168.0.*" -->
-       <!-- -->
-       <!-- If you are using SMTP authentication then you can (and generally -->
-       <!-- should) disable this matcher/mailet pair. -->
-       <mailet match="RemoteAddrNotInNetwork=127.0.0.1" class="ToProcessor">
-          <processor>relay-denied</processor>
-          <notice>550 - Requested action not taken: relaying denied</notice>
-       </mailet>
-
-       <!-- Attempt remote delivery using the specified repository for the spool, -->
-       <!-- using delay time to retry delivery and the maximum number of retries -->
-       <mailet match="All" class="RemoteDelivery">
-          <outgoingQueue>outgoing</outgoingQueue>
-
-          <!-- Delivery Schedule based upon RFC 2821, 4.5.4.1 -->
-          <!-- 5 day retry period, with 4 attempts in the first
-                 hour, two more within the first 6 hours, and then
-                 every 6 hours for the rest of the period.
-                 This format is not yet supported, instead, use a unique
-                 tag with the list of delays in milliseconds separated by commas.
-          <delayTime>5 minutes</delayTime>
-          <delayTime>10 minutes</delayTime>
-          <delayTime>45 minutes</delayTime>
-          <delayTime>2 hours</delayTime>
-          <delayTime>3 hours</delayTime>
-          <delayTime>6 hours</delayTime>
-          -->
-          <delayTime>5000, 100000, 500000</delayTime>
-          <maxRetries>1</maxRetries>
-            
-          <!-- The max reties which will used if no A or MX record for the domain was found. -->
-          <!-- If 0 it will fail on first time -->
-          <maxDnsProblemRetries>0</maxDnsProblemRetries>
-
-          <!-- The number of threads that should be trying to deliver outgoing messages -->
-          <deliveryThreads>10</deliveryThreads>
-
-          <!-- If false the message will not be sent to given server if any recipients fail -->
-          <sendpartial>true</sendpartial>
-            
-          <!-- By default we send bounces to the "bounce" processor -->
-          <!-- By removing this configuration James will fallback to hardcoded bounce -->
-          <!-- notifications -->
-          <bounceProcessor>bounces</bounceProcessor>
-
-          <!-- A single mail server to deliver all outgoing messages. -->
-          <!-- This is useful if this server is a backup or failover machine, -->
-          <!-- or if you want all messages to be routed through a particular mail server, -->
-          <!-- regardless of the email addresses specified in the message -->
-          <!-- -->
-          <!-- The gateway element specifies the gateway SMTP server name. -->
-          <!-- If your gateway mail server is listening on a port other than 25, -->
-          <!-- you can set James to connect to it on that port using the gatewayPort -->
-          <!-- element. -->
-          <!-- Although normally multiple addresses are implemented through proper -->
-          <!-- DNS configuration, the RemoteDelivery mail does allow specifying -->
-          <!-- multiple gateway elements, each of which may also have a port -->
-          <!-- e.g., mygateway:2525 -->
-          <!-- the gatewayPort element is used as a default -->
-          <!--
-          <gateway>otherserver.mydomain.com</gateway>
-          <gatewayPort>25</gatewayPort>
-            -->
-          <!-- If the gateway requires smtp authentication the following directives -->
-          <!-- (gatewayUsername/gatewayPassword) can be used. -->
-          <!--
-          <gatewayUsername>login</gatewayUsername>
-          <gatewayPassword>pass</gatewayPassword>
-            -->
-            
-          <!-- Set the HELO/EHLO name to use when connectiong to remote SMTP-Server -->
-          <!--
-          <mail.smtp.localhost>myMailServer</mail.smtp.localhost>
-            -->
-       </mailet>
-
-    </processor>
-
-    <!-- Processor CONFIGURATION SAMPLE: spam is a sample custom processor for handling -->
-    <!-- spam. -->
-    <!-- You can either log these, bounce these, or just ignore them. -->
-    <processor state="spam" enableJmx="true">
-     
-       <!-- To place the spam messages in the user junk folder, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="RecipientIsLocal" class="ToRecipientFolder">
-           <folder>Junk</folder>
-           <consume>false</consume>
-       </mailet>
-        -->
-
-       <!-- To destroy all messages, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="All" class="Null"/>
-         -->
-
-       <!-- To notify the sender their message was marked as spam, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="All" class="Bounce"/>
-         -->
-
-       <!-- To notify the postmaster that a message was marked as spam, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="All" class="NotifyPostmaster"/>
-         -->
-
-       <!-- To log the message to a repository, this matcher/mailet configuration should be uncommented. -->
-       <!-- This is the default configuration. -->
-       <mailet match="All" class="ToRepository">
-          <repositoryPath>file://var/mail/spam/</repositoryPath>
-
-          <!-- Changing the repositoryPath, as in this commented out example, will -->
-          <!-- cause the mails to be stored in a database repository.  -->
-          <!-- Please note that only one repositoryPath element can be present for the mailet -->
-          <!-- configuration. -->
-          <!--
-          <repositoryPath>db://maildb/deadletter/spam</repositoryPath>
-            -->
-       </mailet>
-    </processor>
-
-    <!-- messages containing viruses. -->
-    <processor state="virus" enableJmx="true">
-      
-       <!-- To avoid a loop while bouncing -->
-       <mailet match="All" class="SetMailAttribute">
-          <org.apache.james.infected>true, bouncing</org.apache.james.infected>
-       </mailet>
-
-       <!-- If the sender is authenticated, notify the infection -->
-       <mailet match="SMTPAuthSuccessful" class="Bounce">
-          <inline>heads</inline>
-          <attachment>none</attachment>
-          <notice>Warning: We were unable to deliver the message below because it was found infected by virus(es).</notice>
-       </mailet>
-
-       <!-- In any other situation ghost it, -->
-       <!-- as viruses almost always spoof the sender's address -->
-       <mailet match="All" class="Null" />
-    </processor>
-
-    <!-- This processor handles messages that are for local domains, where the user is unknown -->
-    <processor state="local-address-error" enableJmx="true">
-       <!-- To avoid bouncing/archiving spam, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="HasMailAttribute=isSpam" class="Null" onMatchException="noMatch"/>
-         -->
-
-       <!-- To notify the sender the address was invalid, uncomment this matcher/mailet configuration -->
-       <!-- The original message is not attached to keep the bounce processor from deliverying spam -->
-       <!--
-       <mailet match="All" class="Bounce">
-          <attachment>none</attachment>
-       </mailet>
-         -->
-
-       <!-- To notify the postmaster that a message had an invalid address, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="All" class="NotifyPostmaster"/>
-         -->
-
-       <mailet match="All" class="ToRepository">
-          <repositoryPath>file://var/mail/address-error/</repositoryPath>
-          <!-- An alternative database repository example follows. -->
-          <!--
-          <repositoryPath>db://maildb/deadletter/address-error</repositoryPath>
-            -->
-       </mailet>
-    </processor>
-
-    <!-- This processor handles messages that are for foreign domains, where relaying is denied -->
-    <!-- As of James v2.2, this processor can be deprecated by using the<authorizedAddresses>tag
-           in the SMTP Server, and rejecting the message in the protocol transaction.  -->
-    <processor state="relay-denied" enableJmx="true">
-       <!-- To notify the sender the address was invalid, uncomment this matcher/mailet configuration -->
-       <!-- The original message is not attached to keep the bounce processor from deliverying spam -->
-       <!--
-       <mailet match="All" class="Bounce">
-          <attachment>none</attachment>
-       </mailet>
-         -->
-
-       <!-- To notify the postmaster that a relay request was denied, uncomment this matcher/mailet configuration -->
-       <!--
-       <mailet match="All" class="NotifyPostmaster"/>
-         -->
-
-       <mailet match="All" class="ToRepository">
-          <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
-          <!-- An alternative database repository example follows. -->
-          <!--
-          <repositoryPath>db://maildb/deadletter/relay-denied</repositoryPath>
-            -->
-       </mailet>
-    </processor>
-
-    <!-- This processor handle the bounces from RemoteDelivery: As of James v2.3, this is the new -->
-    <!-- Default. -->
-    <!-- -->
-    <!-- DSNBounce properly create a DSN compliant bounce -->
-    <processor state="bounces" enableJmx="true">
-       <mailet match="All" class="DSNBounce">
-          <passThrough>false</passThrough>
-
-          <!-- optional subject prefix prepended to the original message -->
-          <!--
-          <prefix>[bounce]</prefix>
-            -->
-            
-          <!-- message, heads or none, default=message -->
-          <!--
-          <attachment>heads</attachment>
-            -->
-            
-          <!-- the message sent in the bounce, the first occurrence of the pattern [machine] is -->
-          <!-- replaced with the name of the executing machine -->
-          <!-- Default: Hi. This is the James mail server at [machine] ... -->
-          <!--
-          <messageString>Here is [machine]. I'm not able to deliver this message.</messageString>
-            -->
-        </mailet>
-    </processor>
-
-      <processor state="rrt-error" enableJmx="false">
-          <mailet match="All" class="ToRepository">
-              <repositoryPath>file://var/mail/rrt-error/</repositoryPath>
-              <passThrough>true</passThrough>
-          </mailet>
-          <mailet match="IsSenderInRRTLoop" class="Null"/>
-          <mailet match="All" class="Bounce">
-              <notice>We were unable to deliver the attached message to the following recipients due to an address rewriting issue.</notice>
-          </mailet>
-      </processor>
-
-  </processors>
-
-</mailetcontainer>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 02/04: JAMES-2915 Solve minor issue in server/app configuration

Posted by bt...@apache.org.
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 2e97883007a8236e2a11d9aa5633648df1e7e872
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Oct 8 16:58:49 2019 +0700

    JAMES-2915 Solve minor issue in server/app configuration
    
    A miss configuration prevented James to start by default
---
 .../mailbox/lucene/search/LuceneMessageSearchIndex.java     |  2 +-
 server/app/src/main/resources/mailetcontainer.xml           |  2 +-
 .../org/apache/james/app/spring/JamesAppSpringMainTest.java |  2 --
 .../org/apache/james/app/spring/JamesSpringContextTest.java | 13 ++-----------
 4 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
index 87dcdd3..5f76b0c 100644
--- a/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
+++ b/mailbox/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java
@@ -138,7 +138,7 @@ public class LuceneMessageSearchIndex extends ListeningMessageSearchIndex {
     private static final Logger LOGGER = LoggerFactory.getLogger(LuceneMessageSearchIndex.class);
     private static final Date MAX_DATE;
     private static final Date MIN_DATE;
-    private static final org.apache.james.mailbox.events.Group GROUP = new LuceneMessageSearchIndexGroup();
+    public static final org.apache.james.mailbox.events.Group GROUP = new LuceneMessageSearchIndexGroup();
     
     static {
         Calendar cal = Calendar.getInstance();
diff --git a/server/app/src/main/resources/mailetcontainer.xml b/server/app/src/main/resources/mailetcontainer.xml
index 5f08bab..bb98c7c 100644
--- a/server/app/src/main/resources/mailetcontainer.xml
+++ b/server/app/src/main/resources/mailetcontainer.xml
@@ -57,7 +57,7 @@
        <mailet match="RelayLimit=30" class="Null"/>
 
         <mailet matcher="All" class="WithPriority">
-            <value>8</value>
+            <priority>8</priority>
         </mailet>
 
         <mailet matcher="HasPriority=8" class="Null"/>
diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
index 5e0e11f..411e66e 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesAppSpringMainTest.java
@@ -18,12 +18,10 @@
  ****************************************************************/
 package org.apache.james.app.spring;
 
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JamesAppSpringMainTest {
 
-    @Ignore("JAMES-2915 James default configuration in server/app fails")
     @Test
     public void testServer() throws Exception {
         JamesAppSpringMain.main(null);
diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index 9480061..b5ab749 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
@@ -22,22 +22,14 @@ package org.apache.james.app.spring;
 import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.james.container.spring.context.JamesServerApplicationContext;
-import org.apache.james.mailbox.events.Group;
 import org.apache.james.mailbox.events.InVMEventBus;
+import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
-import org.assertj.core.api.Condition;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
 public class JamesSpringContextTest {
-    private static final Condition<Group> QUOTA_UPDATER_LISTENER = new Condition<Group>() {
-        @Override
-        public boolean matches(Group group) {
-            return ListeningCurrentQuotaUpdater.GROUP.equals(group);
-        }
-    };
-    private static final int ONCE = 1;
     private JamesServerApplicationContext context;
 
     @Before
@@ -58,7 +50,6 @@ public class JamesSpringContextTest {
         InVMEventBus eventBus = context.getBean(InVMEventBus.class);
 
         assertThat(eventBus.registeredGroups())
-            .areExactly(ONCE, QUOTA_UPDATER_LISTENER);
+            .containsExactlyInAnyOrder(ListeningCurrentQuotaUpdater.GROUP, LuceneMessageSearchIndex.GROUP);
     }
-
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 03/04: JAMES-2915 Remove no longer maintained (and failing!) cassandra backend support for Spring

Posted by bt...@apache.org.
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 d4b5109a6dae0131a0e05bd70a2670c04ef7bb65
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 9 13:57:42 2019 +0700

    JAMES-2915 Remove no longer maintained (and failing!) cassandra backend support for Spring
---
 .../james/mailbox/store/event/MailboxAnnotationListener.java     | 2 +-
 server/app/src/main/resources/quota.xml                          | 8 --------
 .../java/org/apache/james/app/spring/JamesSpringContextTest.java | 3 ++-
 .../MailboxConfigurationBeanFactoryPostProcessor.java            | 9 +--------
 .../bean/factorypostprocessor/QuotaBeanFactoryPostProcessor.java | 7 +------
 src/site/xdoc/server/config-mailbox.xml                          | 3 +--
 src/site/xdoc/server/config-quota.xml                            | 9 ++++-----
 7 files changed, 10 insertions(+), 31 deletions(-)

diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxAnnotationListener.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxAnnotationListener.java
index e469601..bbc5302 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxAnnotationListener.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/event/MailboxAnnotationListener.java
@@ -38,7 +38,7 @@ public class MailboxAnnotationListener implements MailboxListener.GroupMailboxLi
 
     }
 
-    private static final Group GROUP = new MailboxAnnotationListenerGroup();
+    public static final Group GROUP = new MailboxAnnotationListenerGroup();
 
     private final MailboxSessionMapperFactory mailboxSessionMapperFactory;
     private final SessionProvider sessionProvider;
diff --git a/server/app/src/main/resources/quota.xml b/server/app/src/main/resources/quota.xml
index 9c8c63e..1d7a90d 100644
--- a/server/app/src/main/resources/quota.xml
+++ b/server/app/src/main/resources/quota.xml
@@ -59,16 +59,11 @@
         Possible value for provider:
          - none: when you use fake as a value for quotaManager's provider
          - inmemory
-         - cassandra
          - jpa
 
         The inmemory implementation:
          - Does not work in a distributed context
         Note that quota need to be (lazy) re-calculated after each starts
-
-        Cassandra implementation.
-        Non existing quota are considered as null. No cache. It needs to be always enabled, or you might get some
-        quota synchronisation issues.
          -->
         <provider>none</provider>
     </currentQuotaManager>
@@ -81,9 +76,6 @@
          - fixed: all QUOTA ROOT get the same upper bound for their quotas.
          - inmemory: allows you to define QUOTA ROOT specific limits, backed with a fixed policy. It does not
          work in a distributed context.
-         - cassandra: Same thing than inmemory but backed on cassandra. Works on a distributed context. Note that using
-         the default* configuration options and the CLI to set default options is dangerous as server startup might override
-         CLI values.
          - jpa: Same thing than inmemory but backed on jpa. Works on a distributed context. Note that using
          the default* configuration options and the CLI to set default options is dangerous as server startup might override
          CLI values.
diff --git a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
index b5ab749..72bd11e 100644
--- a/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
+++ b/server/app/src/test/java/org/apache/james/app/spring/JamesSpringContextTest.java
@@ -24,6 +24,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 import org.apache.james.container.spring.context.JamesServerApplicationContext;
 import org.apache.james.mailbox.events.InVMEventBus;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
+import org.apache.james.mailbox.store.event.MailboxAnnotationListener;
 import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater;
 import org.junit.After;
 import org.junit.Before;
@@ -50,6 +51,6 @@ public class JamesSpringContextTest {
         InVMEventBus eventBus = context.getBean(InVMEventBus.class);
 
         assertThat(eventBus.registeredGroups())
-            .containsExactlyInAnyOrder(ListeningCurrentQuotaUpdater.GROUP, LuceneMessageSearchIndex.GROUP);
+            .containsExactlyInAnyOrder(MailboxAnnotationListener.GROUP, LuceneMessageSearchIndex.GROUP, ListeningCurrentQuotaUpdater.GROUP);
     }
 }
diff --git a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java b/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java
index 9e814d5..b3b2e89 100644
--- a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java
+++ b/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java
@@ -43,9 +43,8 @@ public class MailboxConfigurationBeanFactoryPostProcessor implements BeanFactory
     private static final String JPA_MAILBOXMANAGER = "jpa-mailboxmanager";
     private static final String MEMORY_MAILBOX_MANAGER = "memory-mailboxManager";
     private static final String MAILDIR_MAILBOXMANAGER = "maildir-mailboxmanager";
-    private static final String CASSANDRA_MAILBOXMANAGER = "cassandra-mailboxmanager";
     private static final ImmutableSet<String> MAILBOX_MANAGER_IDS = ImmutableSet.of(JPA_MAILBOXMANAGER, MEMORY_MAILBOX_MANAGER,
-            MAILDIR_MAILBOXMANAGER, CASSANDRA_MAILBOXMANAGER);
+            MAILDIR_MAILBOXMANAGER);
 
     @Override
     public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
@@ -78,12 +77,6 @@ public class MailboxConfigurationBeanFactoryPostProcessor implements BeanFactory
                 messageMapperFactory = "maildir-sessionMapperFactory";
                 mailboxIdDeserializer = "maildir-mailbox-id-deserializer";
                 mailboxIdFactory = "maildir-mailboxIdFactory";
-            } else if (provider.equalsIgnoreCase("cassandra")) {
-                mailbox = CASSANDRA_MAILBOXMANAGER;
-                subscription = "cassandra-subscriptionManager";
-                messageMapperFactory = "cassandra-sessionMapperFactory";
-                mailboxIdDeserializer = "cassandra-mailbox-id-deserializer";
-                mailboxIdFactory = "cassandra-mailboxIdFactory";
             }
 
             if (mailbox == null) {
diff --git a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/QuotaBeanFactoryPostProcessor.java b/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/QuotaBeanFactoryPostProcessor.java
index 833c119..ea805ca 100644
--- a/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/QuotaBeanFactoryPostProcessor.java
+++ b/server/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/QuotaBeanFactoryPostProcessor.java
@@ -32,7 +32,6 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
 public class QuotaBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
 
     private static final String IN_MEMORY_IMPLEMENTATION = "inmemory";
-    private static final String CASSANDRA_IMPLEMENTATION = "cassandra";
     private static final String FAKE_IMPLEMENTATION = "fake";
     private static final String MAX_QUOTA_MANAGER = "maxQuotaManager";
     private static final String JPA_IMPLEMENTATION = "jpa";
@@ -96,8 +95,6 @@ public class QuotaBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
             registry.registerAlias("noMaxQuotaManager", MAX_QUOTA_MANAGER);
         } else if (maxQuotaManager.equalsIgnoreCase(IN_MEMORY_IMPLEMENTATION)) {
             registry.registerAlias("inMemoryMaxQuotaManager", MAX_QUOTA_MANAGER);
-        } else if (maxQuotaManager.equalsIgnoreCase(CASSANDRA_IMPLEMENTATION)) {
-            registry.registerAlias("cassandraMaxQuotaManager", MAX_QUOTA_MANAGER);
         } else if (maxQuotaManager.equalsIgnoreCase(JPA_IMPLEMENTATION)) {
             registry.registerAlias("jpaMaxQuotaManager", MAX_QUOTA_MANAGER);
         } else {
@@ -108,9 +105,7 @@ public class QuotaBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
     private void registerAliasForCurrentQuotaManager(String currentQuotaManager, BeanDefinitionRegistry registry) {
         if (currentQuotaManager.equalsIgnoreCase(IN_MEMORY_IMPLEMENTATION)) {
             registry.registerAlias("inMemoryCurrentQuotaManager", CURRENT_QUOTA_MANAGER_BEAN);
-        } else if (currentQuotaManager.equalsIgnoreCase(CASSANDRA_IMPLEMENTATION)) {
-            registry.registerAlias("cassandraCurrentQuotaManager", CURRENT_QUOTA_MANAGER_BEAN);
-        }  else if (currentQuotaManager.equalsIgnoreCase(JPA_IMPLEMENTATION)) {
+        } else if (currentQuotaManager.equalsIgnoreCase(JPA_IMPLEMENTATION)) {
             registry.registerAlias("jpaCurrentQuotaManager", CURRENT_QUOTA_MANAGER_BEAN);
         } else if (! currentQuotaManager.equalsIgnoreCase("none")) {
             throw new FatalBeanException("Unreadable value for Current Quota Manager : " + currentQuotaManager);
diff --git a/src/site/xdoc/server/config-mailbox.xml b/src/site/xdoc/server/config-mailbox.xml
index 9109a2a..9c68bea 100644
--- a/src/site/xdoc/server/config-mailbox.xml
+++ b/src/site/xdoc/server/config-mailbox.xml
@@ -37,8 +37,7 @@
 
       <dl>
         <dt><strong>provider</strong></dt>
-        <dd>Supported providers are: jpa (default), maildir, memory. Be aware that maildir will only work on unix like operation systems!
-        Cassandra mailbox need to be compiled and run using java 8.</dd>
+        <dd>Supported providers are: jpa (default), maildir, memory. Be aware that maildir will only work on unix like operation systems!</dd>
       </dl>
 
       <p>See <a href="http://james.apache.org/mailbox/index.html">documentation page</a> to learn more about the different back-ends and their capabilities.</p>
diff --git a/src/site/xdoc/server/config-quota.xml b/src/site/xdoc/server/config-quota.xml
index 1198eb0..f13d3a2 100644
--- a/src/site/xdoc/server/config-quota.xml
+++ b/src/site/xdoc/server/config-quota.xml
@@ -56,11 +56,10 @@
         (depending on the implementation) update these per QUOTA ROOT maximum values. Four implementations are available for now. A NoQuotaManager implementation
         is read only and returns UNLIMITED maximum values. FixedMaxQuotaManager returns one and only one value for all user. You can configure these maximum values
           threw the configuration files. A InMemoryPerUserMaxQuotaManager allows you to configure quota for each QUOTA ROOT. Note that it needs to be done threw
-          configuration to be persistent. We provide some other implementation: A Cassandra implementation allows to store maximum quota values in Cassandra,
-          and a JPA implementation.</li>
+          configuration to be persistent. We provide some other implementation: A JPA implementation allows to store maximum quota values in a SQL database.</li>
         <li>Current Quota Manager: This component can be omitted if you are running a fake QUOTA manager. inmemory implementation is an event updated cache on
-        top of a Quota calculator (that fetches every e-mail metadata of every mailboxes belonging to the QUOTA ROOT: it is expensive). Cassandra and Jpa implementations
-        are also available.</li>
+        top of a Quota calculator (that fetches every e-mail metadata of every mailboxes belonging to the QUOTA ROOT: it is expensive). Jpa implementation
+        is also available.</li>
         <li>Quota Updater: This components allows to update current quota values. A fake implementation is available. A real, event base solution also exists.</li>
       </ul>
     </p>
@@ -87,7 +86,7 @@
       <ul>
         <li>Threw configuration file. Note that this is required to persist a change made to the inmemory or fixed Max Quota
           Manager. It needs a James reboot to take effect. Finally, using configuration file for setting maximum quota values
-          will override CLI set values. Avoid this option this persistent Max Quota Manager (for instance Cassandra)</li>
+          will override CLI set values. Avoid this option this persistent Max Quota Manager (for instance JPA)</li>
         <li>Threw the CLI: offers immediate configuration changes on quota maximum values. Note that if you are using either a
         fixed or inmemory Max QUota Manager, your changes need to be done to the XML configuration to be persisted.</li>
       </ul>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[james-project] 04/04: MAILBOX-380 Bind CassandraEventsDeadLetters inside cassandra-guice

Posted by bt...@apache.org.
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 d0f4a63922711fd6dcb083e5202a098ce841af14
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Oct 9 16:11:48 2019 +0700

    MAILBOX-380 Bind CassandraEventsDeadLetters inside cassandra-guice
    
    This requires dead letter default memory binding to not be included in
    default event module.
    
    Also, the event bus does not require to be part of TLD mailbox implementation
    bindings.
---
 .../mailbox/events/CassandraEventDeadLetters.java  |  4 +-
 pom.xml                                            |  5 +++
 server/container/guice/cassandra-guice/pom.xml     |  4 ++
 .../modules/mailbox/CassandraDeadLetterModule.java | 46 ++++++++++++++++++++++
 .../modules/mailbox/CassandraMailboxModule.java    |  1 +
 .../java/org/apache/james/JPAJamesServerMain.java  |  2 +
 .../james/modules/mailbox/DefaultEventModule.java  |  4 --
 .../modules/mailbox/MemoryDeadLetterModule.java    | 34 ++++++++++++++++
 .../james/modules/mailbox/MemoryMailboxModule.java |  1 +
 9 files changed, 95 insertions(+), 6 deletions(-)

diff --git a/mailbox/event/event-cassandra/src/main/java/org/apache/james/mailbox/events/CassandraEventDeadLetters.java b/mailbox/event/event-cassandra/src/main/java/org/apache/james/mailbox/events/CassandraEventDeadLetters.java
index 39eae1e..7bafea5 100644
--- a/mailbox/event/event-cassandra/src/main/java/org/apache/james/mailbox/events/CassandraEventDeadLetters.java
+++ b/mailbox/event/event-cassandra/src/main/java/org/apache/james/mailbox/events/CassandraEventDeadLetters.java
@@ -32,8 +32,8 @@ public class CassandraEventDeadLetters implements EventDeadLetters {
     private final CassandraEventDeadLettersGroupDAO cassandraEventDeadLettersGroupDAO;
 
     @Inject
-    public CassandraEventDeadLetters(CassandraEventDeadLettersDAO cassandraEventDeadLettersDAO,
-                                     CassandraEventDeadLettersGroupDAO cassandraEventDeadLettersGroupDAO) {
+    CassandraEventDeadLetters(CassandraEventDeadLettersDAO cassandraEventDeadLettersDAO,
+                              CassandraEventDeadLettersGroupDAO cassandraEventDeadLettersGroupDAO) {
         this.cassandraEventDeadLettersDAO = cassandraEventDeadLettersDAO;
         this.cassandraEventDeadLettersGroupDAO = cassandraEventDeadLettersGroupDAO;
     }
diff --git a/pom.xml b/pom.xml
index 5a60f56..37281d3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -780,6 +780,11 @@
             </dependency>
             <dependency>
                 <groupId>${james.groupId}</groupId>
+                <artifactId>apache-james-mailbox-event-cassandra</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${james.groupId}</groupId>
                 <artifactId>apache-james-mailbox-event-json</artifactId>
                 <version>${project.version}</version>
             </dependency>
diff --git a/server/container/guice/cassandra-guice/pom.xml b/server/container/guice/cassandra-guice/pom.xml
index 8879b46..76b08f7 100644
--- a/server/container/guice/cassandra-guice/pom.xml
+++ b/server/container/guice/cassandra-guice/pom.xml
@@ -77,6 +77,10 @@
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
+            <artifactId>apache-james-mailbox-event-cassandra</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${james.groupId}</groupId>
             <artifactId>apache-james-mailbox-scanning-search</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraDeadLetterModule.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraDeadLetterModule.java
new file mode 100644
index 0000000..ae1bac4
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraDeadLetterModule.java
@@ -0,0 +1,46 @@
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
+
+package org.apache.james.modules.mailbox;
+
+import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.mailbox.events.CassandraEventDeadLetters;
+import org.apache.james.mailbox.events.CassandraEventDeadLettersDAO;
+import org.apache.james.mailbox.events.CassandraEventDeadLettersGroupDAO;
+import org.apache.james.mailbox.events.CassandraEventDeadLettersModule;
+import org.apache.james.mailbox.events.EventDeadLetters;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+import com.google.inject.multibindings.Multibinder;
+
+public class CassandraDeadLetterModule extends AbstractModule {
+    @Override
+    protected void configure() {
+        bind(CassandraEventDeadLettersGroupDAO.class).in(Scopes.SINGLETON);
+        bind(CassandraEventDeadLettersDAO.class).in(Scopes.SINGLETON);
+        bind(CassandraEventDeadLetters.class).in(Scopes.SINGLETON);
+
+        bind(EventDeadLetters.class).to(CassandraEventDeadLetters.class);
+
+        Multibinder.newSetBinder(binder(), CassandraModule.class)
+            .addBinding()
+            .toInstance(CassandraEventDeadLettersModule.MODULE);
+    }
+}
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
index 2b677fc..d621194 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java
@@ -105,6 +105,7 @@ public class CassandraMailboxModule extends AbstractModule {
     protected void configure() {
         install(new DefaultEventModule());
         install(new CassandraQuotaModule());
+        install(new CassandraDeadLetterModule());
 
         bind(CassandraApplicableFlagDAO.class).in(Scopes.SINGLETON);
         bind(CassandraAttachmentDAO.class).in(Scopes.SINGLETON);
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
index df86f96..f516006 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -26,6 +26,7 @@ import org.apache.james.modules.data.SieveJPARepositoryModules;
 import org.apache.james.modules.mailbox.DefaultEventModule;
 import org.apache.james.modules.mailbox.JPAMailboxModule;
 import org.apache.james.modules.mailbox.LuceneSearchMailboxModule;
+import org.apache.james.modules.mailbox.MemoryDeadLetterModule;
 import org.apache.james.modules.protocols.IMAPServerModule;
 import org.apache.james.modules.protocols.LMTPServerModule;
 import org.apache.james.modules.protocols.ManageSieveServerModule;
@@ -85,6 +86,7 @@ public class JPAJamesServerMain {
         new RawPostDequeueDecoratorModule(),
         new SieveJPARepositoryModules(),
         new DefaultEventModule(),
+        new MemoryDeadLetterModule(),
         new SpamAssassinListenerModule());
 
     public static final Module JPA_MODULE_AGGREGATE = Modules.combine(JPA_SERVER_MODULE, PROTOCOLS);
diff --git a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/DefaultEventModule.java b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/DefaultEventModule.java
index a7114f9..73b5ccc 100644
--- a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/DefaultEventModule.java
+++ b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/DefaultEventModule.java
@@ -24,10 +24,8 @@ import javax.inject.Inject;
 import org.apache.commons.configuration2.ex.ConfigurationException;
 import org.apache.james.lifecycle.api.Startable;
 import org.apache.james.mailbox.events.EventBus;
-import org.apache.james.mailbox.events.EventDeadLetters;
 import org.apache.james.mailbox.events.InVMEventBus;
 import org.apache.james.mailbox.events.MailboxListener;
-import org.apache.james.mailbox.events.MemoryEventDeadLetters;
 import org.apache.james.mailbox.events.RetryBackoffConfiguration;
 import org.apache.james.mailbox.events.delivery.EventDelivery;
 import org.apache.james.mailbox.events.delivery.InVmEventDelivery;
@@ -51,9 +49,7 @@ public class DefaultEventModule extends AbstractModule {
         bind(MailboxListenersLoaderImpl.class).in(Scopes.SINGLETON);
         bind(InVmEventDelivery.class).in(Scopes.SINGLETON);
         bind(InVMEventBus.class).in(Scopes.SINGLETON);
-        bind(MemoryEventDeadLetters.class).in(Scopes.SINGLETON);
 
-        bind(EventDeadLetters.class).to(MemoryEventDeadLetters.class);
         Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(EventDeadLettersProbe.class);
         bind(MailboxListenersLoader.class).to(MailboxListenersLoaderImpl.class);
         bind(EventDelivery.class).to(InVmEventDelivery.class);
diff --git a/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/MemoryDeadLetterModule.java b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/MemoryDeadLetterModule.java
new file mode 100644
index 0000000..5bab450
--- /dev/null
+++ b/server/container/guice/mailbox/src/main/java/org/apache/james/modules/mailbox/MemoryDeadLetterModule.java
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.                                           *
+ ****************************************************************/
+
+package org.apache.james.modules.mailbox;
+
+import org.apache.james.mailbox.events.EventDeadLetters;
+import org.apache.james.mailbox.events.MemoryEventDeadLetters;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+
+public class MemoryDeadLetterModule extends AbstractModule {
+    @Override
+    protected void configure() {
+        bind(MemoryEventDeadLetters.class).in(Scopes.SINGLETON);
+        bind(EventDeadLetters.class).to(MemoryEventDeadLetters.class);
+    }
+}
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
index c0408ef..c98a75b 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/modules/mailbox/MemoryMailboxModule.java
@@ -78,6 +78,7 @@ public class MemoryMailboxModule extends AbstractModule {
     @Override
     protected void configure() {
         install(new DefaultEventModule());
+        install(new MemoryDeadLetterModule());
         install(new MemoryQuotaModule());
         install(new MemoryQuotaSearchModule());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org