See also more specific configurations related to TLS,
+ Sieve and
+ Antispam.
+
+
+
+
+
+
diff --git a/server/src/site/xdoc/index.xml b/server/src/site/xdoc/index.xml
index 6f41a337dcf..ca4bf79c62e 100644
--- a/server/src/site/xdoc/index.xml
+++ b/server/src/site/xdoc/index.xml
@@ -64,6 +64,12 @@
manage, monitor
and develop Apache James Server.
+
+ We are currently working on an experimental module which goal is to simplify the configuration process.
+ This module only supports the Cassandra backend yet,
+ and may be started with docker.
+
+
Download Apache James Mail Server 3.0-beta4 and quick-start it!
@@ -120,10 +126,12 @@
-
Configure the stores,... via the well-known Spring framework - read more.
diff --git a/server/src/site/xdoc/quick-start-cassandra.xml b/server/src/site/xdoc/quick-start-cassandra.xml
new file mode 100644
index 00000000000..f68d586668a
--- /dev/null
+++ b/server/src/site/xdoc/quick-start-cassandra.xml
@@ -0,0 +1,192 @@
+
+
+
+
+
+ Apache James Server 3 - Quick Start for Cassandra backend
+
+
+
+
+
+
+
The goal of the document is to allow anyone to start with James on Docker as an operational mail server.
+
The method described bellow should not be used in production.
+
+
+Step 0: Requirements
+####################
+
+ * Java 8 SDK
+ * 512MB RAM (launches with -Xmx512M - can use less, can need more, depending on load)
+ * Docker 1.7.1+
+ * Maven 3.3
+
+Step 1: Download
+#################
+
+ * Clone the James git repository
+
+$ git clone git://git.apache.org/james.git
+
+ * Then go to the James folder
+
+$ cd james
+
+Step 3: Compile
+###############
+
+ * Compile the Guice Cassandra project
+
+$ mvn package -DskipTests
+
+Step 3: Deploy
+##############
+
+3.1. Deploy Cassandra (optional)
+You may skip this part if you already have a running Cassandra on your network.
+
+$ docker run --name=cassandra cassandra
+
+3.2. Deploy ElasticSearch (optional)
+You may skip this part if you already have a running ElasticSearch on your network.
+
+$ docker run --name=elasticsearch elasticsearch:1.5.2
+
+Step 4: Configure
+#################
+
+ * Follow the Cassandra guice configuration documentation.
+ * We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.
+
+Copy your TSL keys to ./conf/keystore or generate it using :
+
+$ keytool -genkey -alias james -keyalg RSA -keystore ./conf/keystore
+
+Configure your domain in the ./conf/domainlist.xml file.
+
+Step 5: Start
+#############
+
+ * Run James
+
+$ java -Dworking.directory=WORKING_PATH -jar container/cassandra-guice/target/james-server-cassandra-guice-beta5-SNAPSHOT.jar
+
+Where :
+- WORKING_PATH is the path where are located your configuration file folder.
+
+Step 6: Create Domains and Users
+################################
+
+Time to add domains and users.
+
+Give enough rights to the James CLI
+
+$ chmod 755 app/target/appassembler/bin/james-cli.sh
+
+$ ./app/target/appassembler/bin/james-cli.sh -h 127.0.0.1 -p 9999 adduser USER_MAIL_ADDRESSPASSWORD
+
+Where :
+- USER_MAIL_ADDRESS is the mail address that will be used by this user.
+- PASSWORD is the password that will be used by this user.
+
+Step 8: Test
+############
+
+$ telnet HOSTNAME 25
+Trying HOSTNAME...
+Connected to HOSTNAME.
+Escape character is '^]'.
+220 172.16.1.131 SMTP Server (JAMES SMTP Server 3.0-beta4) ready Sat, 6 Nov 2010 17:31:33 +0100 (CET)
+ehlo test
+250-172.16.1.131 Hello test (aoscommunity.com [127.0.0.1])
+250-PIPELINING
+250-ENHANCEDSTATUSCODES
+250 8BITMIME
+mail from:<YOUR_NAME@YOUR_DOMAIN>
+250 2.1.0 Sender <YOUR_NAME@YOUR_DOMAIN> OK
+rcpt to:<YOUR_NAME@YOUR_DOMAIN>
+250 2.1.5 Recipient <YOUR_NAME@YOUR_DOMAIN> OK
+data
+354 Ok Send data ending with <CRLF>.<CRLF>
+subject: test
+
+this is a test
+.
+250 2.6.0 Message received
+quit
+Connection closed by foreign host.
+
+Step 8: Manage
+##############
+
+8.1. Manage via james-cli
+
+ usage:
+$ docker exec james-cassandra /root/james-server-app-3.0.0-beta5-SNAPSHOT/bin/james-cli.sh -h 127.0.0.1 -p 9999
+
+ Available commands:
+ adduser </username> </password>
+ removeuser </username>
+ listusers
+ adddomain </domainname>
+ removedomain </domainname>
+ listdomains
+
+8.2. Manage via JMX
+
+ * Launch jconsole (or any other JMX client) and connect on URL=service:jmx:rmi:///jndi/rmi://localhost:HOSTNAME/jmxrmi
+ * Select the MBeans tab and open the org.apache.james node to view attributes and execute operations.
+
+Step 9: Monitor
+###############
+
+ * Monitor the ./log/james-server.log log file.
+
+ * Monitor via JMX (launch any JMX client and connect to URL=service:jmx:rmi:///jndi/rmi://HOSTNAME:9999/jmxrmi)
+
+ * Check ./var folder usage
+
+ mail
+ +-error
+ +-address-error
+ +-relay-denied
+ +-spam
+
+ store
+ +-maildir
+ +-derby
+ +-jackrabbit
+ +-activemq
+ +-brokers
+ +-james
+ +-blob-transfer
+ +-outgoing
+ +-spool
+
+ * Check /tmp folder usage
+
+
+
+
+
+
+
+
From 7fe035ca5674a8ba9dc219469ea868cfe3a60247 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 15 Sep 2015 12:21:32 +0200
Subject: [PATCH 24/39] JAMES-1626 sample configuration and readme
---
server/container/cassandra-guice/README.adoc | 39 +++++
.../sample-configuration/cassandra.properties | 6 +
.../sample-configuration/dnsservice.xml | 29 ++++
.../sample-configuration/domainlist.xml | 28 ++++
.../elasticsearch.properties | 26 ++++
.../sample-configuration/imapserver.xml | 54 +++++++
.../sample-configuration/jcr-repository.xml | 72 +++++++++
.../sample-configuration/jmx.properties | 28 ++++
.../sample-configuration/lmtpserver.xml | 41 ++++++
.../sample-configuration/mailetcontainer.xml | 137 ++++++++++++++++++
.../mailrepositorystore.xml | 34 +++++
.../sample-configuration/pop3server.xml | 42 ++++++
.../recipientrewritetable.xml | 27 ++++
.../sample-configuration/smtpserver.xml | 105 ++++++++++++++
.../sample-configuration/usersrepository.xml | 26 ++++
15 files changed, 694 insertions(+)
create mode 100644 server/container/cassandra-guice/README.adoc
create mode 100644 server/container/cassandra-guice/sample-configuration/cassandra.properties
create mode 100644 server/container/cassandra-guice/sample-configuration/dnsservice.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/domainlist.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/elasticsearch.properties
create mode 100644 server/container/cassandra-guice/sample-configuration/imapserver.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/jcr-repository.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/jmx.properties
create mode 100644 server/container/cassandra-guice/sample-configuration/lmtpserver.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/mailetcontainer.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/mailrepositorystore.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/pop3server.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/recipientrewritetable.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/smtpserver.xml
create mode 100644 server/container/cassandra-guice/sample-configuration/usersrepository.xml
diff --git a/server/container/cassandra-guice/README.adoc b/server/container/cassandra-guice/README.adoc
new file mode 100644
index 00000000000..7b6698e180f
--- /dev/null
+++ b/server/container/cassandra-guice/README.adoc
@@ -0,0 +1,39 @@
+= Guice-Cassandra Module How-to
+
+== Building
+
+=== Requirements
+
+ * Java 8 SDK
+ * Docker
+ * Maven
+
+=== Building the artifacts
+
+An usual compilation using maven will produce two artifacts into target directory :
+
+ * james-server-cassandra-guice-${version}.jar
+ * james-server-cassandra-guice-${version}.lib
+
+== Running
+
+=== Requirements
+
+ * Cassandra
+ * ElasticSearch 1.5.2
+
+=== James Launch
+
+To run james, you have to create a directory containing required configuration files.
+
+A sample directory (appropriately named sample-directory) is provided with some
+default value you may need to replace.
+
+You need to have a Cassandra and an ElasticSearch instance running.
+
+Once everything is set up, you just have to run the jar with :
+
+[source]
+----
+$ java -Dworking.directory=sample-configuration -jar target/james-server-cassandra-guice-${version}.jar
+----
diff --git a/server/container/cassandra-guice/sample-configuration/cassandra.properties b/server/container/cassandra-guice/sample-configuration/cassandra.properties
new file mode 100644
index 00000000000..1358332a51e
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/cassandra.properties
@@ -0,0 +1,6 @@
+# Configuration file for cassandra mailbox
+
+cassandra.ip=172.17.0.2
+cassandra.port=9042
+cassandra.keyspace=apache_james
+cassandra.replication.factor=1
\ No newline at end of file
diff --git a/server/container/cassandra-guice/sample-configuration/dnsservice.xml b/server/container/cassandra-guice/sample-configuration/dnsservice.xml
new file mode 100644
index 00000000000..0978a00b899
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/dnsservice.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+ 8.8.8.8
+ 62.210.16.6
+
+ false
+ false
+ 50000
+
diff --git a/server/container/cassandra-guice/sample-configuration/domainlist.xml b/server/container/cassandra-guice/sample-configuration/domainlist.xml
new file mode 100644
index 00000000000..8d001185bbb
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/domainlist.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ james.apache.org
+
+ true
+ true
+ localhost
+
diff --git a/server/container/cassandra-guice/sample-configuration/elasticsearch.properties b/server/container/cassandra-guice/sample-configuration/elasticsearch.properties
new file mode 100644
index 00000000000..924404c41c7
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/elasticsearch.properties
@@ -0,0 +1,26 @@
+# 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
+
+# Configuration file for ElasticSearch
+
+elasticsearch.masterHost=172.17.0.1
+elasticsearch.port=9300
+elasticsearch.nb.shards=1
+elasticsearch.nb.replica=0
\ No newline at end of file
diff --git a/server/container/cassandra-guice/sample-configuration/imapserver.xml b/server/container/cassandra-guice/sample-configuration/imapserver.xml
new file mode 100644
index 00000000000..c03b978fb5a
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/imapserver.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+ imapserver
+ 0.0.0.0:1143
+ 200
+
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ 0
+ 0
+
+
+ imapserver-ssl
+ 0.0.0.0:1993
+ 200
+
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ 0
+ 0
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/jcr-repository.xml b/server/container/cassandra-guice/sample-configuration/jcr-repository.xml
new file mode 100644
index 00000000000..c1b998a75f7
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/jcr-repository.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/jmx.properties b/server/container/cassandra-guice/sample-configuration/jmx.properties
new file mode 100644
index 00000000000..a1dbdf8924b
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/jmx.properties
@@ -0,0 +1,28 @@
+# 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
+
+# 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
+
+jmx.address=127.0.0.1
+jmx.port=9999
diff --git a/server/container/cassandra-guice/sample-configuration/lmtpserver.xml b/server/container/cassandra-guice/sample-configuration/lmtpserver.xml
new file mode 100644
index 00000000000..87a0caaf793
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/lmtpserver.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ lmtpserver
+
+ 127.0.0.1:1024
+ 200
+ 1200
+
+ 0
+
+ 0
+
+
+ 0
+
+
+
+
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/mailetcontainer.xml b/server/container/cassandra-guice/sample-configuration/mailetcontainer.xml
new file mode 100644
index 00000000000..968b59c4d0e
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/mailetcontainer.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+ postmaster@james.minet.net
+
+
+
+ 20
+
+
+
+
+
+
+
+
+ sieve-manager-check
+
+
+ transport
+
+
+ true
+
+
+ transport
+
+
+ transport
+
+
+
+
+
+
+ spam
+ 550 Requested action not taken: rejected - see http://njabl.org/
+
+
+ transport
+
+
+
+
+
+
+ file://var/mail/error/
+
+
+
+
+
+
+ X-UserIsAuth
+ true
+
+
+ X-WasSigned
+ true
+
+
+
+
+ local-address-error
+ 550 - Requested action not taken: no such user here
+
+
+ outgoing
+ 5000, 100000, 500000
+ 25
+ 0
+ 10
+ true
+ bounces
+
+
+ relay-denied
+
+
+
+
+
+ file://var/mail/spam/
+
+
+
+
+
+ none
+
+
+ file://var/mail/address-error/
+
+
+
+
+
+ none
+
+
+ file://var/mail/relay-denied/
+ Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation
+
+
+
+
+
+ false
+
+
+
+
+
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/mailrepositorystore.xml b/server/container/cassandra-guice/sample-configuration/mailrepositorystore.xml
new file mode 100644
index 00000000000..acca810221d
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/mailrepositorystore.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+ file
+
+
+
+
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/pop3server.xml b/server/container/cassandra-guice/sample-configuration/pop3server.xml
new file mode 100644
index 00000000000..c57c8324d6f
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/pop3server.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+ pop3server
+ 0.0.0.0:1110
+ 200
+
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ 1200
+ 0
+ 0
+
+
+
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/recipientrewritetable.xml b/server/container/cassandra-guice/sample-configuration/recipientrewritetable.xml
new file mode 100644
index 00000000000..7e7f586a3c8
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/recipientrewritetable.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ true
+ 10
+ some@domain=some
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/smtpserver.xml b/server/container/cassandra-guice/sample-configuration/smtpserver.xml
new file mode 100644
index 00000000000..c34fcd1c37c
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/smtpserver.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ smtpserver-global
+ 0.0.0.0:1025
+ 200
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+ SunX509
+
+ 360
+ 0
+ 0
+ false
+ 0.0.0.0/0
+ true
+ 0
+ true
+ JAMES Linagora's SMTP awesome Server
+
+
+
+
+
+
+ smtpserver-TLS
+ 0.0.0.0:1465
+ 200
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+ SunX509
+
+ 360
+ 0
+ 0
+
+ true
+ 0.0.0.0/0
+
+ false
+ 0
+ true
+ JAMES Linagora's SMTP awesome Server
+
+
+
+
+
+
+ smtpserver-authenticated
+ 0.0.0.0:1587
+ 200
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+ SunX509
+
+ 360
+ 0
+ 0
+
+ true
+ 0.0.0.0/0
+
+ false
+ 0
+ true
+ JAMES Linagora's SMTP awesome Server
+
+
+
+
+
+
+
+
diff --git a/server/container/cassandra-guice/sample-configuration/usersrepository.xml b/server/container/cassandra-guice/sample-configuration/usersrepository.xml
new file mode 100644
index 00000000000..43afa130870
--- /dev/null
+++ b/server/container/cassandra-guice/sample-configuration/usersrepository.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ MD5
+ true
+
+
From 7fc1d15cc07db33c843f8fd39d6eb7ffe85b8cf7 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Thu, 22 Oct 2015 14:21:25 +0200
Subject: [PATCH 25/39] JAMES-1626 use FileSystem to find configuration files
---
.../backends/cassandra/CassandraCluster.java | 7 ++-
.../james/CassandraJamesServerMain.java | 10 +--
.../james/modules/CommonServicesModule.java | 61 +++++++++++++++++++
.../mailbox/CassandraSessionModule.java | 2 +-
.../mailbox/ElasticSearchMailboxModule.java | 2 +-
.../protocols/ProtocolHandlerModule.java | 3 -
.../james/modules/server/JMXServer.java | 37 ++++++-----
.../utils/FileConfigurationProvider.java | 38 +++++++++---
.../james/CassandraJamesServerTest.java | 23 +------
.../james/modules/TestFilesystemModule.java} | 24 +++++---
.../utils/FileConfigurationProviderTest.java | 12 +++-
.../InMemoryMailRepositoryStoreTest.java | 13 ++--
.../src/test/resources/cassandra.properties | 6 --
.../test/resources/elasticsearch.properties | 26 --------
.../src/test/resources/jmx.properties | 28 ---------
.../james/core/JamesServerResourceLoader.java | 8 ++-
.../james/core/filesystem/FileSystemImpl.java | 2 +
.../core/filesystem/FileSystemImplTest.java | 15 +----
.../JamesServerApplicationContext.java | 2 +-
.../spring/filesystem/FileSystemImplTest.java | 16 +----
20 files changed, 172 insertions(+), 163 deletions(-)
create mode 100644 server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java
rename server/container/cassandra-guice/src/{main/java/org/apache/james/modules/server/FileSystemModule.java => test/java/org/apache/james/modules/TestFilesystemModule.java} (68%)
delete mode 100644 server/container/cassandra-guice/src/test/resources/cassandra.properties
delete mode 100644 server/container/cassandra-guice/src/test/resources/elasticsearch.properties
delete mode 100644 server/container/cassandra-guice/src/test/resources/jmx.properties
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index dfe2c1aa3f8..d60e3430e87 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -77,9 +77,8 @@ public void clearAllTables() {
private Optional tryInitializeSession() {
try {
- Cluster cluster = ClusterFactory.createClusterForSingleServerWithoutPassWord(CLUSTER_IP, CLUSTER_PORT_TEST);
Cluster clusterWithInitializedKeyspace = ClusterWithKeyspaceCreatedFactory
- .clusterWithInitializedKeyspace(cluster, KEYSPACE_NAME, REPLICATION_FACTOR);
+ .clusterWithInitializedKeyspace(getCluster(), KEYSPACE_NAME, REPLICATION_FACTOR);
return Optional.of(new SessionWithInitializedTablesFactory(module).createSession(clusterWithInitializedKeyspace, KEYSPACE_NAME));
} catch (NoHostAvailableException exception) {
sleep(SLEEP_BEFORE_RETRY);
@@ -87,6 +86,10 @@ private Optional tryInitializeSession() {
}
}
+ public Cluster getCluster() {
+ return ClusterFactory.createClusterForSingleServerWithoutPassWord(CLUSTER_IP, CLUSTER_PORT_TEST);
+ }
+
private void sleep(long sleepMs) {
try {
Thread.sleep(sleepMs);
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java b/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
index 27ad824ba32..1ddab6e2e7a 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
@@ -19,6 +19,7 @@
package org.apache.james;
+import org.apache.james.modules.CommonServicesModule;
import org.apache.james.modules.data.CassandraDomainListModule;
import org.apache.james.modules.data.CassandraRecipientRewriteTableModule;
import org.apache.james.modules.data.CassandraUsersRepositoryModule;
@@ -35,7 +36,6 @@
import org.apache.james.modules.server.ConfigurationPerformerModule;
import org.apache.james.modules.server.ConfigurationProviderModule;
import org.apache.james.modules.server.DNSServiceModule;
-import org.apache.james.modules.server.FileSystemModule;
import org.apache.james.modules.server.JMXServerModule;
import org.apache.james.modules.server.MailStoreRepositoryModule;
import org.apache.james.modules.server.QuotaModule;
@@ -47,8 +47,9 @@
public class CassandraJamesServerMain {
public static final Module defaultModule = Modules.combine(
- new CassandraMailboxModule(),
+ new CommonServicesModule(),
new ConfigurationPerformerModule(),
+ new CassandraMailboxModule(),
new CassandraSessionModule(),
new ElasticSearchMailboxModule(),
new CassandraUsersRepositoryModule(),
@@ -61,7 +62,6 @@ public class CassandraJamesServerMain {
new SMTPServerModule(),
new LMTPServerModule(),
new ActiveMQQueueModule(),
- new FileSystemModule(),
new SieveModule(),
new MailStoreRepositoryModule(),
new CamelMailetContainerModule(),
@@ -70,8 +70,8 @@ public class CassandraJamesServerMain {
public static void main(String[] args) throws Exception {
CassandraJamesServer server = new CassandraJamesServer(Modules.combine(
- defaultModule,
- new JMXServerModule()));
+ defaultModule,
+ new JMXServerModule()));
server.start();
}
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java
new file mode 100644
index 00000000000..b380d2e72c7
--- /dev/null
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/CommonServicesModule.java
@@ -0,0 +1,61 @@
+/****************************************************************
+ * 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;
+
+import java.util.Optional;
+
+import javax.inject.Named;
+import javax.inject.Singleton;
+
+import org.apache.commons.cli.MissingArgumentException;
+import org.apache.james.core.JamesServerResourceLoader;
+import org.apache.james.core.filesystem.FileSystemImpl;
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.filesystem.api.JamesDirectoriesProvider;
+import org.apache.james.utils.ConfigurationProvider;
+import org.apache.james.utils.FileConfigurationProvider;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+
+public class CommonServicesModule extends AbstractModule {
+
+ public static final String CONFIGURATION_PATH = "configurationPath";
+
+ @Override
+ protected void configure() {
+ bind(FileSystem.class).to(FileSystemImpl.class);
+ bind(ConfigurationProvider.class).to(FileConfigurationProvider.class);
+ }
+
+ @Provides @Singleton @Named(CONFIGURATION_PATH)
+ public String configurationPath() {
+ return FileSystem.FILE_PROTOCOL_AND_CONF;
+ }
+
+ @Provides @Singleton
+ public JamesDirectoriesProvider directories() throws MissingArgumentException {
+ String rootDirectory = Optional
+ .ofNullable(System.getProperty("working.directory"))
+ .orElseThrow(() -> new MissingArgumentException("Server needs a working.directory env entry"));
+ return new JamesServerResourceLoader(rootDirectory);
+ }
+
+}
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java
index a3777924104..c3588ba3e6f 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraSessionModule.java
@@ -71,7 +71,7 @@ Cluster provideCluster(FileSystem fileSystem) throws FileNotFoundException, Conf
}
private PropertiesConfiguration getConfiguration(FileSystem fileSystem) throws FileNotFoundException, ConfigurationException {
- return new PropertiesConfiguration(fileSystem.getFile("cassandra.properties"));
+ return new PropertiesConfiguration(fileSystem.getFile(FileSystem.FILE_PROTOCOL_AND_CONF + "cassandra.properties"));
}
}
\ No newline at end of file
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
index 4c8f7cc179e..4ba750ff5b2 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
@@ -53,7 +53,7 @@ protected void configure() {
@Provides
@Singleton
protected ClientProvider provideClientProvider(FileSystem fileSystem) throws ConfigurationException, FileNotFoundException {
- PropertiesConfiguration propertiesReader = new PropertiesConfiguration(fileSystem.getFile("elasticsearch.properties"));
+ PropertiesConfiguration propertiesReader = new PropertiesConfiguration(fileSystem.getFile(FileSystem.FILE_PROTOCOL_AND_CONF + "elasticsearch.properties"));
ClientProvider clientProvider = new ClientProviderImpl(propertiesReader.getString("elasticsearch.masterHost"),
propertiesReader.getInt("elasticsearch.port"));
IndexCreationFactory.createIndex(clientProvider,
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java
index 2b012a33452..10d20d258b0 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/protocols/ProtocolHandlerModule.java
@@ -19,8 +19,6 @@
package org.apache.james.modules.protocols;
-import org.apache.james.core.filesystem.FileSystemImpl;
-import org.apache.james.filesystem.api.FileSystem;
import org.apache.james.protocols.lib.handler.ProtocolHandlerLoader;
import org.apache.james.utils.GuiceProtocolHandlerLoader;
@@ -30,7 +28,6 @@ public class ProtocolHandlerModule extends AbstractModule {
@Override
protected void configure() {
- bind(FileSystem.class).to(FileSystemImpl.class);
bind(ProtocolHandlerLoader.class).to(GuiceProtocolHandlerLoader.class);
}
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/JMXServer.java b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/JMXServer.java
index db15ac5aebf..4b4e63d4a70 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/JMXServer.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/JMXServer.java
@@ -19,32 +19,39 @@
package org.apache.james.modules.server;
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableMap;
-import org.apache.james.util.RestrictingRMISocketFactory;
-import org.apache.james.utils.PropertiesReader;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.rmi.registry.LocateRegistry;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
import javax.annotation.PreDestroy;
+import javax.inject.Inject;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.rmi.registry.LocateRegistry;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.util.RestrictingRMISocketFactory;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableMap;
public class JMXServer {
+ private final FileSystem fileSystem;
private final Set registeredKeys;
private final Object lock;
private JMXConnectorServer jmxConnectorServer;
private boolean isStarted;
- public JMXServer() {
+ @Inject
+ public JMXServer(FileSystem fileSystem) {
+ this.fileSystem = fileSystem;
isStarted = false;
registeredKeys = new HashSet<>();
lock = new Object();
@@ -79,11 +86,11 @@ public void register(String key, Object remote) throws Exception {
}
private void doStart() {
- PropertiesReader propertiesReader = new PropertiesReader("jmx.properties");
- String address = propertiesReader.getProperty("jmx.address");
- int port = Integer.parseInt(propertiesReader.getProperty("jmx.port"));
- String serviceURL = "service:jmx:rmi://" + address + "/jndi/rmi://" + address+ ":" + port +"/jmxrmi";
try {
+ PropertiesConfiguration configuration = new PropertiesConfiguration(fileSystem.getFile(FileSystem.FILE_PROTOCOL_AND_CONF + "jmx.properties"));
+ String address = configuration.getString("jmx.address");
+ int port = configuration.getInt("jmx.port");
+ String serviceURL = "service:jmx:rmi://" + address + "/jndi/rmi://" + address+ ":" + port +"/jmxrmi";
RestrictingRMISocketFactory restrictingRMISocketFactory = new RestrictingRMISocketFactory(address);
LocateRegistry.createRegistry(port, restrictingRMISocketFactory, restrictingRMISocketFactory);
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java b/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java
index 7b9d513b827..75ad86bc3b4 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java
@@ -19,21 +19,40 @@
package org.apache.james.utils;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.commons.cli.MissingArgumentException;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.modules.CommonServicesModule;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.inject.Singleton;
+@Singleton
public class FileConfigurationProvider implements ConfigurationProvider {
private static final String CONFIGURATION_FILE_SUFFIX = ".xml";
+
+ private final FileSystem fileSystem;
+ private String configurationPrefix;
+
+ @Inject
+ public FileConfigurationProvider(FileSystem fileSystem, @Named(CommonServicesModule.CONFIGURATION_PATH) String configurationPrefix) throws MissingArgumentException {
+ this.fileSystem = fileSystem;
+ this.configurationPrefix = configurationPrefix;
+ }
+
@Override
public HierarchicalConfiguration getConfiguration(String component) throws ConfigurationException {
List configPathParts = Arrays.asList(component.split("\\."));
@@ -43,8 +62,11 @@ public HierarchicalConfiguration getConfiguration(String component) throws Confi
private InputStream retrieveConfigInputStream(String configurationFileWithoutExtension) throws ConfigurationException {
Preconditions.checkArgument(!Strings.isNullOrEmpty(configurationFileWithoutExtension), "The configuration file name should not be empty or null");
- return Optional.ofNullable(ClassLoader.getSystemResourceAsStream(configurationFileWithoutExtension + CONFIGURATION_FILE_SUFFIX))
- .orElseThrow(() -> new ConfigurationException("Unable to locate configuration file " + configurationFileWithoutExtension + CONFIGURATION_FILE_SUFFIX));
+ try {
+ return fileSystem.getResource(configurationPrefix + configurationFileWithoutExtension + CONFIGURATION_FILE_SUFFIX);
+ } catch (IOException e) {
+ throw new ConfigurationException("Unable to locate configuration file " + configurationFileWithoutExtension + CONFIGURATION_FILE_SUFFIX, e);
+ }
}
private XMLConfiguration getConfig(InputStream configStream) throws ConfigurationException {
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index b7a5c8b037a..e79894ee7f6 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -20,7 +20,6 @@
import static org.assertj.core.api.Assertions.assertThat;
-import java.io.File;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
@@ -29,10 +28,9 @@
import org.apache.james.backends.cassandra.CassandraCluster;
import org.apache.james.backends.cassandra.components.CassandraModule;
-import org.apache.james.core.JamesServerResourceLoader;
-import org.apache.james.filesystem.api.JamesDirectoriesProvider;
import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
import org.apache.james.modules.TestElasticSearchModule;
+import org.apache.james.modules.TestFilesystemModule;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
@@ -62,25 +60,6 @@ public class CassandraJamesServerTest {
@Rule
public RuleChain chain = RuleChain.outerRule(temporaryFolder).around(embeddedElasticSearch);
- private static class TestFilesystemModule extends AbstractModule {
-
- JamesServerResourceLoader jamesServerResourceLoader;
-
- TestFilesystemModule(File tmpDir) {
- jamesServerResourceLoader = new JamesServerResourceLoader() {
- @Override
- public String getRootDirectory() {
- return tmpDir.getAbsolutePath();
- }
- };
- }
-
- @Override
- protected void configure() {
- bind(JamesDirectoriesProvider.class).toInstance(jamesServerResourceLoader);
- }
- }
-
@Before
public void setup() throws Exception {
server = new CassandraJamesServer(Modules.override(CassandraJamesServerMain.defaultModule)
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/FileSystemModule.java b/server/container/cassandra-guice/src/test/java/org/apache/james/modules/TestFilesystemModule.java
similarity index 68%
rename from server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/FileSystemModule.java
rename to server/container/cassandra-guice/src/test/java/org/apache/james/modules/TestFilesystemModule.java
index bd85c798acd..63b46b47e2d 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/modules/server/FileSystemModule.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/modules/TestFilesystemModule.java
@@ -16,21 +16,31 @@
* specific language governing permissions and limitations *
* under the License. *
****************************************************************/
-package org.apache.james.modules.server;
+
+package org.apache.james.modules;
+
+import java.io.File;
import org.apache.james.core.JamesServerResourceLoader;
-import org.apache.james.core.filesystem.FileSystemImpl;
import org.apache.james.filesystem.api.FileSystem;
import org.apache.james.filesystem.api.JamesDirectoriesProvider;
+import org.apache.james.modules.CommonServicesModule;
import com.google.inject.AbstractModule;
+import com.google.inject.name.Names;
-public class FileSystemModule extends AbstractModule {
+public class TestFilesystemModule extends AbstractModule {
+
+ private File workingDirectory;
- @Override
- public void configure() {
- bind(JamesDirectoriesProvider.class).to(JamesServerResourceLoader.class);
- bind(FileSystem.class).to(FileSystemImpl.class);
+ public TestFilesystemModule(File workingDirectory) {
+ this.workingDirectory = workingDirectory;
}
+ @Override
+ protected void configure() {
+ bind(JamesDirectoriesProvider.class).toInstance(new JamesServerResourceLoader(workingDirectory.getAbsolutePath()));
+ bindConstant().annotatedWith(Names.named(CommonServicesModule.CONFIGURATION_PATH)).to(FileSystem.CLASSPATH_PROTOCOL);
+ }
+
}
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
index 679ec714924..f4d07307269 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
@@ -21,12 +21,17 @@
import static org.assertj.core.api.Assertions.assertThat;
-import com.google.common.collect.Lists;
+import org.apache.commons.cli.MissingArgumentException;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.HierarchicalConfiguration;
+import org.apache.james.core.JamesServerResourceLoader;
+import org.apache.james.core.filesystem.FileSystemImpl;
+import org.apache.james.filesystem.api.FileSystem;
import org.junit.Before;
import org.junit.Test;
+import com.google.common.collect.Lists;
+
public class FileConfigurationProviderTest {
private static final String CONFIG_KEY_1 = "test2";
@@ -43,8 +48,9 @@ public class FileConfigurationProviderTest {
private FileConfigurationProvider configurationProvider;
@Before
- public void setUp() {
- configurationProvider = new FileConfigurationProvider();
+ public void setUp() throws MissingArgumentException {
+ FileSystemImpl fileSystem = new FileSystemImpl(new JamesServerResourceLoader("../"));
+ configurationProvider = new FileConfigurationProvider(fileSystem, FileSystem.CLASSPATH_PROTOCOL);
}
@Test(expected = IllegalArgumentException.class)
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/InMemoryMailRepositoryStoreTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/InMemoryMailRepositoryStoreTest.java
index 751406dedc9..d8582b3f5db 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/InMemoryMailRepositoryStoreTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/InMemoryMailRepositoryStoreTest.java
@@ -25,6 +25,7 @@
import org.apache.commons.configuration.ConfigurationException;
import org.apache.james.core.JamesServerResourceLoader;
import org.apache.james.core.filesystem.FileSystemImpl;
+import org.apache.james.filesystem.api.FileSystem;
import org.apache.james.mailrepository.api.MailRepositoryStore;
import org.apache.james.mailrepository.file.FileMailRepository;
import org.apache.james.modules.server.MailStoreRepositoryModule;
@@ -36,13 +37,15 @@
public class InMemoryMailRepositoryStoreTest {
private InMemoryMailRepositoryStore repositoryStore;
+ private FileSystemImpl fileSystem;
@Before
public void setUp() throws Exception {
+ fileSystem = new FileSystemImpl(new JamesServerResourceLoader("../"));
repositoryStore = new InMemoryMailRepositoryStore(Sets.newHashSet(
new MailStoreRepositoryModule.FileMailRepositoryProvider(
- new FileSystemImpl(new JamesServerResourceLoader()))));
- repositoryStore.configure(new FileConfigurationProvider().getConfiguration("mailrepositorystore"));
+ fileSystem)));
+ repositoryStore.configure(new FileConfigurationProvider(fileSystem, FileSystem.CLASSPATH_PROTOCOL).getConfiguration("mailrepositorystore"));
repositoryStore.init();
}
@@ -71,9 +74,9 @@ public void configureShouldThrowWhenNonValidClassesAreProvided() throws Exceptio
try {
repositoryStore = new InMemoryMailRepositoryStore(Sets.newHashSet(
new MailStoreRepositoryModule.FileMailRepositoryProvider(
- new FileSystemImpl(new JamesServerResourceLoader()))));
- repositoryStore.configure(new FileConfigurationProvider().getConfiguration("fakemailrepositorystore"));
- } catch (Exception e) {
+ fileSystem)));
+ repositoryStore.configure(new FileConfigurationProvider(fileSystem, FileSystem.CLASSPATH_PROTOCOL).getConfiguration("fakemailrepositorystore"));
+ } catch (ConfigurationException e) {
fail("Unexpected failure : ", e);
}
repositoryStore.init();
diff --git a/server/container/cassandra-guice/src/test/resources/cassandra.properties b/server/container/cassandra-guice/src/test/resources/cassandra.properties
deleted file mode 100644
index b4db9c1f7a8..00000000000
--- a/server/container/cassandra-guice/src/test/resources/cassandra.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-# Configuration file for cassandra mailbox
-
-cassandra.ip=127.0.0.1
-cassandra.port=9142
-cassandra.keyspace=apache_james
-cassandra.replication.factor=1
\ No newline at end of file
diff --git a/server/container/cassandra-guice/src/test/resources/elasticsearch.properties b/server/container/cassandra-guice/src/test/resources/elasticsearch.properties
deleted file mode 100644
index 454dabe2949..00000000000
--- a/server/container/cassandra-guice/src/test/resources/elasticsearch.properties
+++ /dev/null
@@ -1,26 +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.
-
-# This template file can be used as example for James Server configuration
-# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-# Configuration file for ElasticSearch
-
-elasticsearch.masterHost=127.0.0.1
-elasticsearch.port=9300
-elasticsearch.nb.shards=1
-elasticsearch.nb.replica=0
\ No newline at end of file
diff --git a/server/container/cassandra-guice/src/test/resources/jmx.properties b/server/container/cassandra-guice/src/test/resources/jmx.properties
deleted file mode 100644
index a1dbdf8924b..00000000000
--- a/server/container/cassandra-guice/src/test/resources/jmx.properties
+++ /dev/null
@@ -1,28 +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.
-#
-
-# This template file can be used as example for James Server configuration
-# DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-
-# 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
-
-jmx.address=127.0.0.1
-jmx.port=9999
diff --git a/server/container/core/src/main/java/org/apache/james/core/JamesServerResourceLoader.java b/server/container/core/src/main/java/org/apache/james/core/JamesServerResourceLoader.java
index 456771198db..4b3e5cb9d77 100644
--- a/server/container/core/src/main/java/org/apache/james/core/JamesServerResourceLoader.java
+++ b/server/container/core/src/main/java/org/apache/james/core/JamesServerResourceLoader.java
@@ -22,6 +22,12 @@
public class JamesServerResourceLoader implements JamesDirectoriesProvider {
+ private final String rootDirectory;
+
+ public JamesServerResourceLoader(String rootDirectory) {
+ this.rootDirectory = rootDirectory;
+ }
+
/**
* @see org.apache.james.container.spring.resource.JamesResourceLoader#getAbsoluteDirectory()
*/
@@ -60,7 +66,7 @@ public String getExternalLibraryDirectory() {
* org.apache.james.container.spring.resource.JamesResourceLoader#getRootDirectory()
*/
public String getRootDirectory() {
- return "../";
+ return rootDirectory;
}
}
\ No newline at end of file
diff --git a/server/container/core/src/main/java/org/apache/james/core/filesystem/FileSystemImpl.java b/server/container/core/src/main/java/org/apache/james/core/filesystem/FileSystemImpl.java
index b4dfadc0536..7724d769214 100644
--- a/server/container/core/src/main/java/org/apache/james/core/filesystem/FileSystemImpl.java
+++ b/server/container/core/src/main/java/org/apache/james/core/filesystem/FileSystemImpl.java
@@ -24,10 +24,12 @@
import java.io.InputStream;
import javax.inject.Inject;
+import javax.inject.Singleton;
import org.apache.james.filesystem.api.FileSystem;
import org.apache.james.filesystem.api.JamesDirectoriesProvider;
+@Singleton
public class FileSystemImpl implements FileSystem {
private final JamesDirectoriesProvider directoryProvider;
diff --git a/server/container/core/src/test/java/org/apache/james/core/filesystem/FileSystemImplTest.java b/server/container/core/src/test/java/org/apache/james/core/filesystem/FileSystemImplTest.java
index 7dda1cd84a7..28c9de4ef23 100644
--- a/server/container/core/src/test/java/org/apache/james/core/filesystem/FileSystemImplTest.java
+++ b/server/container/core/src/test/java/org/apache/james/core/filesystem/FileSystemImplTest.java
@@ -26,20 +26,7 @@ public class FileSystemImplTest extends AbstractFileSystemTest {
@Override
protected FileSystem buildFileSystem(String configurationRootDirectory) {
- return new FileSystemImpl(new TestDirectoryProvider(configurationRootDirectory));
+ return new FileSystemImpl(new JamesServerResourceLoader(configurationRootDirectory));
}
- private class TestDirectoryProvider extends JamesServerResourceLoader {
- private String configurationRootDirectory;
-
- public TestDirectoryProvider(String configurationRootDirectory) {
- this.configurationRootDirectory = configurationRootDirectory;
- }
-
- @Override
- public String getRootDirectory() {
- return configurationRootDirectory;
- }
- }
-
}
diff --git a/server/container/spring/src/main/java/org/apache/james/container/spring/context/JamesServerApplicationContext.java b/server/container/spring/src/main/java/org/apache/james/container/spring/context/JamesServerApplicationContext.java
index 1d6d11a3192..06dba52b10c 100644
--- a/server/container/spring/src/main/java/org/apache/james/container/spring/context/JamesServerApplicationContext.java
+++ b/server/container/spring/src/main/java/org/apache/james/container/spring/context/JamesServerApplicationContext.java
@@ -34,7 +34,7 @@ public class JamesServerApplicationContext extends ClassPathXmlApplicationContex
* The resourceloader to use. This must be defined as static, otherwise it
* will fail to startup..
*/
- private final static JamesResourceLoader resourceLoader = new DefaultJamesResourceLoader(new JamesServerResourceLoader());
+ private final static JamesResourceLoader resourceLoader = new DefaultJamesResourceLoader(new JamesServerResourceLoader("../"));
public JamesServerApplicationContext(String[] configs) {
super(configs);
diff --git a/server/container/spring/src/test/java/org/apache/james/container/spring/filesystem/FileSystemImplTest.java b/server/container/spring/src/test/java/org/apache/james/container/spring/filesystem/FileSystemImplTest.java
index f2a567a70de..b6b6604f031 100644
--- a/server/container/spring/src/test/java/org/apache/james/container/spring/filesystem/FileSystemImplTest.java
+++ b/server/container/spring/src/test/java/org/apache/james/container/spring/filesystem/FileSystemImplTest.java
@@ -44,21 +44,7 @@ public TestApplicationContextProvider(String configurationRootDirectory, String[
@Override
public JamesResourceLoader getResourceLoader() {
- return new DefaultJamesResourceLoader(new TestDirectoryProvider(configurationRootDirectory));
- }
- }
-
- private static class TestDirectoryProvider extends JamesServerResourceLoader {
-
- private String configurationRootDirectory;
-
- public TestDirectoryProvider(String configurationRootDirectory) {
- this.configurationRootDirectory = configurationRootDirectory;
- }
-
- @Override
- public String getRootDirectory() {
- return configurationRootDirectory;
+ return new DefaultJamesResourceLoader(new JamesServerResourceLoader(configurationRootDirectory));
}
}
From 6fe829d546e84a00d2cc8ff9e311fbb28c728902 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Wed, 28 Oct 2015 12:58:35 +0100
Subject: [PATCH 26/39] JAMES-1626 move everything needed to run spring james
under dockerfiles/run/spring
---
README.txt | 16 ++++++++--------
dockerfiles/{ => run/spring}/Dockerfile | 0
.../{ => run/spring}/destination/.gitignore | 0
.../conf/META-INF/jpa-mappings-template.xml | 0
.../conf/META-INF/persistence-template.xml | 0
.../destination/conf/META-INF/persistence.xml | 0
.../destination/conf/cassandra.properties | 0
.../spring}/destination/conf/dnsservice.xml | 0
.../spring}/destination/conf/domainlist.xml | 0
.../destination/conf/elasticsearch.properties | 0
.../spring}/destination/conf/fetchmail.xml | 0
.../spring}/destination/conf/imapserver.xml | 0
.../spring}/destination/conf/indexer.xml | 0
.../destination/conf/james-database.properties | 0
.../spring}/destination/conf/jcr-repository.xml | 0
.../spring}/destination/conf/jmx.properties | 0
.../spring}/destination/conf/lib/README.txt | 0
.../spring}/destination/conf/lmtpserver.xml | 0
.../spring}/destination/conf/log4j.properties | 0
.../spring}/destination/conf/mailbox.xml | 0
.../spring}/destination/conf/mailetcontainer.xml | 0
.../destination/conf/mailrepositorystore.xml | 0
.../destination/conf/managesieve.help.txt | 0
.../spring}/destination/conf/pop3server.xml | 0
.../{ => run/spring}/destination/conf/quota.xml | 0
.../destination/conf/recipientrewritetable.xml | 0
.../spring}/destination/conf/smtpserver.xml | 0
.../spring}/destination/conf/sqlResources.xml | 0
.../spring}/destination/conf/usersrepository.xml | 0
.../{ => run/spring}/destination/var/.gitignore | 0
30 files changed, 8 insertions(+), 8 deletions(-)
rename dockerfiles/{ => run/spring}/Dockerfile (100%)
rename dockerfiles/{ => run/spring}/destination/.gitignore (100%)
rename dockerfiles/{ => run/spring}/destination/conf/META-INF/jpa-mappings-template.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/META-INF/persistence-template.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/META-INF/persistence.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/cassandra.properties (100%)
rename dockerfiles/{ => run/spring}/destination/conf/dnsservice.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/domainlist.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/elasticsearch.properties (100%)
rename dockerfiles/{ => run/spring}/destination/conf/fetchmail.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/imapserver.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/indexer.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/james-database.properties (100%)
rename dockerfiles/{ => run/spring}/destination/conf/jcr-repository.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/jmx.properties (100%)
rename dockerfiles/{ => run/spring}/destination/conf/lib/README.txt (100%)
rename dockerfiles/{ => run/spring}/destination/conf/lmtpserver.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/log4j.properties (100%)
rename dockerfiles/{ => run/spring}/destination/conf/mailbox.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/mailetcontainer.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/mailrepositorystore.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/managesieve.help.txt (100%)
rename dockerfiles/{ => run/spring}/destination/conf/pop3server.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/quota.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/recipientrewritetable.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/smtpserver.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/sqlResources.xml (100%)
rename dockerfiles/{ => run/spring}/destination/conf/usersrepository.xml (100%)
rename dockerfiles/{ => run/spring}/destination/var/.gitignore (100%)
diff --git a/README.txt b/README.txt
index 144ba280015..33935ea89b6 100644
--- a/README.txt
+++ b/README.txt
@@ -57,13 +57,13 @@ First step, you have to build the Docker image
$ docker build -t james/project dockerfiles/compilation/java-6
In order to run the build, you have to launch the following command:
-$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/destination:/destination -t james/project -s SHA1
+$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/run/spring/destination:/destination -t james/project -s SHA1
Where:
- $PWD/.m2:/root/.m2: is the first volume used to share the maven repository,
as we don't want to download all dependencies on each build
-- $PWD/dockerfiles/destination:/destination: is the third volume used to get the compiled elements,
+- $PWD/dockerfiles/run/spring/destination:/destination: is the third volume used to get the compiled elements,
as it is needed by the container that will run James.
- SHA1 (optional): is the given git SHA1 of the james-project repository to build or trunk if none.
- -s option: given tests will not be played while building. Not specifying means play tests.
@@ -74,13 +74,13 @@ First step, you have to build the Docker image
$ docker build -t james/project dockerfiles/compilation/java-8
In order to run the build, you have to launch the following command:
-$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/destination:/destination -t james/project -s SHA1
+$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/dockerfiles/run/spring/destination:/destination -t james/project -s SHA1
Where:
- $PWD/.m2:/root/.m2: is the first volume used to share the maven repository,
as we don't want to download all dependencies on each build
-- $PWD/dockerfiles/destination:/destination: is the third volume used to get the compiled elements,
+- $PWD/dockerfiles/run/spring/destination:/destination: is the third volume used to get the compiled elements,
as it is needed by the container that will run James.
- SHA1 (optional): is the given git SHA1 of the james-project repository to build or trunk if none.
- -s option: given tests will not be played while building. Not specifying means play tests.
@@ -92,7 +92,7 @@ This feature is only available for Java 8 / Cassandra mailbox backend yet.
* Requirements
-You should have the zip resulting of the build in the ./dockerfiles/destination folder.
+You should have the zip resulting of the build in the ./dockerfiles/run/spring/destination folder.
* Howto ?
@@ -104,11 +104,11 @@ $ docker run -d --name=elasticsearch elasticsearch:1.5.2
We need to provide the key we will use for TLS. For obvious reasons, this is not provided in this git.
-Copy your TSL keys to destination/conf/keystore or generate it using the following command. The password must be james72laBalle to match default configuration.
-$ keytool -genkey -alias james -keyalg RSA -keystore dockerfiles/destination/conf/keystore
+Copy your TSL keys to destination/run/spring/conf/keystore or generate it using the following command. The password must be james72laBalle to match default configuration.
+$ keytool -genkey -alias james -keyalg RSA -keystore dockerfiles/run/spring/destination/conf/keystore
Then we need to build james container :
-$ docker build -t james_run dockerfiles
+$ docker build -t james_run dockerfiles/run/spring/
To run this container :
$ docker run --hostname HOSTNAME -p "25:25" -p "110:110" -p "143:143" -p "465:465" -p "587:587" -p "993:993" --link cassandra:cassandra --link elasticsearch:elasticsearch --name james_run -t james_run
diff --git a/dockerfiles/Dockerfile b/dockerfiles/run/spring/Dockerfile
similarity index 100%
rename from dockerfiles/Dockerfile
rename to dockerfiles/run/spring/Dockerfile
diff --git a/dockerfiles/destination/.gitignore b/dockerfiles/run/spring/destination/.gitignore
similarity index 100%
rename from dockerfiles/destination/.gitignore
rename to dockerfiles/run/spring/destination/.gitignore
diff --git a/dockerfiles/destination/conf/META-INF/jpa-mappings-template.xml b/dockerfiles/run/spring/destination/conf/META-INF/jpa-mappings-template.xml
similarity index 100%
rename from dockerfiles/destination/conf/META-INF/jpa-mappings-template.xml
rename to dockerfiles/run/spring/destination/conf/META-INF/jpa-mappings-template.xml
diff --git a/dockerfiles/destination/conf/META-INF/persistence-template.xml b/dockerfiles/run/spring/destination/conf/META-INF/persistence-template.xml
similarity index 100%
rename from dockerfiles/destination/conf/META-INF/persistence-template.xml
rename to dockerfiles/run/spring/destination/conf/META-INF/persistence-template.xml
diff --git a/dockerfiles/destination/conf/META-INF/persistence.xml b/dockerfiles/run/spring/destination/conf/META-INF/persistence.xml
similarity index 100%
rename from dockerfiles/destination/conf/META-INF/persistence.xml
rename to dockerfiles/run/spring/destination/conf/META-INF/persistence.xml
diff --git a/dockerfiles/destination/conf/cassandra.properties b/dockerfiles/run/spring/destination/conf/cassandra.properties
similarity index 100%
rename from dockerfiles/destination/conf/cassandra.properties
rename to dockerfiles/run/spring/destination/conf/cassandra.properties
diff --git a/dockerfiles/destination/conf/dnsservice.xml b/dockerfiles/run/spring/destination/conf/dnsservice.xml
similarity index 100%
rename from dockerfiles/destination/conf/dnsservice.xml
rename to dockerfiles/run/spring/destination/conf/dnsservice.xml
diff --git a/dockerfiles/destination/conf/domainlist.xml b/dockerfiles/run/spring/destination/conf/domainlist.xml
similarity index 100%
rename from dockerfiles/destination/conf/domainlist.xml
rename to dockerfiles/run/spring/destination/conf/domainlist.xml
diff --git a/dockerfiles/destination/conf/elasticsearch.properties b/dockerfiles/run/spring/destination/conf/elasticsearch.properties
similarity index 100%
rename from dockerfiles/destination/conf/elasticsearch.properties
rename to dockerfiles/run/spring/destination/conf/elasticsearch.properties
diff --git a/dockerfiles/destination/conf/fetchmail.xml b/dockerfiles/run/spring/destination/conf/fetchmail.xml
similarity index 100%
rename from dockerfiles/destination/conf/fetchmail.xml
rename to dockerfiles/run/spring/destination/conf/fetchmail.xml
diff --git a/dockerfiles/destination/conf/imapserver.xml b/dockerfiles/run/spring/destination/conf/imapserver.xml
similarity index 100%
rename from dockerfiles/destination/conf/imapserver.xml
rename to dockerfiles/run/spring/destination/conf/imapserver.xml
diff --git a/dockerfiles/destination/conf/indexer.xml b/dockerfiles/run/spring/destination/conf/indexer.xml
similarity index 100%
rename from dockerfiles/destination/conf/indexer.xml
rename to dockerfiles/run/spring/destination/conf/indexer.xml
diff --git a/dockerfiles/destination/conf/james-database.properties b/dockerfiles/run/spring/destination/conf/james-database.properties
similarity index 100%
rename from dockerfiles/destination/conf/james-database.properties
rename to dockerfiles/run/spring/destination/conf/james-database.properties
diff --git a/dockerfiles/destination/conf/jcr-repository.xml b/dockerfiles/run/spring/destination/conf/jcr-repository.xml
similarity index 100%
rename from dockerfiles/destination/conf/jcr-repository.xml
rename to dockerfiles/run/spring/destination/conf/jcr-repository.xml
diff --git a/dockerfiles/destination/conf/jmx.properties b/dockerfiles/run/spring/destination/conf/jmx.properties
similarity index 100%
rename from dockerfiles/destination/conf/jmx.properties
rename to dockerfiles/run/spring/destination/conf/jmx.properties
diff --git a/dockerfiles/destination/conf/lib/README.txt b/dockerfiles/run/spring/destination/conf/lib/README.txt
similarity index 100%
rename from dockerfiles/destination/conf/lib/README.txt
rename to dockerfiles/run/spring/destination/conf/lib/README.txt
diff --git a/dockerfiles/destination/conf/lmtpserver.xml b/dockerfiles/run/spring/destination/conf/lmtpserver.xml
similarity index 100%
rename from dockerfiles/destination/conf/lmtpserver.xml
rename to dockerfiles/run/spring/destination/conf/lmtpserver.xml
diff --git a/dockerfiles/destination/conf/log4j.properties b/dockerfiles/run/spring/destination/conf/log4j.properties
similarity index 100%
rename from dockerfiles/destination/conf/log4j.properties
rename to dockerfiles/run/spring/destination/conf/log4j.properties
diff --git a/dockerfiles/destination/conf/mailbox.xml b/dockerfiles/run/spring/destination/conf/mailbox.xml
similarity index 100%
rename from dockerfiles/destination/conf/mailbox.xml
rename to dockerfiles/run/spring/destination/conf/mailbox.xml
diff --git a/dockerfiles/destination/conf/mailetcontainer.xml b/dockerfiles/run/spring/destination/conf/mailetcontainer.xml
similarity index 100%
rename from dockerfiles/destination/conf/mailetcontainer.xml
rename to dockerfiles/run/spring/destination/conf/mailetcontainer.xml
diff --git a/dockerfiles/destination/conf/mailrepositorystore.xml b/dockerfiles/run/spring/destination/conf/mailrepositorystore.xml
similarity index 100%
rename from dockerfiles/destination/conf/mailrepositorystore.xml
rename to dockerfiles/run/spring/destination/conf/mailrepositorystore.xml
diff --git a/dockerfiles/destination/conf/managesieve.help.txt b/dockerfiles/run/spring/destination/conf/managesieve.help.txt
similarity index 100%
rename from dockerfiles/destination/conf/managesieve.help.txt
rename to dockerfiles/run/spring/destination/conf/managesieve.help.txt
diff --git a/dockerfiles/destination/conf/pop3server.xml b/dockerfiles/run/spring/destination/conf/pop3server.xml
similarity index 100%
rename from dockerfiles/destination/conf/pop3server.xml
rename to dockerfiles/run/spring/destination/conf/pop3server.xml
diff --git a/dockerfiles/destination/conf/quota.xml b/dockerfiles/run/spring/destination/conf/quota.xml
similarity index 100%
rename from dockerfiles/destination/conf/quota.xml
rename to dockerfiles/run/spring/destination/conf/quota.xml
diff --git a/dockerfiles/destination/conf/recipientrewritetable.xml b/dockerfiles/run/spring/destination/conf/recipientrewritetable.xml
similarity index 100%
rename from dockerfiles/destination/conf/recipientrewritetable.xml
rename to dockerfiles/run/spring/destination/conf/recipientrewritetable.xml
diff --git a/dockerfiles/destination/conf/smtpserver.xml b/dockerfiles/run/spring/destination/conf/smtpserver.xml
similarity index 100%
rename from dockerfiles/destination/conf/smtpserver.xml
rename to dockerfiles/run/spring/destination/conf/smtpserver.xml
diff --git a/dockerfiles/destination/conf/sqlResources.xml b/dockerfiles/run/spring/destination/conf/sqlResources.xml
similarity index 100%
rename from dockerfiles/destination/conf/sqlResources.xml
rename to dockerfiles/run/spring/destination/conf/sqlResources.xml
diff --git a/dockerfiles/destination/conf/usersrepository.xml b/dockerfiles/run/spring/destination/conf/usersrepository.xml
similarity index 100%
rename from dockerfiles/destination/conf/usersrepository.xml
rename to dockerfiles/run/spring/destination/conf/usersrepository.xml
diff --git a/dockerfiles/destination/var/.gitignore b/dockerfiles/run/spring/destination/var/.gitignore
similarity index 100%
rename from dockerfiles/destination/var/.gitignore
rename to dockerfiles/run/spring/destination/var/.gitignore
From 4f9277f45e72f382e3a7545322b08be2fc5246ea Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Wed, 28 Oct 2015 13:52:59 +0100
Subject: [PATCH 27/39] JAMES-1626 bundle cli into a runnable jar
---
server/container/cli/pom.xml | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/server/container/cli/pom.xml b/server/container/cli/pom.xml
index 68bda12bc2d..479e6e1b89c 100644
--- a/server/container/cli/pom.xml
+++ b/server/container/cli/pom.xml
@@ -93,6 +93,36 @@
maven-bundle-plugintrue
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ copy-dependencies
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/${project.build.finalName}.lib
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ true
+ ${project.build.finalName}.lib/
+ org.apache.james.cli.ServerCmd
+ false
+
+
+
+
From cc2c320e6c0c8bbbdef7985f9bb2f58659074bf4 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Wed, 28 Oct 2015 11:55:57 +0100
Subject: [PATCH 28/39] JAMES-1626 cassandra-guice docker support
---
README.txt | 11 +-
dockerfiles/compilation/java-8/compile.sh | 4 +
dockerfiles/run/guice/Dockerfile | 27 +
.../conf/META-INF/jpa-mappings-template.xml | 40 +
.../conf/META-INF/persistence-template.xml | 80 ++
.../destination/conf/META-INF/persistence.xml | 47 +
.../destination/conf/cassandra.properties | 6 +
.../run/guice/destination/conf/dnsservice.xml | 29 +
.../run/guice/destination/conf/domainlist.xml | 28 +
.../destination/conf/elasticsearch.properties | 26 +
.../run/guice/destination/conf/fetchmail.xml | 288 ++++++
.../run/guice/destination/conf/imapserver.xml | 54 +
.../run/guice/destination/conf/indexer.xml | 23 +
.../conf/james-database.properties | 40 +
.../guice/destination/conf/jcr-repository.xml | 72 ++
.../run/guice/destination/conf/jmx.properties | 28 +
.../run/guice/destination/conf/lib/README.txt | 1 +
.../run/guice/destination/conf/lmtpserver.xml | 41 +
.../guice/destination/conf/log4j.properties | 137 +++
.../destination/conf/mailetcontainer.xml | 165 ++++
.../destination/conf/mailrepositorystore.xml | 34 +
.../destination/conf/managesieve.help.txt | 112 +++
.../run/guice/destination/conf/pop3server.xml | 42 +
.../run/guice/destination/conf/quota.xml | 53 +
.../conf/recipientrewritetable.xml | 26 +
.../run/guice/destination/conf/smtpserver.xml | 105 ++
.../guice/destination/conf/sqlResources.xml | 931 ++++++++++++++++++
.../destination/conf/usersrepository.xml | 25 +
28 files changed, 2474 insertions(+), 1 deletion(-)
create mode 100644 dockerfiles/run/guice/Dockerfile
create mode 100644 dockerfiles/run/guice/destination/conf/META-INF/jpa-mappings-template.xml
create mode 100644 dockerfiles/run/guice/destination/conf/META-INF/persistence-template.xml
create mode 100644 dockerfiles/run/guice/destination/conf/META-INF/persistence.xml
create mode 100644 dockerfiles/run/guice/destination/conf/cassandra.properties
create mode 100644 dockerfiles/run/guice/destination/conf/dnsservice.xml
create mode 100644 dockerfiles/run/guice/destination/conf/domainlist.xml
create mode 100644 dockerfiles/run/guice/destination/conf/elasticsearch.properties
create mode 100644 dockerfiles/run/guice/destination/conf/fetchmail.xml
create mode 100644 dockerfiles/run/guice/destination/conf/imapserver.xml
create mode 100644 dockerfiles/run/guice/destination/conf/indexer.xml
create mode 100644 dockerfiles/run/guice/destination/conf/james-database.properties
create mode 100644 dockerfiles/run/guice/destination/conf/jcr-repository.xml
create mode 100644 dockerfiles/run/guice/destination/conf/jmx.properties
create mode 100644 dockerfiles/run/guice/destination/conf/lib/README.txt
create mode 100644 dockerfiles/run/guice/destination/conf/lmtpserver.xml
create mode 100644 dockerfiles/run/guice/destination/conf/log4j.properties
create mode 100644 dockerfiles/run/guice/destination/conf/mailetcontainer.xml
create mode 100644 dockerfiles/run/guice/destination/conf/mailrepositorystore.xml
create mode 100644 dockerfiles/run/guice/destination/conf/managesieve.help.txt
create mode 100644 dockerfiles/run/guice/destination/conf/pop3server.xml
create mode 100644 dockerfiles/run/guice/destination/conf/quota.xml
create mode 100644 dockerfiles/run/guice/destination/conf/recipientrewritetable.xml
create mode 100644 dockerfiles/run/guice/destination/conf/smtpserver.xml
create mode 100644 dockerfiles/run/guice/destination/conf/sqlResources.xml
create mode 100644 dockerfiles/run/guice/destination/conf/usersrepository.xml
diff --git a/README.txt b/README.txt
index 33935ea89b6..5bdedabefad 100644
--- a/README.txt
+++ b/README.txt
@@ -68,7 +68,6 @@ as it is needed by the container that will run James.
- SHA1 (optional): is the given git SHA1 of the james-project repository to build or trunk if none.
- -s option: given tests will not be played while building. Not specifying means play tests.
-
* Java 8
First step, you have to build the Docker image
$ docker build -t james/project dockerfiles/compilation/java-8
@@ -160,6 +159,16 @@ Where :
Beware : you will have concurrency issues if multiple containers are running on this single volume.
+How to run James in Docker using guice container
+================================================
+
+You have to follow above documentation and replace spring by guice in paths.
+
+Once you run the container, you have to use the following command to launch the cli :
+
+$ docker exec james_run java -jar /root/james-cli.jar -h localhost
+
+
Running deployement Tests
=========================
diff --git a/dockerfiles/compilation/java-8/compile.sh b/dockerfiles/compilation/java-8/compile.sh
index b95a88af585..0e68d1bb6a4 100755
--- a/dockerfiles/compilation/java-8/compile.sh
+++ b/dockerfiles/compilation/java-8/compile.sh
@@ -53,4 +53,8 @@ fi
if [ $? -eq 0 ]; then
cp server/app/target/james-server-app-*-app.zip $DESTINATION
+ cp server/container/cassandra-guice/target/james-server-cassandra-guice-*-SNAPSHOT.jar $DESTINATION
+ cp -r server/container/cassandra-guice/target/james-server-cassandra-guice-*-SNAPSHOT.lib $DESTINATION
+ cp server/container/cli/target/james-server-cli-*.jar $DESTINATION
+ cp -r server/container/cli/target/james-server-cli-*.lib $DESTINATION
fi
diff --git a/dockerfiles/run/guice/Dockerfile b/dockerfiles/run/guice/Dockerfile
new file mode 100644
index 00000000000..cd03111d340
--- /dev/null
+++ b/dockerfiles/run/guice/Dockerfile
@@ -0,0 +1,27 @@
+# Run James
+#
+# VERSION 1.0
+
+FROM java:openjdk-8-jdk
+
+# Ports that are used
+#
+# 25 SMTP without authentication
+# 110 POP3
+# 143 IMAP with startTLS enabled
+# 465 SMTP with authentication and socketTLS enabled
+# 587 SMTP with authentication and startTLS enabled
+# 993 IMAP with socketTLS enabled
+
+EXPOSE 25 110 143 465 587 993
+
+WORKDIR /root
+
+# Get data we need to run James : build results and configuration
+ADD destination/james-server-cassandra-guice-*.jar /root/james-server.jar
+ADD destination/james-server-cassandra-guice-3.0.0-beta5-SNAPSHOT.lib /root/james-server-cassandra-guice-3.0.0-beta5-SNAPSHOT.lib
+ADD destination/james-server-cli-3.0.0-beta5-SNAPSHOT.jar /root/james-cli.jar
+ADD destination/james-server-cli-3.0.0-beta5-SNAPSHOT.lib /root/james-server-cli-3.0.0-beta5-SNAPSHOT.lib
+ADD destination/conf /root/conf
+
+ENTRYPOINT java -Dworking.directory=/root/ -jar james-server.jar
diff --git a/dockerfiles/run/guice/destination/conf/META-INF/jpa-mappings-template.xml b/dockerfiles/run/guice/destination/conf/META-INF/jpa-mappings-template.xml
new file mode 100644
index 00000000000..fe76d25d0ac
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/META-INF/jpa-mappings-template.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/META-INF/persistence-template.xml b/dockerfiles/run/guice/destination/conf/META-INF/persistence-template.xml
new file mode 100644
index 00000000000..950e1ab6bbb
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/META-INF/persistence-template.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+ META-INF/jpa-mappings-template.xml
+
+
+ org.apache.james.mailbox.jpa.mail.model.JPAMailbox
+ org.apache.james.mailbox.jpa.mail.model.JPAUserFlag
+ org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
+
+
+
+
+ org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage
+
+ org.apache.james.mailbox.jpa.mail.model.JPAProperty
+ org.apache.james.mailbox.jpa.user.model.JPASubscription
+
+
+ org.apache.james.domainlist.jpa.model.JPADomain
+
+
+ org.apache.james.user.jpa.model.JPAUser
+
+
+ org.apache.james.rrt.jpa.model.JPARecipientRewrite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/META-INF/persistence.xml b/dockerfiles/run/guice/destination/conf/META-INF/persistence.xml
new file mode 100644
index 00000000000..66462619c08
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/META-INF/persistence.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+ org.apache.james.mailbox.jpa.mail.model.JPAMailbox
+ org.apache.james.mailbox.jpa.mail.model.JPAUserFlag
+ org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
+ org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage
+ org.apache.james.mailbox.jpa.mail.model.JPAProperty
+ org.apache.james.mailbox.jpa.user.model.JPASubscription
+ org.apache.james.domainlist.jpa.model.JPADomain
+ org.apache.james.user.jpa.model.JPAUser
+ org.apache.james.rrt.jpa.model.JPARecipientRewrite
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/cassandra.properties b/dockerfiles/run/guice/destination/conf/cassandra.properties
new file mode 100644
index 00000000000..c6a7342fcfa
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/cassandra.properties
@@ -0,0 +1,6 @@
+# Configuration file for cassandra mailbox
+
+cassandra.ip=cassandra
+cassandra.port=9042
+cassandra.keyspace=apache_james
+cassandra.replication.factor=1
\ No newline at end of file
diff --git a/dockerfiles/run/guice/destination/conf/dnsservice.xml b/dockerfiles/run/guice/destination/conf/dnsservice.xml
new file mode 100644
index 00000000000..0978a00b899
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/dnsservice.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+ 8.8.8.8
+ 62.210.16.6
+
+ false
+ false
+ 50000
+
diff --git a/dockerfiles/run/guice/destination/conf/domainlist.xml b/dockerfiles/run/guice/destination/conf/domainlist.xml
new file mode 100644
index 00000000000..fc64fd214a1
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/domainlist.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ james.linagora.com
+
+ true
+ true
+ localhost
+
diff --git a/dockerfiles/run/guice/destination/conf/elasticsearch.properties b/dockerfiles/run/guice/destination/conf/elasticsearch.properties
new file mode 100644
index 00000000000..2eec9530711
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/elasticsearch.properties
@@ -0,0 +1,26 @@
+# 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
+
+# Configuration file for ElasticSearch
+
+elasticsearch.masterHost=elasticsearch
+elasticsearch.port=9300
+elasticsearch.nb.shards=1
+elasticsearch.nb.replica=0
diff --git a/dockerfiles/run/guice/destination/conf/fetchmail.xml b/dockerfiles/run/guice/destination/conf/fetchmail.xml
new file mode 100644
index 00000000000..96aa9460fc4
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/fetchmail.xml
@@ -0,0 +1,288 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+ fetchmail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pop.server.com
+
+
+ 600000
+
+
+
+ pop3
+
+
+ INBOX
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ wibble@localhost, flobble@localhost
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/imapserver.xml b/dockerfiles/run/guice/destination/conf/imapserver.xml
new file mode 100644
index 00000000000..8ccb1179c9a
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/imapserver.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+ imapserver
+ 0.0.0.0:143
+ 200
+
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ 0
+ 0
+
+
+ imapserver-ssl
+ 0.0.0.0:993
+ 200
+
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ 0
+ 0
+
+
diff --git a/dockerfiles/run/guice/destination/conf/indexer.xml b/dockerfiles/run/guice/destination/conf/indexer.xml
new file mode 100644
index 00000000000..ced1a62274e
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/indexer.xml
@@ -0,0 +1,23 @@
+
+
+
+
+ elasticsearch
+
diff --git a/dockerfiles/run/guice/destination/conf/james-database.properties b/dockerfiles/run/guice/destination/conf/james-database.properties
new file mode 100644
index 00000000000..b3ac7ebc6e5
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/james-database.properties
@@ -0,0 +1,40 @@
+# 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
+
+# Use derby as default
+database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
+database.url=jdbc:derby:../var/store/derby;create=true
+database.username=app
+database.password=app
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
+vendorAdapter.database=DERBY
+
+# Use streaming for Blobs
+# This is only supported on a limited set of databases atm. You should check if its supported by your DB before enable
+# it.
+#
+# See:
+# http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html #7.11. LOB Streaming
+#
+openjpa.streaming=false
\ No newline at end of file
diff --git a/dockerfiles/run/guice/destination/conf/jcr-repository.xml b/dockerfiles/run/guice/destination/conf/jcr-repository.xml
new file mode 100644
index 00000000000..c1b998a75f7
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/jcr-repository.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/jmx.properties b/dockerfiles/run/guice/destination/conf/jmx.properties
new file mode 100644
index 00000000000..a1dbdf8924b
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/jmx.properties
@@ -0,0 +1,28 @@
+# 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
+
+# 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
+
+jmx.address=127.0.0.1
+jmx.port=9999
diff --git a/dockerfiles/run/guice/destination/conf/lib/README.txt b/dockerfiles/run/guice/destination/conf/lib/README.txt
new file mode 100644
index 00000000000..d536d44b732
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/lib/README.txt
@@ -0,0 +1 @@
+# Put every jar you want to have included in the classpath in here
\ No newline at end of file
diff --git a/dockerfiles/run/guice/destination/conf/lmtpserver.xml b/dockerfiles/run/guice/destination/conf/lmtpserver.xml
new file mode 100644
index 00000000000..ce079b0e4d1
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/lmtpserver.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ lmtpserver
+
+ 127.0.0.1:24
+ 200
+ 1200
+
+ 0
+
+ 0
+
+
+ 0
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/log4j.properties b/dockerfiles/run/guice/destination/conf/log4j.properties
new file mode 100644
index 00000000000..cdcfbd866ac
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/log4j.properties
@@ -0,0 +1,137 @@
+# 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.
+
+# 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=%-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.jackrabbit=ERROR, CONS, FILE
+
+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=DEBUG, CONS, FILE
+
+log4j.logger.james=WARN, CONS, FILE
+log4j.logger=DEBUG, CONS, FILE
+
+log4j.logger.james.mailboxmanager=DEBUG, MAILBOXMANAGER
+log4j.logger.james.imapserver=DEBUG, IMAPSERVER
+log4j.logger.james.mailetcontainer=DEBUG, MAILETCONTAINER
+log4j.logger.james.mailetcontext=DEBUG, MAILETCONTAINER
+log4j.logger.james.mailspooler=DEBUG, MAILETCONTAINER
+log4j.logger.james.mailprocessor=DEBUG, MAILETCONTAINER
+log4j.logger.james.dnsservice=DEBUG, DNSSERVICE
+log4j.logger.james.pop3server=DEBUG, POP3SERVER
+log4j.logger.james.smtpserver=DEBUG, SMTPSERVER
+log4j.logger.james.lmtpserver=DEBUG, LMTPSERVER
+log4j.logger.james.mailrepositorystore=DEBUG, MAILREPOSITORYSTORE
+log4j.logger.james.usersrepository=DEBUG, USERSREPOSITORY
+log4j.logger.james.fetchmail=DEBUG, FETCHMAIL
+log4j.logger.james.domainlist=DEBUG, DOMAINLIST
+log4j.logger.james.virtualusertable=DEBUG, VIRTUALUSERTABLE
+log4j.logger.james.mailqueuefactory=DEBUG, MAILQUEUEFACTORY
+log4j.logger.etm.core.monitor.EtmMonitor= DEBUG, CONS, FILE
diff --git a/dockerfiles/run/guice/destination/conf/mailetcontainer.xml b/dockerfiles/run/guice/destination/conf/mailetcontainer.xml
new file mode 100644
index 00000000000..678c344e5e7
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/mailetcontainer.xml
@@ -0,0 +1,165 @@
+
+
+
+
+
+
+
+ postmaster@james.minet.net
+
+
+
+ 20
+
+
+
+
+
+
+
+
+ sieve-manager-check
+
+
+ transport
+
+
+ true
+
+
+ transport
+
+
+ transport
+
+
+
+
+
+
+ spam
+ 550 Requested action not taken: rejected - see http://njabl.org/
+
+
+ transport
+
+
+
+
+
+
+ file://var/mail/error/
+
+
+
+
+
+
+ X-UserIsAuth
+ true
+
+
+ X-WasSigned
+ true
+
+
+
+
+ local-address-error
+ 550 - Requested action not taken: no such user here
+
+
+ outgoing
+ 5000, 100000, 500000
+ 25
+ 0
+ 10
+ true
+ bounces
+
+
+ relay-denied
+
+
+
+
+
+ file://var/mail/spam/
+
+
+
+
+
+ none
+
+
+ file://var/mail/address-error/
+
+
+
+
+
+ none
+
+
+ file://var/mail/relay-denied/
+ Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation
+
+
+
+
+
+ false
+
+
+
+
+
+
+ sieve-manager
+
+
+
+ heads
+ none
+ false
+ [REJECTED]
+
+ You can't send messages to configure SIEVE on this serveur unless you are the official SIEVE manager.
+
+
+
+
+
+
+
+ true
+
+
+ file:/root/james-server-app-3.0.0-beta5-SNAPSHOT/conf/managesieve.help.txt
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/mailrepositorystore.xml b/dockerfiles/run/guice/destination/conf/mailrepositorystore.xml
new file mode 100644
index 00000000000..acca810221d
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/mailrepositorystore.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+ file
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/managesieve.help.txt b/dockerfiles/run/guice/destination/conf/managesieve.help.txt
new file mode 100644
index 00000000000..f45c78dba7c
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/managesieve.help.txt
@@ -0,0 +1,112 @@
+managesieve implements the commands defined by RFC 5804 ((http://tools.ietf.org/html/rfc5804) to manage sieve scripts via mail messages. A mail is sent to the managesieve user with the command and parameters in the subject header. Sieve scripts are exchanged as mail attachments.
+
+Consult your mail administrator for the name of the managesieve user configured for your installation.
+
+Users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP commands (see note (1) below).
+
+Commands are executed and answered within the namespace of the sending user as denoted by the sender header of the mail. Thus, a command such as LISTSCRIPTS lists the scripts within namespace of the user identified by the sender header.
+
+The supported commands are summarised in "Command Summary" below. Generally the responses are self describing. For full details see RFC 5804 - Commands (http://tools.ietf.org/html/rfc5804#section-2).
+
+In these descriptions the following keywords apply:
+
+- sieve-name
+ The name of a sieve script enclosed in parentheses, eg: "my script". An empty name is not allowed.
+- active-sieve-name
+ As sieve-name, except an empty name, eg: "", is allowed.
+- old-sieve-name
+ As sieve-name
+- new-sieve-name
+ As sieve-name
+- sieve-script
+ A mail attachment recognised as a sieve script. This is the first attachment in a mail satisfying any of these characteristics:
+ - A MIME type of "application/sieve"
+ - A filename with the suffix ".sieve"
+ - A filename with the suffix ".siv"
+ Returned sieve-scripts always have the MIME type of "application/sieve"
+
+Command Summary
+---------------
+
+CAPABILITY
+ Subject:
+ CAPABILITY
+ Attachments:
+ none
+Answers the capabilities of the underlying sieve inplementation.
+
+CHECKSCRIPT
+ Subject:
+ CHECKSCRIPT
+ Attachments:
+ sieve-script
+Verifies the attached sieve-script without storing it on the server.
+
+DELETESCRIPT
+ Subject:
+ DELETESCRIPT sieve-name
+ Attachments:
+ none
+Deletes the named sieve script.
+
+GETACTIVE
+ Subject:
+ GETACTIVE
+ Attachments:
+ none
+Answers the active sieve script as an attachment.
+
+GETSCRIPT
+ Subject:
+ GETSCRIPT sieve-name
+ Attachments:
+ none
+Answers the named sieve script as an attachment.
+
+HAVESPACE
+ Subject:
+ HAVESPACE sieve-name number
+ Attachments:
+ none
+Answers OK if there is available space to store a script with the given name of the given size, else NO.
+
+HELP
+ Subject:
+ HELP
+ Attachments:
+ none
+Answers this text.
+
+LISTSCRIPTS
+ Subject:
+ LISTSCRIPTS
+ Attachments:
+ none
+Answers a list of the sieve scripts stored on the server, indicating which, if any, is the active script.
+
+PUTSCRIPT
+ Subject:
+ PUTSCRIPT sieve-name
+ Attachments:
+ sieve-script
+Verifies the attached sieve-script and if there are no errors stores it on the server using the given name.
+
+RENAMESCRIPT
+ Subject:
+ RENAMESCRIPT old-sieve-name new-sieve-name
+ Attachments:
+ none
+Renames the script stored on the server named old-sieve-name to new-sieve-name.
+
+SETACTIVE
+ Subject:
+ SETACTIVE active-sieve-name
+ Attachments:
+ none
+Sets the active script on the server to the given name. Use an empty string, "", to deactivate all scripts.
+
+Notes
+-----
+1) Some mail servers optionally allow configurations that enable local clients to post without SMTP authentication, such configurations will fail as managesieve requires SMTP authentication in all circumstances. To repeat, users MUST be SMTP authenticated to execute all except the CAPABILITY and HELP commands.
+
+
diff --git a/dockerfiles/run/guice/destination/conf/pop3server.xml b/dockerfiles/run/guice/destination/conf/pop3server.xml
new file mode 100644
index 00000000000..df8fbef9ea8
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/pop3server.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+ pop3server
+ 0.0.0.0:110
+ 200
+
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+
+ 1200
+ 0
+ 0
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/quota.xml b/dockerfiles/run/guice/destination/conf/quota.xml
new file mode 100644
index 00000000000..70162e0d4fd
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/quota.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+ default
+
+
+ cassandra
+
+
+ cassandra
+
+
+ store
+
+
+ event
+
+
diff --git a/dockerfiles/run/guice/destination/conf/recipientrewritetable.xml b/dockerfiles/run/guice/destination/conf/recipientrewritetable.xml
new file mode 100644
index 00000000000..fde339bd5c3
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/recipientrewritetable.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ true
+ 10
+
+
diff --git a/dockerfiles/run/guice/destination/conf/smtpserver.xml b/dockerfiles/run/guice/destination/conf/smtpserver.xml
new file mode 100644
index 00000000000..bc609bee0f7
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/smtpserver.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ smtpserver-global
+ 0.0.0.0:25
+ 200
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+ SunX509
+
+ 360
+ 0
+ 0
+ false
+ 0.0.0.0/0
+ true
+ 0
+ true
+ JAMES Linagora's SMTP awesome Server
+
+
+
+
+
+
+ smtpserver-TLS
+ 0.0.0.0:465
+ 200
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+ SunX509
+
+ 360
+ 0
+ 0
+
+ true
+ 0.0.0.0/0
+
+ false
+ 0
+ true
+ JAMES Linagora's SMTP awesome Server
+
+
+
+
+
+
+ smtpserver-authenticated
+ 0.0.0.0:587
+ 200
+
+ file://conf/keystore
+ james72laBalle
+ org.bouncycastle.jce.provider.BouncyCastleProvider
+ SunX509
+
+ 360
+ 0
+ 0
+
+ true
+ 0.0.0.0/0
+
+ false
+ 0
+ true
+ JAMES Linagora's SMTP awesome Server
+
+
+
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/sqlResources.xml b/dockerfiles/run/guice/destination/conf/sqlResources.xml
new file mode 100644
index 00000000000..82cfa2605b1
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/sqlResources.xml
@@ -0,0 +1,931 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${table}
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ ORDER BY username
+
+
+
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ WHERE lower(username) = ?
+
+
+
+ SELECT username, pwdHash, pwdAlgorithm, useForwarding,
+ forwardDestination, useAlias, alias
+ FROM ${table}
+ WHERE username = ?
+
+
+
+ INSERT INTO ${table}
+ (username, pwdHash, pwdAlgorithm, useForwarding, forwardDestination, useAlias, alias)
+ VALUES (?,?,?,?,?,?,?)
+
+
+
+ UPDATE ${table} SET
+ pwdHash = ?, pwdAlgorithm = ?, useForwarding = ?, forwardDestination = ?, useAlias = ?, alias = ?
+ WHERE username = ?
+
+
+
+ DELETE FROM ${table} WHERE username = ?
+
+
+ CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding INTEGER, forwardDestination VARCHAR(255), useAlias INTEGER, alias VARCHAR(255), PRIMARY KEY(username))
+ CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), useForwarding SMALLINT, forwardDestination VARCHAR(255), useAlias SMALLINT, alias VARCHAR(255), PRIMARY KEY(username))
+
+
+
+
+ ${table}
+
+
+ SELECT username, pwdHash, pwdAlgorithm
+ FROM ${table}
+
+
+
+ INSERT INTO ${table}
+ (username, pwdHash, pwdAlgorithm)
+ VALUES (?,?,?)
+
+
+
+ UPDATE ${table} SET
+ pwdHash = ?, pwdAlgorithm = ?
+ WHERE username = ?
+
+
+
+ DELETE FROM ${table} WHERE username = ?
+
+
+ CREATE CACHED TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))
+ CREATE TABLE ${table} (username VARCHAR(64) NOT NULL, pwdHash VARCHAR(50), pwdAlgorithm VARCHAR(20), PRIMARY KEY(username))
+
+
+
+
+
+
+ ${table}
+
+
+ SELECT listSubscriber
+ FROM ${table}
+ WHERE listName = '${key}'
+
+
+
+ INSERT INTO ${table}
+ (listSubscriber, listName)
+ VALUES (?, '${key}')
+
+
+
+ UPDATE ${table} SET
+ listSubscriber = ?
+ WHERE listSubscriber = ? AND listName = '${key}'
+
+
+
+ DELETE FROM ${table}
+ WHERE listSubscriber = ? AND listName = '${key}'
+
+
+
+ CREATE CACHED TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))
+ CREATE TABLE ${table} (listName VARCHAR(64) NOT NULL, listSubscriber VARCHAR(255) NOT NULL, PRIMARY KEY(listName, listSubscriber))
+
+
+
+
+
+ SELECT count(*) FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_state = ?, error_message = ?, sender = ?, recipients = ?, remote_host = ?, remote_addr = ?, last_updated = ? WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_body = ? WHERE message_name = ? AND repository_name = ?
+
+
+ UPDATE ${table} SET message_attributes = ? WHERE message_name = ? AND repository_name = ?
+
+
+ INSERT INTO ${table} (message_name,
+ repository_name, message_state, error_message, sender, recipients,
+ remote_host, remote_addr, last_updated, message_body,
+ message_attributes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
+
+
+ SELECT message_state, error_message, sender, recipients, remote_host, remote_addr, last_updated FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_body FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_attributes FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+
+ SELECT datalength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT dbms_lob.getlength(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+ SELECT length(message_body) FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ DELETE FROM ${table} WHERE message_name = ? AND repository_name = ?
+
+
+ SELECT message_name, message_state, last_updated FROM ${table} WHERE repository_name = ? ORDER BY last_updated ASC
+
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (100) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients text NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body longblob NOT NULL ,
+ message_attributes longblob NULL ,
+ last_updated datetime NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body varchar NOT NULL ,
+ message_attributes varchar NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body varchar NOT NULL ,
+ message_attributes varchar NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE [${table}] (
+ [message_name] [varchar] (200) NOT NULL,
+ [repository_name] [varchar] (255) NOT NULL,
+ [message_state] [varchar] (30) NOT NULL ,
+ [error_message] [varchar] (1000) NULL ,
+ [sender] [varchar] (255) NULL ,
+ [recipients] [text] NOT NULL ,
+ [remote_host] [varchar] (255) NOT NULL ,
+ [remote_addr] [varchar] (20) NOT NULL ,
+ [message_body] [image] NOT NULL ,
+ [message_attributes] [image] NULL ,
+ [last_updated] [datetime] NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar2(200) NOT NULL ,
+ repository_name varchar2(255) NOT NULL ,
+ message_state varchar2(30) NOT NULL ,
+ error_message varchar2(200) NULL ,
+ sender varchar2(255) ,
+ recipients varchar2(1000) NOT NULL ,
+ remote_host varchar2(100) NOT NULL ,
+ remote_addr varchar2(20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob NULL ,
+ last_updated date NOT NULL ,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (255) NULL ,
+ recipients text NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body bytea NOT NULL ,
+ message_attributes bytea NULL ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (200) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) NULL ,
+ sender varchar (200) NULL ,
+ recipients long NOT NULL ,
+ remote_host varchar (100) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body long byte NOT NULL ,
+ message_attributes long byte NULL ,
+ last_updated date NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar(200) NOT NULL ,
+ repository_name varchar(255) NOT NULL ,
+ message_state varchar(30) NOT NULL ,
+ error_message varchar(200) ,
+ sender varchar(255) ,
+ recipients varchar(1000) NOT NULL ,
+ remote_host varchar(100) NOT NULL ,
+ remote_addr varchar(20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob ,
+ last_updated timestamp NOT NULL ,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) ,
+ sender varchar (255) ,
+ recipients LONG VARCHAR NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body LONG BYTE NOT NULL ,
+ message_attributes LONG BYTE ,
+ last_updated DATE NOT NULL
+ )
+
+
+ CREATE TABLE ${table} (
+ message_name varchar (200) NOT NULL,
+ repository_name varchar (255) NOT NULL,
+ message_state varchar (30) NOT NULL ,
+ error_message varchar (200) ,
+ sender varchar (255) ,
+ recipients long varchar NOT NULL ,
+ remote_host varchar (255) NOT NULL ,
+ remote_addr varchar (20) NOT NULL ,
+ message_body blob NOT NULL ,
+ message_attributes blob ,
+ last_updated timestamp NOT NULL,
+ PRIMARY KEY (repository_name, message_name)
+ )
+
+
+
+
+
+ bayesiananalysis_ham
+ bayesiananalysis_spam
+ bayesiananalysis_messagecounts
+
+
+ SELECT HAMCOUNT, SPAMCOUNT FROM bayesiananalysis_messagecounts
+
+
+ INSERT INTO bayesiananalysis_messagecounts (HAMCOUNT, SPAMCOUNT) VALUES (0,0)
+
+
+ UPDATE bayesiananalysis_messagecounts SET HAMCOUNT=(HAMCOUNT + ?)
+
+
+ UPDATE bayesiananalysis_messagecounts SET SPAMCOUNT=(SPAMCOUNT + ?)
+
+
+ SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_ham
+
+
+ SELECT TOKEN, OCCURRENCES FROM bayesiananalysis_spam
+
+
+ INSERT INTO bayesiananalysis_ham (TOKEN, OCCURRENCES) VALUES (?,?)
+
+
+ INSERT INTO bayesiananalysis_spam (TOKEN, OCCURRENCES) VALUES (?,?)
+
+
+ UPDATE bayesiananalysis_ham SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)
+
+
+ UPDATE bayesiananalysis_spam SET OCCURRENCES=(OCCURRENCES + ?) WHERE (TOKEN=?)
+
+
+ DELETE FROM bayesiananalysis_ham
+
+
+ DELETE FROM bayesiananalysis_spam
+
+
+ DELETE FROM bayesiananalysis_messagecounts
+
+
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) binary NOT NULL default '',
+ occurrences int(11) NOT NULL default '0',
+ PRIMARY KEY (token)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_ham] (
+ [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
+ [occurrences] [int] NOT NULL default (0),
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) NOT NULL,
+ occurrences INTEGER NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_ham (
+ token varchar(128) NOT NULL,
+ occurrences int NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar(128) binary NOT NULL default '',
+ occurrences int(11) NOT NULL default '0',
+ PRIMARY KEY (token)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_spam] (
+ [token] [varchar] (128) COLLATE Latin1_General_CS_AS NOT NULL,
+ [occurrences] [int] NOT NULL default (0),
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar (128) NOT NULL,
+ occurrences INTEGER NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+ CREATE TABLE bayesiananalysis_spam (
+ token varchar (128) NOT NULL,
+ occurrences int NOT NULL default 0,
+ PRIMARY KEY (token)
+ )
+
+
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount int(11) NOT NULL default '0',
+ spamcount int(11) NOT NULL default '0'
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [bayesiananalysis_messagecounts] (
+ [hamcount] [int] NOT NULL default (0),
+ [spamcount] [int] NOT NULL default (0)
+ )
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount INTEGER NOT NULL default 0,
+ spamcount INTEGER NOT NULL default 0
+ )
+
+
+ CREATE TABLE bayesiananalysis_messagecounts (
+ hamcount int NOT NULL default 0,
+ spamcount int NOT NULL default 0
+ )
+
+
+
+
+
+ whitelist
+
+
+ SELECT localUser, localHost FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)
+
+
+ SELECT remoteUser, remoteHost FROM whitelist where (localUser=? AND localHost=?) ORDER BY remoteUser, remoteHost
+
+
+ INSERT INTO whitelist (localUser, localHost, remoteUser, remoteHost) VALUES (?,?,?,?)
+
+
+ DELETE FROM whitelist where (localUser=? AND localHost=? AND remoteUser=? AND remoteHost=?)
+
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) character set latin1 NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) character set latin1 NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [whitelist] (
+ [localUser] [varchar] (64) NOT NULL,
+ [localHost] [varchar] (255) NOT NULL,
+ [remoteUser] [varchar] (64) NOT NULL,
+ [remoteHost] [varchar] (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+ CREATE TABLE whitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ remoteUser varchar (64) NOT NULL,
+ remoteHost varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost, remoteUser, remoteHost)
+ )
+
+
+
+
+
+
+ networkWhitelist
+
+
+ SELECT network FROM networkWhitelist where (localUser=? AND localHost=?)
+
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL,
+ PRIMARY KEY (localUser, localHost)
+ )
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) character set latin1 NOT NULL,
+ network varchar (255) NOT NULL
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [networkWhitelist] (
+ [localUser] [varchar] (64) NOT NULL,
+ [localHost] [varchar] (255) NOT NULL,
+ [network] [varchar] (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+ CREATE TABLE networkWhitelist (
+ localUser varchar (64) NOT NULL,
+ localHost varchar (255) NOT NULL,
+ network varchar (255) NOT NULL
+ )
+
+
+
+
+
+
+ greylist
+
+
+ SELECT create_time,count FROM greylist WHERE ipaddress = ? AND sender = ? AND recip = ?
+
+
+ INSERT INTO greylist (ipaddress,sender,recip,count,create_time) values (?,?,?,?,?)
+
+
+ DELETE FROM greylist WHERE create_time < ? AND count = 0
+
+
+ DELETE FROM greylist WHERE create_time < ?
+
+
+ UPDATE greylist SET create_time = ? , count = ? WHERE ipaddress = ? AND sender = ? AND recip = ?
+
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE CACHED TABLE ${table} (
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamo NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ ) TYPE=InnoDB
+
+
+ CREATE TABLE [greylist] (
+ [ipaddress] [varchar] (20) NOT NULL,
+ [sender] [varchar] (255) NOT NULL,
+ [recip] [varchar] (255) NOT NULL,
+ [count] [int] NOT NULL,
+ [create_time] [datetime] NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar2(20) NOT NULL,
+ sender varchar2(255) NOT NULL,
+ recip varchar2(255) NOT NULL,
+ count int NOT NULL,
+ create_time datetime NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time date NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time date NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+ CREATE TABLE greylist (
+ ipaddress varchar (20) NOT NULL,
+ sender varchar (255) NOT NULL,
+ recip varchar (255) NOT NULL,
+ count int NOT NULL,
+ create_time timestamp NOT NULL,
+ PRIMARY KEY (ipaddress,sender,recip)
+ )
+
+
+
+
+
+
+ select RecipientRewriteTable.target_address,(RecipientRewriteTable."user" || '@' ||RecipientRewriteTable.domain) from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where ((RecipientRewriteTable."user") like ? or (RecipientRewriteTable."user") = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by 2 desc
+ select RecipientRewriteTable.target_address from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where (RecipientRewriteTable.user like ? or RecipientRewriteTable.user = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by concat(RecipientRewriteTable.user,'@',RecipientRewriteTable.domain) desc limit 1
+ select RecipientRewriteTable.target_address from RecipientRewriteTable, RecipientRewriteTable as VUTDomains where (RecipientRewriteTable.user like ? or RecipientRewriteTable.user = '*') and (RecipientRewriteTable.domain like ? or (RecipientRewriteTable.domain = '*')) order by (RecipientRewriteTable.user || '@' || RecipientRewriteTable.domain) desc limit 1
+
+ select RecipientRewriteTable.target_address from RecipientRewriteTable where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ?
+ select RecipientRewriteTable.target_address from RecipientRewriteTable where RecipientRewriteTable.user = ? and RecipientRewriteTable.domain = ?
+
+ delete from RecipientRewriteTable where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ? and RecipientRewriteTable.target_address = ?
+
+ update RecipientRewriteTable set RecipientRewriteTable.target_address = ? where RecipientRewriteTable."user" = ? and RecipientRewriteTable.domain = ?
+
+ insert into RecipientRewriteTable values(?,?,?)
+
+ select * from RecipientRewriteTable
+
+
+
+ CREATE TABLE RecipientRewriteTable (
+ user varchar(64) NOT NULL default '',
+ domain varchar(255) NOT NULL default '',
+ target_address varchar(255) NOT NULL default '',
+ PRIMARY KEY (user,domain)
+ )
+
+
+
+
+ CREATE TABLE RecipientRewriteTable (
+ "user" varchar(64) NOT NULL default '',
+ domain varchar(255) NOT NULL default '',
+ target_address varchar(255) NOT NULL default '',
+ PRIMARY KEY ("user",domain)
+ )
+
+
+ CREATE TABLE RecipientRewriteTable (
+ "user" varchar (64) NOT NULL default '',
+ domain varchar (255) NOT NULL default '',
+ target_address varchar (255) NOT NULL default '',
+ PRIMARY KEY ("user",domain)
+ )
+
+
+
+
+
diff --git a/dockerfiles/run/guice/destination/conf/usersrepository.xml b/dockerfiles/run/guice/destination/conf/usersrepository.xml
new file mode 100644
index 00000000000..85046b30835
--- /dev/null
+++ b/dockerfiles/run/guice/destination/conf/usersrepository.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ MD5
+ true
+
+
From e352f770ff5afe5361c3e5b39649e90762d178d2 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 14:59:40 +0100
Subject: [PATCH 29/39] fixup! JAMES-1626 Implement an
HierarchicalConfiguration reader for guice use
---
.../org/apache/james/utils/FileConfigurationProviderTest.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
index f4d07307269..15c0dc05da1 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
@@ -36,7 +36,6 @@ public class FileConfigurationProviderTest {
private static final String CONFIG_KEY_1 = "test2";
private static final String CONFIG_KEY_2 = "property";
- private static final String CONFIG_KEY_3 = "test2";
private static final String CONFIG_KEY_4 = "james";
private static final String CONFIG_KEY_5 = "internal";
private static final String VALUE_1 = "0";
@@ -64,7 +63,7 @@ public void getConfigurationShouldLoadCorrespondingXMLFile() throws Exception {
assertThat(Lists.newArrayList(hierarchicalConfiguration.getKeys())).containsOnly(CONFIG_KEY_1,
CONFIG_KEY_4 + CONFIG_SEPARATOR + CONFIG_KEY_2,
CONFIG_KEY_4 + CONFIG_SEPARATOR + CONFIG_KEY_5 + CONFIG_SEPARATOR + CONFIG_KEY_2);
- assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_3)).isEqualTo(VALUE_1);
+ assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_1)).isEqualTo(VALUE_1);
}
@Test
From 70372f9ef0d16842ea1d4b3363c903438fda6d08 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:16:37 +0100
Subject: [PATCH 30/39] fixup! JAMES-1626 Implement an
HierarchicalConfiguration reader for guice use
---
.../utils/FileConfigurationProvider.java | 14 +++---
.../utils/FileConfigurationProviderTest.java | 47 +++++++++++++------
2 files changed, 40 insertions(+), 21 deletions(-)
diff --git a/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java b/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java
index 75ad86bc3b4..b28a94a5dd2 100644
--- a/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java
+++ b/server/container/cassandra-guice/src/main/java/org/apache/james/utils/FileConfigurationProvider.java
@@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.Arrays;
import java.util.List;
import javax.inject.Inject;
@@ -35,7 +34,9 @@
import org.apache.james.modules.CommonServicesModule;
import com.google.common.base.Preconditions;
+import com.google.common.base.Splitter;
import com.google.common.base.Strings;
+import com.google.common.collect.Iterables;
import com.google.inject.Singleton;
@Singleton
@@ -44,8 +45,7 @@ public class FileConfigurationProvider implements ConfigurationProvider {
private static final String CONFIGURATION_FILE_SUFFIX = ".xml";
private final FileSystem fileSystem;
-
- private String configurationPrefix;
+ private final String configurationPrefix;
@Inject
public FileConfigurationProvider(FileSystem fileSystem, @Named(CommonServicesModule.CONFIGURATION_PATH) String configurationPrefix) throws MissingArgumentException {
@@ -55,9 +55,11 @@ public FileConfigurationProvider(FileSystem fileSystem, @Named(CommonServicesMod
@Override
public HierarchicalConfiguration getConfiguration(String component) throws ConfigurationException {
- List configPathParts = Arrays.asList(component.split("\\."));
+ Preconditions.checkNotNull(component);
+ List configPathParts = Splitter.on(".").splitToList(component);
+ Preconditions.checkArgument(!configPathParts.isEmpty());
HierarchicalConfiguration config = getConfig(retrieveConfigInputStream(configPathParts.get(0)));
- return selectHierarchicalConfigPart(config, configPathParts.subList(1, configPathParts.size()));
+ return selectHierarchicalConfigPart(config, Iterables.skip(configPathParts, 1));
}
private InputStream retrieveConfigInputStream(String configurationFileWithoutExtension) throws ConfigurationException {
@@ -77,7 +79,7 @@ private XMLConfiguration getConfig(InputStream configStream) throws Configuratio
return config;
}
- private HierarchicalConfiguration selectHierarchicalConfigPart(HierarchicalConfiguration config, List configsPathParts) {
+ private HierarchicalConfiguration selectHierarchicalConfigPart(HierarchicalConfiguration config, Iterable configsPathParts) {
HierarchicalConfiguration currentConfig = config;
for (String nextPathPart : configsPathParts) {
currentConfig = currentConfig.configurationAt(nextPathPart);
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
index 15c0dc05da1..4fe0360caae 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/FileConfigurationProviderTest.java
@@ -30,8 +30,6 @@
import org.junit.Before;
import org.junit.Test;
-import com.google.common.collect.Lists;
-
public class FileConfigurationProviderTest {
private static final String CONFIG_KEY_1 = "test2";
@@ -40,6 +38,7 @@ public class FileConfigurationProviderTest {
private static final String CONFIG_KEY_5 = "internal";
private static final String VALUE_1 = "0";
private static final String VALUE_2 = "awesome";
+ private static final String VALUE_3 = "james";
private static final String FAKE_CONFIG_KEY = "fake";
private static final String ROOT_CONFIG_KEY = "test";
private static final String CONFIG_SEPARATOR = ".";
@@ -52,6 +51,21 @@ public void setUp() throws MissingArgumentException {
configurationProvider = new FileConfigurationProvider(fileSystem, FileSystem.CLASSPATH_PROTOCOL);
}
+ @Test(expected = IllegalArgumentException.class)
+ public void emptyArgumentShouldThrow() throws Exception {
+ configurationProvider.getConfiguration("");
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void nullArgumentShouldThrow() throws Exception {
+ configurationProvider.getConfiguration(null);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void configSeparatorArgumentShouldThrow() throws Exception {
+ configurationProvider.getConfiguration(CONFIG_SEPARATOR);
+ }
+
@Test(expected = IllegalArgumentException.class)
public void emptyFileNameShouldThrow() throws Exception {
configurationProvider.getConfiguration(CONFIG_SEPARATOR + ROOT_CONFIG_KEY);
@@ -60,32 +74,35 @@ public void emptyFileNameShouldThrow() throws Exception {
@Test
public void getConfigurationShouldLoadCorrespondingXMLFile() throws Exception {
HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(ROOT_CONFIG_KEY);
- assertThat(Lists.newArrayList(hierarchicalConfiguration.getKeys())).containsOnly(CONFIG_KEY_1,
- CONFIG_KEY_4 + CONFIG_SEPARATOR + CONFIG_KEY_2,
- CONFIG_KEY_4 + CONFIG_SEPARATOR + CONFIG_KEY_5 + CONFIG_SEPARATOR + CONFIG_KEY_2);
+ assertThat(hierarchicalConfiguration.getKeys()).containsOnly(CONFIG_KEY_1,
+ String.join(CONFIG_SEPARATOR, CONFIG_KEY_4, CONFIG_KEY_2),
+ String.join(CONFIG_SEPARATOR, CONFIG_KEY_4, CONFIG_KEY_5, CONFIG_KEY_2));
assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_1)).isEqualTo(VALUE_1);
}
@Test
public void getConfigurationShouldLoadCorrespondingXMLFilePart() throws Exception {
- HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(ROOT_CONFIG_KEY + CONFIG_SEPARATOR + CONFIG_KEY_4);
- assertThat(Lists.newArrayList(hierarchicalConfiguration.getKeys())).containsOnly(CONFIG_KEY_2,
- "internal" + CONFIG_SEPARATOR + CONFIG_KEY_2);
+ HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(
+ String.join(CONFIG_SEPARATOR, ROOT_CONFIG_KEY, CONFIG_KEY_4));
+ assertThat(hierarchicalConfiguration.getKeys()).containsOnly(CONFIG_KEY_2,
+ String.join(CONFIG_SEPARATOR, CONFIG_KEY_5, CONFIG_KEY_2));
assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_2)).isEqualTo(VALUE_2);
}
@Test
public void getConfigurationShouldLoadCorrespondingXMLFileWhenAPathIsProvidedPart() throws Exception {
- HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(ROOT_CONFIG_KEY + CONFIG_SEPARATOR + CONFIG_KEY_4 + CONFIG_SEPARATOR + "internal");
- assertThat(Lists.newArrayList(hierarchicalConfiguration.getKeys())).containsOnly(CONFIG_KEY_2);
- assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_2)).isEqualTo("james");
+ HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(
+ String.join(CONFIG_SEPARATOR, ROOT_CONFIG_KEY, CONFIG_KEY_4, CONFIG_KEY_5));
+ assertThat(hierarchicalConfiguration.getKeys()).containsOnly(CONFIG_KEY_2);
+ assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_2)).isEqualTo(VALUE_3);
}
@Test
public void multiplesSeparatorsShouldBeTolerated() throws Exception {
- HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(ROOT_CONFIG_KEY + CONFIG_SEPARATOR + CONFIG_SEPARATOR + CONFIG_KEY_4);
- assertThat(Lists.newArrayList(hierarchicalConfiguration.getKeys())).containsOnly(CONFIG_KEY_2,
- "internal" + CONFIG_SEPARATOR + CONFIG_KEY_2);
+ HierarchicalConfiguration hierarchicalConfiguration = configurationProvider.getConfiguration(
+ ROOT_CONFIG_KEY + CONFIG_SEPARATOR + CONFIG_SEPARATOR + CONFIG_KEY_4);
+ assertThat(hierarchicalConfiguration.getKeys()).containsOnly(CONFIG_KEY_2,
+ String.join(CONFIG_SEPARATOR, CONFIG_KEY_5, CONFIG_KEY_2));
assertThat(hierarchicalConfiguration.getProperty(CONFIG_KEY_2)).isEqualTo(VALUE_2);
}
@@ -96,7 +113,7 @@ public void getConfigurationShouldThrowOnNonExistingXMLFile() throws Exception {
@Test(expected = IllegalArgumentException.class)
public void getConfigurationShouldThrowOnNonExistingXMLFilePart() throws Exception {
- configurationProvider.getConfiguration(ROOT_CONFIG_KEY + CONFIG_SEPARATOR + FAKE_CONFIG_KEY);
+ configurationProvider.getConfiguration(String.join(CONFIG_SEPARATOR, ROOT_CONFIG_KEY, FAKE_CONFIG_KEY));
}
}
From 694292c38ccb1b3e05d332a61f616aa8c05f009a Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:21:11 +0100
Subject: [PATCH 31/39] fixup! JAMES-1626 bootstrap guice-based application
with Cassandra IMAP server
---
.../java/org/apache/james/utils/PropertiesReadTest.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/PropertiesReadTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/PropertiesReadTest.java
index e3e33aa2420..1d3de346778 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/utils/PropertiesReadTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/utils/PropertiesReadTest.java
@@ -30,6 +30,12 @@ public void getPropertyShouldWork() throws Exception {
PropertiesReader propertiesReader = new PropertiesReader("test.properties");
assertThat(propertiesReader.getProperty("cassandra.ip")).isEqualTo("127.0.0.1");
}
+
+ @Test
+ public void getAbsentPropertyShouldReturnNull() throws Exception {
+ PropertiesReader propertiesReader = new PropertiesReader("test.properties");
+ assertThat(propertiesReader.getProperty("cassandra.isslow")).isNull();
+ }
@Test(expected = RuntimeException.class)
public void buildingAPropertiesReaderOnNonExistingValuesShouldThrow() throws Exception {
From b73fdd6cd6d939a69c41380a6526043a51ac81ac Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:24:56 +0100
Subject: [PATCH 32/39] fixup! JAMES-1626 sample configuration and readme
---
server/container/cassandra-guice/README.adoc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/server/container/cassandra-guice/README.adoc b/server/container/cassandra-guice/README.adoc
index 7b6698e180f..e3648fff971 100644
--- a/server/container/cassandra-guice/README.adoc
+++ b/server/container/cassandra-guice/README.adoc
@@ -29,6 +29,12 @@ To run james, you have to create a directory containing required configuration f
A sample directory (appropriately named sample-directory) is provided with some
default value you may need to replace.
+You also need to generate a keystore with the following command :
+[source]
+----
+$ keytool -genkey -alias james -keyalg RSA -keystore conf/keystore
+----
+
You need to have a Cassandra and an ElasticSearch instance running.
Once everything is set up, you just have to run the jar with :
From 3012e2e1fb900b28ff5adcdb9c034cee4fd0aaaa Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:26:31 +0100
Subject: [PATCH 33/39] fixup! JAMES-1626 Use javax.inject in Cassandra mailbox
---
.../cassandra/CassandraTypesProvider.java | 95 -------------------
1 file changed, 95 deletions(-)
delete mode 100644 mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTypesProvider.java
diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTypesProvider.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTypesProvider.java
deleted file mode 100644
index f2b4906f6f7..00000000000
--- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraTypesProvider.java
+++ /dev/null
@@ -1,95 +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. *
- ****************************************************************/
-
-package org.apache.james.mailbox.cassandra;
-
-import com.datastax.driver.core.Session;
-import com.datastax.driver.core.UserType;
-import com.datastax.driver.core.schemabuilder.CreateType;
-import com.datastax.driver.core.schemabuilder.SchemaBuilder;
-import com.google.common.collect.ImmutableMap;
-import org.apache.james.mailbox.cassandra.table.CassandraMailboxTable;
-import org.apache.james.mailbox.cassandra.table.CassandraMessageTable;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import java.util.Arrays;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import static com.datastax.driver.core.DataType.text;
-
-@Singleton
-public class CassandraTypesProvider {
-
- public enum TYPE {
- MailboxBase(CassandraMailboxTable.MAILBOX_BASE,
- SchemaBuilder.createType(CassandraMailboxTable.MAILBOX_BASE)
- .ifNotExists()
- .addColumn(CassandraMailboxTable.MailboxBase.NAMESPACE, text())
- .addColumn(CassandraMailboxTable.MailboxBase.USER, text())),
- Property(CassandraMessageTable.PROPERTIES,
- SchemaBuilder.createType(CassandraMessageTable.PROPERTIES)
- .ifNotExists()
- .addColumn(CassandraMessageTable.Properties.NAMESPACE, text())
- .addColumn(CassandraMessageTable.Properties.NAME, text())
- .addColumn(CassandraMessageTable.Properties.VALUE, text()))
- ;
-
- private final String name;
- private final CreateType createStatement;
-
- TYPE(String name, CreateType createStatement) {
- this.name = name;
- this.createStatement = createStatement;
- }
-
- public String getName() {
- return name;
- }
- }
-
- private final ImmutableMap userTypes;
- private final Session session;
-
- @Inject
- public CassandraTypesProvider(Session session) {
- this.session = session;
- initializeTypes();
- userTypes = ImmutableMap.builder()
- .putAll(Arrays.stream(TYPE.values())
- .collect(Collectors.toMap(
- (type) -> type,
- (type) -> session.getCluster()
- .getMetadata()
- .getKeyspace(session.getLoggedKeyspace())
- .getUserType(type.name)))).build();
- }
-
- public UserType getDefinedUserType(TYPE type) {
- return Optional.ofNullable(userTypes.get(type))
- .orElseThrow(() -> new RuntimeException("Cassandra UDT " + type.getName() + " can not be retrieved"));
- }
-
- public void initializeTypes() {
- Arrays.asList(TYPE.values())
- .forEach((type) -> session.execute(type.createStatement));
- }
-
-}
From 794b982547a613df2e961fab139c6855b806b49d Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:28:48 +0100
Subject: [PATCH 34/39] fixup! JAMES-1626 support IMAP, SMTP, POP and LMTP
protocols in cassandra-guice application
---
.../org/apache/james/CassandraJamesServerTest.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index e79894ee7f6..bdf656d2089 100644
--- a/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -90,31 +90,31 @@ public void tearDown() throws Exception {
}
@Test
- public void connectIMAPServerShouldThrowWhenNoCredentials() throws Exception {
+ public void connectIMAPServerShouldSendShabangOnConnect() throws Exception {
socketChannel.connect(new InetSocketAddress("127.0.0.1", IMAP_PORT));
assertThat(getServerConnectionResponse(socketChannel)).startsWith("* OK JAMES IMAP4rev1 Server");
}
@Test
- public void connectOnSecondaryIMAPServerIMAPServerShouldThrowWhenNoCredentials() throws Exception {
+ public void connectOnSecondaryIMAPServerIMAPServerShouldSendShabangOnConnect() throws Exception {
socketChannel.connect(new InetSocketAddress("127.0.0.1", IMAP_PORT_SSL));
assertThat(getServerConnectionResponse(socketChannel)).startsWith("* OK JAMES IMAP4rev1 Server");
}
@Test
- public void connectPOP3ServerShouldThrowWhenNoCredentials() throws Exception {
+ public void connectPOP3ServerShouldSendShabangOnConnect() throws Exception {
socketChannel.connect(new InetSocketAddress("127.0.0.1", POP3_PORT));
assertThat(getServerConnectionResponse(socketChannel)).contains("POP3 server (JAMES POP3 Server ) ready");
}
@Test
- public void connectSMTPServerShouldNotThrowWhenNoCredentials() throws Exception {
+ public void connectSMTPServerShouldSendShabangOnConnect() throws Exception {
socketChannel.connect(new InetSocketAddress("127.0.0.1", SMTP_PORT));
assertThat(getServerConnectionResponse(socketChannel)).startsWith("220 JAMES Linagora's SMTP awesome Server");
}
@Test
- public void connectLMTPServerShouldNotThrowWhenNoCredentials() throws Exception {
+ public void connectLMTPServerShouldSendShabangOnConnect() throws Exception {
socketChannel.connect(new InetSocketAddress("127.0.0.1", LMTP_PORT));
assertThat(getServerConnectionResponse(socketChannel)).contains("LMTP Server (JAMES Protocols Server) ready");
}
From 4d9f37a484eef64a43420033e3e7e3a898b0397c Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:44:08 +0100
Subject: [PATCH 35/39] fixup! JAMES-1626 Add JMX support to cassandra-guice
application
---
.../cli/src/main/java/org/apache/james/cli/ServerCmd.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java b/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
index b50df81b1f9..42d0f4a424c 100644
--- a/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
+++ b/server/container/cli/src/main/java/org/apache/james/cli/ServerCmd.java
@@ -103,7 +103,6 @@ public static void main(String[] args) {
failWithMessage("Error connecting to remote JMX agent : " + ioe.getMessage());
} catch (Exception e) {
failWithMessage("Error while executing command:" + e.getMessage());
- e.printStackTrace();
}
}
From e3ff938face93d63def99ff9c1b53d8d4feec38c Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:46:21 +0100
Subject: [PATCH 36/39] fixup! JAMES-1626 cassandra-guice project creation
---
server/container/cassandra-guice/pom.xml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/server/container/cassandra-guice/pom.xml b/server/container/cassandra-guice/pom.xml
index 88f52cad8ef..a0d2cb692e4 100644
--- a/server/container/cassandra-guice/pom.xml
+++ b/server/container/cassandra-guice/pom.xml
@@ -183,11 +183,6 @@
-
- com.google.guava
- guava
- 16.0
- ${project.groupId}apache-james-mailbox-cassandra
@@ -358,6 +353,10 @@
jackson-datatype-jdk82.4.3
+
+ com.google.guava
+ guava
+ com.google.injectguice
From 10652036692ec5ff46a28b01e0ed24495dc90e01 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 15:48:38 +0100
Subject: [PATCH 37/39] fixup! JAMES-1626 bootstrap guice-based application
with Cassandra IMAP server
---
server/container/cassandra-guice/pom.xml | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/server/container/cassandra-guice/pom.xml b/server/container/cassandra-guice/pom.xml
index a0d2cb692e4..e7ed82eb312 100644
--- a/server/container/cassandra-guice/pom.xml
+++ b/server/container/cassandra-guice/pom.xml
@@ -184,15 +184,14 @@
- ${project.groupId}
- apache-james-mailbox-cassandra
-
- org.apache.jamesapache-james-backends-cassandra
- ${apache-backends-cassandra.version}test-jar
-
+
+
+ ${project.groupId}
+ apache-james-mailbox-cassandra
+ ${project.groupId}apache-james-mailbox-cassandra
From ff9aa869b8603dfb0c8ebc6dfac962eeee38261b Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 16:47:47 +0100
Subject: [PATCH 38/39] fixup! JAMES-1626 Add configuration documentation
---
.../src/site/xdoc/quick-start-cassandra.xml | 21 +++++++------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/server/src/site/xdoc/quick-start-cassandra.xml b/server/src/site/xdoc/quick-start-cassandra.xml
index f68d586668a..ee8f8d8b40e 100644
--- a/server/src/site/xdoc/quick-start-cassandra.xml
+++ b/server/src/site/xdoc/quick-start-cassandra.xml
@@ -44,18 +44,14 @@ Step 1: Download
* Clone the James git repository
-$ git clone git://git.apache.org/james.git
-
- * Then go to the James folder
-
-$ cd james
+$ git clone git://git.apache.org/james-project.git
Step 3: Compile
###############
* Compile the Guice Cassandra project
-$ mvn package -DskipTests
+$ mvn package -DskipTests -am -pl server/container/cassandra-guice
Step 3: Deploy
##############
@@ -80,14 +76,14 @@ Copy your TSL keys to ./conf/keystore or generate it using :
$ keytool -genkey -alias james -keyalg RSA -keystore ./conf/keystore
-Configure your domain in the ./conf/domainlist.xml file.
+I will have to put the keystore password in the right xml files (imapserver.xml, pop3server.xml, smtpserver.xml)
Step 5: Start
#############
* Run James
-$ java -Dworking.directory=WORKING_PATH -jar container/cassandra-guice/target/james-server-cassandra-guice-beta5-SNAPSHOT.jar
+$ java -Dworking.directory=WORKING_PATH -jar server/container/cassandra-guice/target/james-server-cassandra-guice-beta5-SNAPSHOT.jar
Where :
- WORKING_PATH is the path where are located your configuration file folder.
@@ -97,13 +93,12 @@ Step 6: Create Domains and Users
Time to add domains and users.
-Give enough rights to the James CLI
-
-$ chmod 755 app/target/appassembler/bin/james-cli.sh
+$ java -jar server/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT.jar -h 127.0.0.1 -p 9999 adddomain DOMAIN
-$ ./app/target/appassembler/bin/james-cli.sh -h 127.0.0.1 -p 9999 adduser USER_MAIL_ADDRESSPASSWORD
+$ java -jar server/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT.jar -h 127.0.0.1 -p 9999 adduser USER_MAIL_ADDRESSPASSWORD
Where :
+- DOMAIN is the domain you want to handle with this server.
- USER_MAIL_ADDRESS is the mail address that will be used by this user.
- PASSWORD is the password that will be used by this user.
@@ -140,7 +135,7 @@ Step 8: Manage
8.1. Manage via james-cli
usage:
-$ docker exec james-cassandra /root/james-server-app-3.0.0-beta5-SNAPSHOT/bin/james-cli.sh -h 127.0.0.1 -p 9999
+$ java -jar server/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT.jar -h 127.0.0.1 -p 9999
Available commands:
adduser </username> </password>
From 7ec6d77d13edf89429f97492a0ca54f3287fee37 Mon Sep 17 00:00:00 2001
From: Matthieu Baechler
Date: Tue, 3 Nov 2015 17:12:05 +0100
Subject: [PATCH 39/39] fixup! JAMES-1626 Add configuration documentation
---
server/src/site/xdoc/quick-start-cassandra.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/src/site/xdoc/quick-start-cassandra.xml b/server/src/site/xdoc/quick-start-cassandra.xml
index ee8f8d8b40e..ae9cc5f5647 100644
--- a/server/src/site/xdoc/quick-start-cassandra.xml
+++ b/server/src/site/xdoc/quick-start-cassandra.xml
@@ -76,7 +76,7 @@ Copy your TSL keys to ./conf/keystore or generate it using :
$ keytool -genkey -alias james -keyalg RSA -keystore ./conf/keystore
-I will have to put the keystore password in the right xml files (imapserver.xml, pop3server.xml, smtpserver.xml)
+You will have to put the keystore password in the right xml files (imapserver.xml, pop3server.xml, smtpserver.xml)
Step 5: Start
#############