blob: 7605540c16459ae3025ceafc4164576daf945142 [file] [log] [blame]
<?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.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Generated by Apache Maven Doxia at 2021-11-12 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Apache James Project &#x2013; Apache James Server 3 - Quick Start for Cassandra backend</title>
<style type="text/css" media="all">
@import url("../css/james.css");
@import url("../css/maven-base.css");
@import url("../css/maven-theme.css");
@import url("../css/site.css");
@import url("../js/jquery/css/custom-theme/jquery-ui-1.8.5.custom.css");
@import url("../js/jquery/css/print.css");
@import url("../js/fancybox/jquery.fancybox-1.3.4.css");
</style>
<script type="text/javascript" src="../js/jquery/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../js/jquery/js/jquery-ui-1.8.5.custom.min.js"></script>
<script type="text/javascript" src="../js/fancybox/jquery.fancybox-1.3.4.js"></script>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20211112" />
<meta http-equiv="Content-Language" content="en" />
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1384591-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script').item(0); s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="composite">
<div id="banner">
<a href="../index.html" id="bannerLeft" title="james-logo.png">
<img src="../images/logos/james-logo.png" alt="James Project" />
</a>
<a href="https://www.apache.org/index.html" id="bannerRight">
<img src="images/logos/asf_logo_small.png" alt="The Apache Software Foundation" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<span id="publishDate">Last Published: 2021-11-12</span>
</div>
<div class="xright"> <a href="../index.html" title="Home">Home</a>
|
<a href="../documentation.html" title="James">James</a>
|
<a href="../mime4j/index.html" title="Mime4J">Mime4J</a>
|
<a href="../jsieve/index.html" title="jSieve">jSieve</a>
|
<a href="../jspf/index.html" title="jSPF">jSPF</a>
|
<a href="../jdkim/index.html" title="jDKIM">jDKIM</a>
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>James components</h5>
<ul>
<li class="collapsed">
<a href="../documentation.html" title="About James">About James</a>
</li>
<li class="collapsed">
<a href="../server/index.html" title="Server">Server</a>
</li>
<li class="collapsed">
<a href="../mailet/index.html" title="Mailets">Mailets</a>
</li>
<li class="collapsed">
<a href="../mailbox/index.html" title="Mailbox">Mailbox</a>
</li>
<li class="collapsed">
<a href="../protocols/index.html" title="Protocols">Protocols</a>
</li>
<li class="collapsed">
<a href="../mpt/index.html" title="MPT">MPT</a>
</li>
</ul>
<h5>Apache Software Foundation</h5>
<ul>
<li>
<strong>
<a title="ASF" href="http://www.apache.org/">ASF</a>
</strong>
</li>
<li>
<a title="Get Involved" href="http://www.apache.org/foundation/getinvolved.html">Get Involved</a>
</li>
<li>
<a title="FAQ" href="http://www.apache.org/foundation/faq.html">FAQ</a>
</li>
<li>
<a title="License" href="http://www.apache.org/licenses/" >License</a>
</li>
<li>
<a title="Sponsorship" href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
</li>
<li>
<a title="Thanks" href="http://www.apache.org/foundation/thanks.html">Thanks</a>
</li>
<li>
<a title="Security" href="http://www.apache.org/security/">Security</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="poweredBy" alt="Built by Maven" src="../images/logos/maven-feather.png" />
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<section>
<h2><a name="Quick_Start_for_Cassandra_backend"></a>Quick Start for Cassandra backend</h2>
<p>The goal of the document is to allow anyone to start a James instance as an operational mail server.</p>
<p>The two methods described bellow should not be used in production.</p>
<p>First method, from James source code:</p>
<div class="source">
<pre>
Step 0: Requirements
####################
* Java 11 SDK
* 2GB RAM
* Docker 1.7.1+
* Maven 3.3
Step 1: Download
#################
* Clone the James git repository
<i>$ git clone git://git.apache.org/james-project.git</i>
Step 3: Compile
###############
* Compile the Guice Cassandra project
<i>$ mvn package -DskipTests --also-make --projects server/container/guice/cassandra-guice</i>
* Compile the James CLI project
<i>$ mvn package -DskipTests -am -pl server/container/cli</i>
Step 3: Deploy
##############
3.1. Deploy Cassandra (optional)
You may skip this part if you already have a running Cassandra on your network.
<i>$ docker run --detach=true --name=cassandra cassandra:3.11.10</i>
3.2. Deploy ElasticSearch (optional)
You may skip this part if you already have a running ElasticSearch on your network.
<i>$ docker run --detach=true --name=elasticsearch --env 'discovery.type=single-node' docker.elastic.co/elasticsearch/elasticsearch:7.10.2</i>
Step 4: Configure
#################
* Follow the <a href="config-guice.html">Cassandra guice</a> 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 TLS keys to ./conf/keystore or generate it using :
<i>$ keytool -genkey -alias james -keyalg RSA -keystore ./conf/keystore</i>
You will have to put the keystore password in the right xml files (imapserver.xml, pop3server.xml, smtpserver.xml)
You are welcome to use the default configuration which can be found in the <i>$PWD/server/apps/cassandra-app/sample-configuration</i> folder.
Step 5: Start
#############
* Run James
<i>$ sudo java -Dworking.directory=<b>WORKING_PATH</b> -jar server/container/guice/cassandra-guice/target/james-server-cassandra-guice.jar</i>
Where :
- <b>WORKING_PATH</b> is the path of the folder which contains your configuration files.
You have to run this command with the superuser, has some default ports are lower than 1000 (default imap, smtp...).
You may get rid of that by overriding the default configuration
Step 6: Create Domains and Users
################################
Time to add domains and users.
<i>$ java -jar server/container/cli/target/james-server-cli.jar -h 127.0.0.1 -p 9999 adddomain <b>DOMAIN</b></i>
<i>$ java -jar server/container/cli/target/james-server-cli.jar -h 127.0.0.1 -p 9999 adduser <b>USER_MAIL_ADDRESS</b> <b>PASSWORD</b></i>
Where :
- <b>DOMAIN</b> is the domain you want to handle with this server
- <b>USER_MAIL_ADDRESS</b> user's email
- <b>PASSWORD</b> user's password
Step 7: Test
############
<div class="source">
<pre>
$ telnet <b>HOSTNAME</b> 25
Trying <b>HOSTNAME</b>...
Connected to <b>HOSTNAME</b>.
Escape character is '^]'.
220 172.16.1.131 SMTP Server (JAMES SMTP Server 3.0.0) ready Wed, 20 Jul 2017 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:&lt;YOUR_NAME@YOUR_DOMAIN&gt;
250 2.1.0 Sender &lt;YOUR_NAME@YOUR_DOMAIN&gt; OK
rcpt to:&lt;YOUR_NAME@YOUR_DOMAIN&gt;
250 2.1.5 Recipient &lt;YOUR_NAME@YOUR_DOMAIN&gt; OK
data
354 Ok Send data ending with &lt;CRLF&gt;.&lt;CRLF&gt;
subject: test
this is a test
.
250 2.6.0 Message received
quit
Connection closed by foreign host.
</pre></div>
And for IMAP (SSL):
<div class="source">
<pre>
$ openssl s_client -connect 127.0.0.1:993
CONNECTED(00000003)
Can't use SSL_get_servername
depth=0 C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
verify error:num=18:self signed certificate
verify return:1
depth=0 C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
verify error:num=10:certificate has expired
notAfter=Nov 24 07:32:55 2015 GMT
verify return:1
depth=0 C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
notAfter=Nov 24 07:32:55 2015 GMT
verify return:1
---
Certificate chain
0 s:C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
i:C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDeTCCAmGgAwIBAgIEXaLC/zANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQGEwJG
UjEQMA4GA1UECBMHVW5rbm93bjEQMA4GA1UEBxMHUHV0ZWF1eDEOMAwGA1UEChMF
SmFtZXMxETAPBgNVBAsTCExpbmFnb3JhMRcwFQYDVQQDEw5CZW5vaXQgVGVsbGll
cjAeFw0xNTA4MjYwNzMyNTVaFw0xNTExMjQwNzMyNTVaMG0xCzAJBgNVBAYTAkZS
MRAwDgYDVQQIEwdVbmtub3duMRAwDgYDVQQHEwdQdXRlYXV4MQ4wDAYDVQQKEwVK
YW1lczERMA8GA1UECxMITGluYWdvcmExFzAVBgNVBAMTDkJlbm9pdCBUZWxsaWVy
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhW0GWSgkK44XQpwLn8KX
q9kJ3zgDYllEX7W8p+3sBYMAP0JC+lzh42mX/8XHti0vkmv/vjk0paAsB9s5uYhv
/W94sdqjexi3L213+OD5Kcy+2tTgXN1ucF65d/dDeqGHAyBs1rm6LgyRwQ5ye8Cl
OtXbSkz5qujmnFDDzrDIgzefxFsTHHIBTsdyttq2Atqzgdg2LHaFbIntwr6lfl9v
puXr8p+CY6PfehX8mdmaJ7J/gfAll3zzdgeNUoAW0eDvcsphJ06elsDahieo0n/o
XVhy+TGWtAQRDZQDjeK2BX/vVSPAlGOW7hVTv7WycAolzKlXZyiJMnwTWJl6YoUP
vQIDAQABoyEwHzAdBgNVHQ4EFgQU7tDLswRlOJqoX4aVgrXRQbmOYbIwDQYJKoZI
hvcNAQELBQADggEBAGmzK2i2H5D6xITyN1iNQhXbABQ/3rz9K5dEvy0ZLgYOUqyw
1WD43Do/A3eZuEZbuuYAlbvDEUNgS7rJ5HCrwIKFbPHWmfRX2j59UX+R8fI6G9wB
qqcRYWpert347rGT/7MFLHk55LL6Tf//fwoWu6GWRj3wTvosVuunUiiC6zTS4MN9
moJp+IF03Q6JOPWu7/tfaKfXQHxG/hK492oV2vBG2r29UUJW6YO1S0DK+/cU0cCu
+jqbY1ZOIAk906onRUFoPGuypOm3vmbE6mo5o49rNtp+VmZagZ7GsjJ4KWJB1c6d
SFNIFlH2VlS8Lywr2tesClWO5tqtMswRsoA9GeU=
-----END CERTIFICATE-----
subject=C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
issuer=C = FR, ST = Unknown, L = Puteaux, O = James, OU = Linagora, CN = Benoit Tellier
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 1425 bytes and written 363 bytes
Verification error: certificate has expired
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 10 (certificate has expired)
---
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
Protocol : TLSv1.3
Cipher : TLS_AES_256_GCM_SHA384
Session-ID: 92D136BF8C9E3E09C4FF7946A2AFDC8ED6E395A1729532D3544E58F688B787F9
Session-ID-ctx:
Resumption PSK: C4E09FF3045720EE910AEA5300D87FDE2200A56F218AC3F75748BE794F73F32790FC8DD35CA70869FBD075727779BA73
PSK identity: None
PSK identity hint: None
SRP username: None
TLS session ticket lifetime hint: 86400 (seconds)
TLS session ticket:
0000 - 03 d2 89 8a 32 48 28 a2-99 24 99 47 b2 05 e8 99 ....2H(..$.G....
0010 - 6b 9b a9 0b 59 95 dd 2c-fb ba 46 b9 94 ad 36 63 k...Y..,..F...6c
Start Time: 1630033038
Timeout : 7200 (sec)
Verify return code: 10 (certificate has expired)
Extended master secret: no
Max Early Data: 0
---
read R BLOCK
* OK JAMES IMAP4rev1 Server 2e73ecd482f4 is ready.
a login bob@domain.com 1234
a OK LOGIN completed.
1 logout
* BYE IMAP4rev1 Server logging out
1 OK LOGOUT completed.
closed
</pre></div>
Step 8: Manage
##############
8.1. Manage via james-cli
usage:
<i>$ java -jar server/container/cli/target/james-server-cli.jar -h 127.0.0.1 -p 9999</i>
Available commands:
adduser &lt;/username&gt; &lt;/password&gt;
removeuser &lt;/username&gt;
listusers
adddomain &lt;/domainname&gt;
removedomain &lt;/domainname&gt;
listdomains
8.2. Manage via JMX
* Launch jconsole (or any other JMX client) and connect on URL=service:jmx:rmi:///jndi/rmi://localhost:<b>HOSTNAME</b>/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://<b>HOSTNAME</b>:9999/jmxrmi)
* Check ./var folder usage
mail
+-error
+-address-error
+-relay-denied
+-spam
store
+-derby
+-jackrabbit
+-activemq
+-brokers
+-james
+-blob-transfer
+-outgoing
+-spool
* Check /tmp folder usage
</pre></div>
<p>Second method, with docker-compose:</p>
<div class="source">
<pre>
Step 0: Requirements
####################
* 2GB RAM
* Docker 1.7.1+
* wget
Step 1: Download
#################
* Get the James docker-compose file
<i>$ wget https://raw.githubusercontent.com/apache/james-project/master/server/apps/distributed-app/docker-compose.yml</i>
Step 2: Start
#############
* Run James
<i>$ docker-compose up</i>
Step 3: Create Domains and Users
################################
Time to add domains and users.
<i>$ docker exec james java -jar /root/james-cli.jar -h 127.0.0.1 -p 9999 adddomain <b>DOMAIN</b></i>
<i>$ docker exec james java -jar /root/james-cli.jar -h 127.0.0.1 -p 9999 adduser <b>USER_MAIL_ADDRESS</b> <b>PASSWORD</b></i>
Where :
- <b>DOMAIN</b> is the domain you want to handle with this server
- <b>USER_MAIL_ADDRESS</b> user's email
- <b>PASSWORD</b> user's password
Step 4: Test
############
$ telnet <b>HOSTNAME</b> 25
Trying <b>HOSTNAME</b>...
Connected to <b>HOSTNAME</b>.
Escape character is '^]'.
220 172.16.1.131 SMTP Server (JAMES SMTP Server 3.0.0) ready Wed, 20 Jul 2017 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:&lt;YOUR_NAME@YOUR_DOMAIN&gt;
250 2.1.0 Sender &lt;YOUR_NAME@YOUR_DOMAIN&gt; OK
rcpt to:&lt;YOUR_NAME@YOUR_DOMAIN&gt;
250 2.1.5 Recipient &lt;YOUR_NAME@YOUR_DOMAIN&gt; OK
data
354 Ok Send data ending with &lt;CRLF&gt;.&lt;CRLF&gt;
subject: test
this is a test
.
250 2.6.0 Message received
quit
Connection closed by foreign host.
Step 5: Manage
##############
5.1. Manage via james-cli
usage:
<i>$ docker exec james java -jar /root/james-cli.jar -h 127.0.0.1 -p 9999</i>
Available commands:
adduser &lt;/username&gt; &lt;/password&gt;
removeuser &lt;/username&gt;
listusers
adddomain &lt;/domainname&gt;
removedomain &lt;/domainname&gt;
listdomains
5.2. Manage via JMX
* Launch jconsole (or any other JMX client) and connect on URL=service:jmx:rmi:///jndi/rmi://localhost:<b>HOSTNAME</b>/jmxrmi
* Select the MBeans tab and open the org.apache.james node to view attributes and execute operations.
Step 6: 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://<b>HOSTNAME</b>:9999/jmxrmi)
* Check ./var folder usage
mail
+-error
+-address-error
+-relay-denied
+-spam
store
+-derby
+-jackrabbit
+-activemq
+-brokers
+-james
+-blob-transfer
+-outgoing
+-spool
* Check /tmp folder usage
</pre></div>
</section>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">Copyright &#169; 2006-2021
<a href="https://www.apache.org/">The Apache Software Foundation</a>.
All Rights Reserved.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>