You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2018/06/18 09:41:01 UTC
[2/3] james-project git commit: JAMES-2416 Introduce jpa-smtp-mariaDB
guice product
JAMES-2416 Introduce jpa-smtp-mariaDB guice product
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/e8e9803a
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/e8e9803a
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/e8e9803a
Branch: refs/heads/master
Commit: e8e9803a585d1c02e0af3e0e988035648226ec26
Parents: ff325c3
Author: Antoine Duprat <ad...@linagora.com>
Authored: Thu Jun 7 11:56:19 2018 +0200
Committer: Matthieu Baechler <ma...@apache.org>
Committed: Mon Jun 18 11:40:26 2018 +0200
----------------------------------------------------------------------
server/container/guice/jpa-smtp-mariadb/pom.xml | 133 +++++++++++++++++
.../sample-configuration/dnsservice.xml | 29 ++++
.../sample-configuration/domainlist.xml | 28 ++++
.../james-database.properties | 46 ++++++
.../sample-configuration/mailetcontainer.xml | 143 +++++++++++++++++++
.../mailrepositorystore.xml | 34 +++++
.../recipientrewritetable.xml | 27 ++++
.../sample-configuration/smtpserver.xml | 105 ++++++++++++++
.../sample-configuration/usersrepository.xml | 27 ++++
.../sample-configuration/webadmin.properties | 23 +++
.../org/apache/james/JPAJamesServerTest.java | 103 +++++++++++++
.../james/TestJPAConfigurationModule.java | 52 +++++++
.../src/test/resources/dnsservice.xml | 29 ++++
.../test/resources/fakemailrepositorystore.xml | 31 ++++
.../src/test/resources/keystore | Bin 0 -> 2245 bytes
.../src/test/resources/mailetcontainer.xml | 136 ++++++++++++++++++
.../src/test/resources/mailrepositorystore.xml | 31 ++++
.../src/test/resources/smtpserver.xml | 102 +++++++++++++
server/container/guice/pom.xml | 1 +
19 files changed, 1080 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/pom.xml b/server/container/guice/jpa-smtp-mariadb/pom.xml
new file mode 100644
index 0000000..19a1ba2
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/pom.xml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-guice</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>james-server-jpa-smtp-mariadb-guice</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Apache James :: Server :: JPA + SMTP + mariaDB client - guice injection</name>
+ <description>An advanced email server - JPA backend for SMTP with guice injection</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>apache-james-backends-jpa</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>james-server-jpa-smtp-common-guice</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>james-server-guice-common</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mariadb.jdbc</groupId>
+ <artifactId>mariadb-java-client</artifactId>
+ <version>2.2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>mariadb</artifactId>
+ <version>1.7.3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <outputDirectory>${project.build.directory}/${project.artifactId}.lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <finalName>${project.artifactId}</finalName>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <classpathPrefix>${project.artifactId}.lib/</classpathPrefix>
+ <mainClass>org.apache.james.JPAJamesServerMain</mainClass>
+ <useUniqueVersions>false</useUniqueVersions>
+ </manifest>
+ </archive>
+ </configuration>
+ </execution>
+ <execution>
+ <id>test-jar</id>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/dnsservice.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<dnsservice>
+ <servers>
+ <server>8.8.8.8</server>
+ <server>62.210.16.6</server>
+ </servers>
+ <autodiscover>false</autodiscover>
+ <authoritative>false</authoritative>
+ <maxcachesize>50000</maxcachesize>
+</dnsservice>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml
new file mode 100644
index 0000000..8d00118
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
+ <domainnames>
+ <domainname>james.apache.org</domainname>
+ </domainnames>
+ <autodetect>true</autodetect>
+ <autodetectIP>true</autodetectIP>
+ <defaultDomain>localhost</defaultDomain>
+</domainlist>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/james-database.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/james-database.properties b/server/container/guice/jpa-smtp-mariadb/sample-configuration/james-database.properties
new file mode 100644
index 0000000..209de00
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/james-database.properties
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# 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.mariadb.jdbc.Driver
+database.url=jdbc:mariadb://localhost:3306/
+database.username=app
+database.password=app
+
+# Supported adapters are:
+# DB2, DERBY, H2, HSQL, INFORMIX, MYSQL, ORACLE, POSTGRESQL, SQL_SERVER, SYBASE
+vendorAdapter.database=mariaDB
+
+# 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
+
+# Validate the data source before using it
+# datasource.testOnBorrow=true
+# datasource.validationQueryTimeoutSec=2
+# This is different per database. See https://stackoverflow.com/questions/10684244/dbcp-validationquery-for-different-databases#10684260
+# datasource.validationQuery=select 1
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailetcontainer.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailetcontainer.xml
new file mode 100644
index 0000000..909c5db
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailetcontainer.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<mailetcontainer enableJmx="true">
+
+ <context>
+ <postmaster>postmaster@james.minet.net</postmaster>
+ </context>
+
+ <spooler>
+ <threads>20</threads>
+ </spooler>
+
+ <processors>
+ <processor state="root" enableJmx="true">
+ <mailet match="All" class="PostmasterAlias"/>
+ <mailet match="RelayLimit=30" class="Null"/>
+ <!-- Hook on sievemanager@james.linagora.com
+ Mail send to this address will get interpreted with SIEVE Manage -->
+ <mailet match="RecipientIs=sievemanager@james.linagora.com" class="ToProcessor">
+ <processor>sieve-manager-check</processor>
+ </mailet>
+ <mailet match="HasMailAttribute=spamChecked" class="ToProcessor">
+ <processor>transport</processor>
+ </mailet>
+ <mailet match="All" class="SetMailAttribute">
+ <spamChecked>true</spamChecked>
+ </mailet>
+ <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+ <processor>transport</processor>
+ </mailet>
+ <mailet match="InSpammerBlacklist=query.bondedsender.org." class="ToProcessor">
+ <processor>transport</processor>
+ </mailet>
+ <!-- Check for delivery from a known spam server -->
+ <!-- This set of matchers/mailets redirect all emails from known -->
+ <!-- black holes, open relays, and spam servers to the spam processor -->
+ <!-- For this set to function properly, the spam processor must be configured. -->
+ <mailet match="InSpammerBlacklist=dnsbl.njabl.org." class="ToProcessor">
+ <processor>spam</processor>
+ <notice>550 Requested action not taken: rejected - see http://njabl.org/</notice>
+ </mailet>
+ <mailet match="All" class="ToProcessor">
+ <processor>transport</processor>
+ </mailet>
+ </processor>
+
+ <processor state="error" enableJmx="true">
+ <mailet match="All" class="Bounce"/>
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/error/</repositoryPath>
+ </mailet>
+ </processor>
+
+
+ <processor state="transport" enableJmx="true">
+ <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
+ <name>X-UserIsAuth</name>
+ <value>true</value>
+ </mailet>
+ <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
+ <name>X-WasSigned</name>
+ <value>true</value>
+ </mailet>
+ <mailet match="All" class="RecipientRewriteTable" />
+ <mailet match="RecipientIsLocal" class="LocalDelivery"/>
+ <mailet match="HostIsLocal" class="ToProcessor">
+ <processor>local-address-error</processor>
+ <notice>550 - Requested action not taken: no such user here</notice>
+ </mailet>
+ <mailet match="SMTPAuthSuccessful" class="SetMailAttribute">
+ <RelayAllowed>true</RelayAllowed>
+ </mailet>
+ <mailet match="SentByMailet" class="SetMailAttribute">
+ <RelayAllowed>true</RelayAllowed>
+ </mailet>
+ <mailet match="HasMailAttribute=RelayAllowed" class="RemoteDelivery">
+ <outgoingQueue>outgoing</outgoingQueue>
+ <delayTime>5000, 100000, 500000</delayTime>
+ <maxRetries>25</maxRetries>
+ <maxDnsProblemRetries>0</maxDnsProblemRetries>
+ <deliveryThreads>10</deliveryThreads>
+ <sendpartial>true</sendpartial>
+ <bounceProcessor>bounces</bounceProcessor>
+ </mailet>
+ <mailet match="All" class="ToProcessor">
+ <processor>relay-denied</processor>
+ </mailet>
+ </processor>
+
+ <processor state="spam" enableJmx="true">
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/spam/</repositoryPath>
+ </mailet>
+ </processor>
+
+ <processor state="local-address-error" enableJmx="true">
+ <mailet match="All" class="Bounce">
+ <attachment>none</attachment>
+ </mailet>
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/address-error/</repositoryPath>
+ </mailet>
+ </processor>
+
+ <processor state="relay-denied" enableJmx="true">
+ <mailet match="All" class="Bounce">
+ <attachment>none</attachment>
+ </mailet>
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+ <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+ </mailet>
+ </processor>
+
+ <processor state="bounces" enableJmx="true">
+ <mailet match="All" class="DSNBounce">
+ <passThrough>false</passThrough>
+ </mailet>
+ </processor>
+ </processors>
+
+</mailetcontainer>
+
+
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailrepositorystore.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailrepositorystore.xml
new file mode 100644
index 0000000..acca810
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/mailrepositorystore.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<mailrepositorystore>
+ <mailrepositories>
+ <!-- File based repositories. These repositories store all message data -->
+ <!-- in the file system. -->
+ <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+ <protocols>
+ <protocol>file</protocol>
+ </protocols>
+ <!-- Set if the messages should be listed sorted. False by default -->
+ <config FIFO="false" CACHEKEYS="true"/>
+ </mailrepository>
+ </mailrepositories>
+</mailrepositorystore>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/recipientrewritetable.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/recipientrewritetable.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/recipientrewritetable.xml
new file mode 100644
index 0000000..7e7f586
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/recipientrewritetable.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<!-- The default table for storing James' RecipientRewriteTable mappings. -->
+<recipientrewritetable class="org.apache.james.rrt.jpa.JPARecipientRewriteTable">
+ <recursiveMapping>true</recursiveMapping>
+ <mappingLimit>10</mappingLimit>
+ <mapping>some@domain=some</mapping>
+</recipientrewritetable>
+
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/smtpserver.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/smtpserver.xml
new file mode 100644
index 0000000..c34fcd1
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/smtpserver.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<smtpservers>
+ <smtpserver enabled="true">
+ <jmxName>smtpserver-global</jmxName>
+ <bind>0.0.0.0:1025</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <tls socketTLS="false" startTLS="false">
+ <keystore>file://conf/keystore</keystore>
+ <secret>james72laBalle</secret>
+ <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+ <algorithm>SunX509</algorithm>
+ </tls>
+ <connectiontimeout>360</connectiontimeout>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <authRequired>false</authRequired>
+ <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+ <verifyIdentity>true</verifyIdentity>
+ <maxmessagesize>0</maxmessagesize>
+ <addressBracketsEnforcement>true</addressBracketsEnforcement>
+ <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+ <handlerchain>
+ <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+ <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+ </handlerchain>
+ </smtpserver>
+ <smtpserver enabled="true">
+ <jmxName>smtpserver-TLS</jmxName>
+ <bind>0.0.0.0:1465</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <tls socketTLS="true" startTLS="false">
+ <keystore>file://conf/keystore</keystore>
+ <secret>james72laBalle</secret>
+ <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+ <algorithm>SunX509</algorithm>
+ </tls>
+ <connectiontimeout>360</connectiontimeout>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <!--
+ Authorize only local users
+ -->
+ <authRequired>true</authRequired>
+ <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+ <!-- Trust authenticated users -->
+ <verifyIdentity>false</verifyIdentity>
+ <maxmessagesize>0</maxmessagesize>
+ <addressBracketsEnforcement>true</addressBracketsEnforcement>
+ <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+ <handlerchain>
+ <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+ <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+ </handlerchain>
+ </smtpserver>
+ <smtpserver enabled="true">
+ <jmxName>smtpserver-authenticated</jmxName>
+ <bind>0.0.0.0:1587</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <tls socketTLS="false" startTLS="true">
+ <keystore>file://conf/keystore</keystore>
+ <secret>james72laBalle</secret>
+ <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+ <algorithm>SunX509</algorithm>
+ </tls>
+ <connectiontimeout>360</connectiontimeout>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <!--
+ Authorize only local users
+ -->
+ <authRequired>true</authRequired>
+ <authorizedAddresses>0.0.0.0/0</authorizedAddresses>
+ <!-- Trust authenticated users -->
+ <verifyIdentity>false</verifyIdentity>
+ <maxmessagesize>0</maxmessagesize>
+ <addressBracketsEnforcement>true</addressBracketsEnforcement>
+ <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+ <handlerchain>
+ <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+ <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+ </handlerchain>
+ </smtpserver>
+</smtpservers>
+
+
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/usersrepository.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/usersrepository.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/usersrepository.xml
new file mode 100644
index 0000000..fc76107
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/usersrepository.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<usersrepository name="LocalUsers" class="org.apache.james.user.jpa.JPAUsersRepository">
+ <destination URL="file://users/"/>
+ <algorithm>MD5</algorithm>
+ <enableVirtualHosting>true</enableVirtualHosting>
+ <enableForwarding>true</enableForwarding>
+</usersrepository>
+
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/sample-configuration/webadmin.properties
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/webadmin.properties b/server/container/guice/jpa-smtp-mariadb/sample-configuration/webadmin.properties
new file mode 100644
index 0000000..a9b5cc2
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/webadmin.properties
@@ -0,0 +1,23 @@
+# 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
+
+enabled=true
+port=8000
+host=localhost
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/JPAJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/JPAJamesServerTest.java b/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/JPAJamesServerTest.java
new file mode 100644
index 0000000..bf781ce
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/JPAJamesServerTest.java
@@ -0,0 +1,103 @@
+/****************************************************************
+ * 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;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
+
+import javax.persistence.EntityManagerFactory;
+
+import org.apache.james.backends.jpa.JpaTestCluster;
+import org.apache.james.domainlist.jpa.model.JPADomain;
+import org.apache.james.mailrepository.jpa.JPAUrl;
+import org.apache.james.rrt.jpa.model.JPARecipientRewrite;
+import org.apache.james.server.core.configuration.Configuration;
+import org.apache.james.user.jpa.model.JPAUser;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.testcontainers.containers.MariaDBContainer;
+
+public class JPAJamesServerTest {
+
+ private static final int SMTP_PORT = 1025;
+
+ private GuiceJamesServer server;
+ private SocketChannel socketChannel;
+
+ @Rule
+ public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+ @Rule
+ public MariaDBContainer<?> mariaDB = new MariaDBContainer<>();
+
+ @Before
+ public void setup() throws Exception {
+ server = createJamesServer(mariaDB.getJdbcUrl());
+ socketChannel = SocketChannel.open();
+ server.start();
+ }
+
+ @After
+ public void teardown() {
+ server.stop();
+ }
+
+ private org.apache.james.GuiceJamesServer createJamesServer(String mariaDBUrl) throws IOException {
+ Configuration configuration = Configuration.builder()
+ .workingDirectory(temporaryFolder.newFolder())
+ .configurationFromClasspath()
+ .build();
+
+ return new GuiceJamesServer(configuration)
+ .combineWith(JPAJamesServerMain.JPA_SERVER_MODULE, JPAJamesServerMain.PROTOCOLS)
+ .overrideWith(
+ new TestJPAConfigurationModule(mariaDBUrl),
+ (binder) -> binder.bind(EntityManagerFactory.class)
+ .toInstance(JpaTestCluster.create(JPAUser.class, JPADomain.class, JPARecipientRewrite.class, JPAUrl.class)
+ .getEntityManagerFactory()));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ server.stop();
+ }
+
+ @Test
+ 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");
+ }
+
+ private String getServerConnectionResponse(SocketChannel socketChannel) throws IOException {
+ ByteBuffer byteBuffer = ByteBuffer.allocate(1000);
+ socketChannel.read(byteBuffer);
+ byte[] bytes = byteBuffer.array();
+ return new String(bytes, Charset.forName("UTF-8"));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/TestJPAConfigurationModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/TestJPAConfigurationModule.java b/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/TestJPAConfigurationModule.java
new file mode 100644
index 0000000..1270b8f
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/java/org/apache/james/TestJPAConfigurationModule.java
@@ -0,0 +1,52 @@
+/****************************************************************
+ * 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;
+
+import java.io.FileNotFoundException;
+
+import javax.inject.Singleton;
+
+import org.apache.commons.configuration.ConfigurationException;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+
+public class TestJPAConfigurationModule extends AbstractModule {
+
+ private static final String JDBC_EMBEDDED_DRIVER = org.mariadb.jdbc.Driver.class.getName();
+ private final String mariaDBUrl;
+
+ public TestJPAConfigurationModule(String mariaDBUrl) {
+ this.mariaDBUrl = mariaDBUrl;
+ }
+
+ @Override
+ protected void configure() {
+ }
+
+ @Provides
+ @Singleton
+ JPAConfiguration provideConfiguration() throws FileNotFoundException, ConfigurationException {
+ return JPAConfiguration.builder()
+ .driverName(JDBC_EMBEDDED_DRIVER)
+ .driverURL(mariaDBUrl)
+ .build();
+ }
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/resources/dnsservice.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/resources/dnsservice.xml b/server/container/guice/jpa-smtp-mariadb/src/test/resources/dnsservice.xml
new file mode 100644
index 0000000..0978a00
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/resources/dnsservice.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<dnsservice>
+ <servers>
+ <server>8.8.8.8</server>
+ <server>62.210.16.6</server>
+ </servers>
+ <autodiscover>false</autodiscover>
+ <authoritative>false</authoritative>
+ <maxcachesize>50000</maxcachesize>
+</dnsservice>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/resources/fakemailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/resources/fakemailrepositorystore.xml b/server/container/guice/jpa-smtp-mariadb/src/test/resources/fakemailrepositorystore.xml
new file mode 100644
index 0000000..2d19a80
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/resources/fakemailrepositorystore.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<mailrepositorystore>
+ <mailrepositories>
+ <mailrepository class="org.apache.james.mailrepository.None">
+ <protocols>
+ <protocol>file</protocol>
+ </protocols>
+ <config FIFO="false" CACHEKEYS="true"/>
+ </mailrepository>
+ </mailrepositories>
+</mailrepositorystore>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/resources/keystore
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/resources/keystore b/server/container/guice/jpa-smtp-mariadb/src/test/resources/keystore
new file mode 100644
index 0000000..536a6c7
Binary files /dev/null and b/server/container/guice/jpa-smtp-mariadb/src/test/resources/keystore differ
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailetcontainer.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailetcontainer.xml b/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailetcontainer.xml
new file mode 100644
index 0000000..d0cfea7
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailetcontainer.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<mailetcontainer enableJmx="true">
+
+ <context>
+ <postmaster>postmaster@localhost</postmaster>
+ </context>
+
+ <spooler>
+ <threads>20</threads>
+ </spooler>
+
+ <processors>
+ <processor state="root" enableJmx="true">
+ <mailet match="All" class="PostmasterAlias"/>
+ <mailet match="RelayLimit=30" class="Null"/>
+
+ <mailet match="SMTPAuthSuccessful" class="ToProcessor">
+ <processor>transport</processor>
+ </mailet>
+
+ <mailet match="All" class="ToProcessor">
+ <processor>transport</processor>
+ </mailet>
+ </processor>
+
+ <processor state="error" enableJmx="true">
+ <mailet match="All" class="Bounce">
+ </mailet>
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/error/</repositoryPath>
+ </mailet>
+ </processor>
+
+
+ <processor state="transport" enableJmx="true">
+ <mailet match="SMTPAuthSuccessful" class="SetMimeHeader">
+ <name>X-UserIsAuth</name>
+ <value>true</value>
+ </mailet>
+ <mailet match="All" class="RemoveMimeHeader">
+ <name>bcc</name>
+ </mailet>
+ <mailet match="HasMailAttribute=org.apache.james.SMIMECheckSignature" class="SetMimeHeader">
+ <name>X-WasSigned</name>
+ <value>true</value>
+ </mailet>
+ <mailet match="All" class="RemoveMimeHeader">
+ <name>bcc</name>
+ </mailet>
+ <mailet match="All" class="RecipientRewriteTable">
+ <errorProcessor>rrt-error</errorProcessor>
+ </mailet>
+ <!-- <mailet match="HostIsLocal" class="ToProcessor">
+ <processor>local-address-error</processor>
+ <notice>550 - Requested action not taken: no such user here</notice>
+ </mailet> -->
+ <mailet match="All" class="RemoteDelivery">
+ <outgoingQueue>outgoing</outgoingQueue>
+ <delayTime>5 minutes</delayTime>
+ <delayTime>10 minutes</delayTime>
+ <delayTime>45 minutes</delayTime>
+ <delayTime>2 hours</delayTime>
+ <delayTime>3 hours</delayTime>
+ <delayTime>6 hours</delayTime>
+ <maxRetries>0</maxRetries>
+ <maxDnsProblemRetries>0</maxDnsProblemRetries>
+ <deliveryThreads>1</deliveryThreads>
+ <sendpartial>false</sendpartial>
+ <bounceProcessor>bounces</bounceProcessor>
+ </mailet>
+ <!-- mailet match="All" class="ToProcessor">
+ <processor>relay-denied</processor>
+ </mailet-->
+ </processor>
+
+ <processor state="local-address-error" enableJmx="true">
+ <mailet match="All" class="Bounce">
+ <attachment>none</attachment>
+ <passThrough>true</passThrough>
+ <debug>true</debug>
+ </mailet>
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/address-error/</repositoryPath>
+ </mailet>
+ </processor>
+
+ <processor state="relay-denied" enableJmx="true">
+ <mailet match="All" class="Bounce">
+ <attachment>none</attachment>
+ </mailet>
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/relay-denied/</repositoryPath>
+ <notice>Warning: You are sending an e-mail to a remote server. You must be authentified to perform such an operation</notice>
+ </mailet>
+ </processor>
+
+ <processor state="bounces" enableJmx="true">
+ <mailet match="All" class="DSNBounce">
+ <passThrough>false</passThrough>
+ </mailet>
+ </processor>
+
+ <processor state="rrt-error" enableJmx="false">
+ <mailet match="All" class="ToRepository">
+ <repositoryPath>file://var/mail/rrt-error/</repositoryPath>
+ <passThrough>true</passThrough>
+ </mailet>
+ <mailet match="IsSenderInRRTLoop" class="Null"/>
+ <mailet match="All" class="Bounce">
+ <notice>We were unable to deliver the attached message to the following recipients due to an address rewriting issue.</notice>
+ </mailet>
+ </processor>
+ </processors>
+
+</mailetcontainer>
+
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailrepositorystore.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailrepositorystore.xml b/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailrepositorystore.xml
new file mode 100644
index 0000000..3ca4a1d
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/resources/mailrepositorystore.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<mailrepositorystore>
+ <mailrepositories>
+ <mailrepository class="org.apache.james.mailrepository.file.FileMailRepository">
+ <protocols>
+ <protocol>file</protocol>
+ </protocols>
+ <config FIFO="false" CACHEKEYS="true"/>
+ </mailrepository>
+ </mailrepositories>
+</mailrepositorystore>
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/jpa-smtp-mariadb/src/test/resources/smtpserver.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-mariadb/src/test/resources/smtpserver.xml b/server/container/guice/jpa-smtp-mariadb/src/test/resources/smtpserver.xml
new file mode 100644
index 0000000..2f83c8e
--- /dev/null
+++ b/server/container/guice/jpa-smtp-mariadb/src/test/resources/smtpserver.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<smtpservers>
+ <smtpserver enabled="true">
+ <jmxName>smtpserver-global</jmxName>
+ <bind>0.0.0.0:1025</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <tls socketTLS="false" startTLS="false">
+ <keystore>file://conf/keystore</keystore>
+ <secret>james72laBalle</secret>
+ <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+ <algorithm>SunX509</algorithm>
+ </tls>
+ <connectiontimeout>360</connectiontimeout>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <authRequired>false</authRequired>
+ <verifyIdentity>true</verifyIdentity>
+ <maxmessagesize>0</maxmessagesize>
+ <addressBracketsEnforcement>true</addressBracketsEnforcement>
+ <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+ <handlerchain>
+ <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+ <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+ </handlerchain>
+ </smtpserver>
+ <smtpserver enabled="true">
+ <jmxName>smtpserver-TLS</jmxName>
+ <bind>0.0.0.0:10465</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <tls socketTLS="false" startTLS="false">
+ <keystore>file://conf/keystore</keystore>
+ <secret>james72laBalle</secret>
+ <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+ <algorithm>SunX509</algorithm>
+ </tls>
+ <connectiontimeout>360</connectiontimeout>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <!--
+ Authorize only local users
+ -->
+ <authRequired>true</authRequired>
+ <!-- Trust authenticated users -->
+ <verifyIdentity>false</verifyIdentity>
+ <maxmessagesize>0</maxmessagesize>
+ <addressBracketsEnforcement>true</addressBracketsEnforcement>
+ <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+ <handlerchain>
+ <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+ <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+ </handlerchain>
+ </smtpserver>
+ <smtpserver enabled="true">
+ <jmxName>smtpserver-authenticated</jmxName>
+ <bind>0.0.0.0:1587</bind>
+ <connectionBacklog>200</connectionBacklog>
+ <tls socketTLS="false" startTLS="false">
+ <keystore>file://conf/keystore</keystore>
+ <secret>james72laBalle</secret>
+ <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
+ <algorithm>SunX509</algorithm>
+ </tls>
+ <connectiontimeout>360</connectiontimeout>
+ <connectionLimit>0</connectionLimit>
+ <connectionLimitPerIP>0</connectionLimitPerIP>
+ <!--
+ Authorize only local users
+ -->
+ <authRequired>true</authRequired>
+ <!-- Trust authenticated users -->
+ <verifyIdentity>false</verifyIdentity>
+ <maxmessagesize>0</maxmessagesize>
+ <addressBracketsEnforcement>true</addressBracketsEnforcement>
+ <smtpGreeting>JAMES Linagora's SMTP awesome Server</smtpGreeting>
+ <handlerchain>
+ <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
+ <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
+ </handlerchain>
+ </smtpserver>
+</smtpservers>
+
+
http://git-wip-us.apache.org/repos/asf/james-project/blob/e8e9803a/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 52cd931..10319a4 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -45,6 +45,7 @@
<module>jpa-guice</module>
<module>jpa-smtp</module>
<module>jpa-smtp-common</module>
+ <module>jpa-smtp-mariadb</module>
<module>mailbox</module>
<module>mailbox-plugin-spamassassin</module>
<module>mailet</module>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org