Installing Apache James Email Server on Ubuntu

[ This post is part of my ongoing instructional series on setting up some baseline IT infrastructure for the fictional startup Shoestring Lab. Shoestring has committed to using Open Source wherever possible. Shoestring Lab has standardized on Ubuntu for its server and desktop/laptop computer systems.

Today's lesson

As the admin for Shoestring Lab, you need to install Apache James with LDAP support as the organization's email server.]

 

Installing James

 

Apache James is an open source email server that provides IMAP, POP3, SMTP, and LMTP services. To learn more about James, browse the website at https://james.apache.org.

James comes in many different configurations and is available for download as source or in compiled binary format for specific configurations. Since Shoestring has decided to use LDAP for its directory services, you are going to download a binary version of James configured with LDAP support, using the Guice Java framework and Apache Cassandra as its datastore.

 

Download the Cassandra-LDAP-Guice Binary

Grab the binary and the sha1 file so you can verify the download. You can find the current version as of this writing here:

https://www-us.apache.org/dist/james/server/3.2.0/james-cassandra-ldap-guice-3.2.0.zip

https://www-us.apache.org/dist/james/server/3.2.0/james-cassandra-ldap-guice-3.2.0.zip.sha1

You may want to browse the James website to confirm that 3.2.0 is still the latest supported binary version.

Verify the downloads:

sha1sum -c james-cassandra-ldap-guice-3.2.0.zip.sha1

Unzip the James .zip file. Move the resulting folder somewhere you can work with it. You will be editing files in the ./conf folder to configure the server.

First, create a new keystore for your TLS keys. Change to the James folder and create the keystore. Make sure you copy whatever password you use, as you are going to need it later:

cd james-cassandra-ldap-guice-3.2.0
keytool -genkey -alias james -keyalg RSA -keystore conf/keystore
Enter keystore password:  
Re-enter new password: 
What is your first and last name?
  [Unknown]:  Robert
What is the name of your organizational unit?
  [Unknown]:  Shoestring Lab
What is the name of your organization?
  [Unknown]:  Shoestring Lab
What is the name of your City or Locality?
  [Unknown]:  boo
What is the name of your State or Province?
  [Unknown]:  oo
What is the two-letter country code for this unit?
  [Unknown]:  CA
Is CN=Robert, OU=Shoestring Lab, O=Shoestring Lab, L=boo, ST=oo, C=CA correct?
  [no]:  n
What is your first and last name?
  [Robert]:  Robert Munn
What is the name of your organizational unit?
  [Shoestring Lab]:  IT        
What is the name of your organization?
  [Shoestring Lab]:  Shoestring Lab
What is the name of your City or Locality?
  [boo]:  Santa Fe
What is the name of your State or Province?
  [oo]:  New Mexico
What is the two-letter country code for this unit?
  [CA]:  US


Is CN=Robert Munn, OU=IT, O=Shoestring Lab, L=Santa Fe, ST=New Mexico, C=US correct?
  [no]:  yes

Enter key password for <james>
	(RETURN if same as keystore password):  

keytool -importkeystore -srckeystore conf/keystore -destkeystore conf/keystorepkcs12 -deststoretype pkcs12

 

Modify the Configuration Files

James comes pre-configured with default settings. You need to edit the configuration files in the ./conf folder so the server responds to your domain, shoestringlab.com.

You can download the modified configuration files and unzip the archive into the James folder.

 

dnsservices.xml

<?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>127.0.0.1</server>
  </servers>
  <autodiscover>false</autodiscover>
  <authoritative>false</authoritative>
  <maxcachesize>50000</maxcachesize>
</dnsservice>

 

domainlist.xml

<?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>
    <domainnames>
        <domainname>shoestringlab.com</domainname>
    </domainnames>
    <autodetect>true</autodetect>
    <autodetectIP>true</autodetectIP>
    <defaultDomain>localhost</defaultDomain>
</domainlist>

 

elasticsearch.properties

#  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.shoestringlab.com
elasticsearch.port=9300

# You can alternatively provide a list of hosts following this format :
# elasticsearch.hosts=host1:9300,host2:9300

elasticsearch.nb.shards=1
elasticsearch.nb.replica=0
elasticsearch.retryConnection.maxRetries=7
elasticsearch.retryConnection.minDelay=3000
# Index or not attachments (default value: true)
elasticsearch.indexAttachments=true

# Reports for metrics into ElasticSearch
# Defaults to elasticsearch.masterHost : on which server to publish metrics
elasticsearch.http.host=elasticsearch.shoestringlab.com
elasticsearch.http.port=9200
elasticsearch.metrics.reports.enabled=true
elasticsearch.metrics.reports.period=30
elasticsearch.metrics.reports.index=james-metrics

 

imapserver.xml

<?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.
 -->

<imapservers>
    <imapserver enabled="true">
        <jmxName>imapserver</jmxName>
        <bind>0.0.0.0:143</bind>
        <connectionBacklog>200</connectionBacklog>
        <tls socketTLS="false" startTLS="true">
            <!-- To create a new keystore execute:
            keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
              -->
            <keystore>file://conf/keystorepkcs12</keystore>
            <secret>shoelaces</secret>
            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
        </tls>
        <connectionLimit>0</connectionLimit>
        <connectionLimitPerIP>0</connectionLimitPerIP>
        <idleTimeInterval>120</idleTimeInterval>
        <idleTimeIntervalUnit>SECONDS</idleTimeIntervalUnit>
        <disabledCaps>ACL|MOVE</disabledCaps>
        <enableIdle>true</enableIdle>
    </imapserver>
    <imapserver enabled="true">
        <jmxName>imapserver-ssl</jmxName>
        <bind>0.0.0.0:993</bind>
        <connectionBacklog>200</connectionBacklog>
        <tls socketTLS="true" startTLS="false">
            <!-- To create a new keystore execute:
              keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
             -->
             <keystore>file://conf/keystorepkcs12</keystore>
             <secret>shoelaces</secret>
            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
        </tls>
        <connectionLimit>0</connectionLimit>
        <connectionLimitPerIP>0</connectionLimitPerIP>
        <idleTimeInterval>120</idleTimeInterval>
        <idleTimeIntervalUnit>SECONDS</idleTimeIntervalUnit>
        <disabledCaps>ACL|MOVE</disabledCaps>
        <enableIdle>true</enableIdle>
    </imapserver>
</imapservers>

 

jmap.properties

# Configuration file for JMAP

enabled=true

tls.keystoreURL=file://conf/keystorepkcs12
tls.secret=shoelaces

#
# If you wish to use OAuth authentication, you should provide a valid JWT public key.
# The following entry specify the link to the URL of the public key file,
# which should be a PEM format file.
#
jwt.publickeypem.url=file://conf/jwt_publickey

 

mailetcontainer.xml

<?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@shoestringlab.com</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="All" class="ToProcessor">
                <processor>transport</processor>
            </mailet>
        </processor>

        <processor state="error" enableJmx="true">
            <mailet match="All" class="MetricsMailet">
                <metricName>mailetContainerErrors</metricName>
            </mailet>
            <mailet match="All" class="Bounce"/>
            <mailet match="All" class="ToRepository">
                <repositoryPath>cassandra://var/mail/error/</repositoryPath>
            </mailet>
        </processor>

        <processor state="transport" enableJmx="true">
            <matcher name="relay-allowed" match="org.apache.james.mailetcontainer.impl.matchers.Or">
                <matcher match="SMTPAuthSuccessful"/>
                <matcher match="SMTPIsAuthNetwork"/>
                <matcher match="SentByMailet"/>
                <matcher match="org.apache.james.jmap.mailet.SentByJmap"/>
            </matcher>

            <mailet match="All" class="RemoveMimeHeader">
                <name>bcc</name>
                <onMailetException>ignore</onMailetException>
            </mailet>
            <mailet match="All" class="RecipientRewriteTable">
                <errorProcessor>rrt-error</errorProcessor>
            </mailet>
            <mailet match="RecipientIsLocal" class="org.apache.james.jmap.mailet.VacationMailet"/>
            <mailet match="RecipientIsLocal" class="Sieve"/>
            <mailet match="RecipientIsLocal" class="AddDeliveredToHeader"/>
            <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="relay-allowed" class="ToProcessor">
                <processor>relay</processor>
            </mailet>

            <mailet match="All" class="ToProcessor">
                <processor>relay-denied</processor>
            </mailet>
        </processor>

        <processor state="relay" enableJmx="true">
            <mailet match="All" 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>
        </processor>

        <processor state="local-address-error" enableJmx="true">
            <mailet match="All" class="MetricsMailet">
                <metricName>mailetContainerLocalAddressError</metricName>
            </mailet>
            <mailet match="All" class="Bounce">
                <attachment>none</attachment>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>cassandra://var/mail/address-error/</repositoryPath>
            </mailet>
        </processor>

        <processor state="relay-denied" enableJmx="true">
            <mailet match="All" class="MetricsMailet">
                <metricName>mailetContainerRelayDenied</metricName>
            </mailet>
            <mailet match="All" class="Bounce">
                <attachment>none</attachment>
            </mailet>
            <mailet match="All" class="ToRepository">
                <repositoryPath>cassandra://var/mail/relay-denied/</repositoryPath>
                <notice>Warning: You are sending an e-mail to a remote server. You must be authenticated to perform such an operation</notice>
            </mailet>
        </processor>

        <processor state="bounces" enableJmx="true">
            <mailet match="All" class="MetricsMailet">
                <metricName>bounces</metricName>
            </mailet>
            <mailet match="All" class="DSNBounce">
                <passThrough>false</passThrough>
            </mailet>
        </processor>

        <processor state="rrt-error" enableJmx="false">
            <mailet match="All" class="ToRepository">
                <repositoryPath>cassandra://var/mail/rrt-error/</repositoryPath>
                <passThrough>true</passThrough>
            </mailet>
            <mailet match="IsSenderInRRTLoop" class="Null"/>
            <mailet match="All" class="Bounce"/>
        </processor>

    </processors>

</mailetcontainer>

 

managesieveserver.xml

<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
 -->

<!--
   This template file can be used as example for James Server configuration
   DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
-->

<!-- See http://james.apache.org/server/3/config.html for usage -->

<managesieveservers>

   <managesieveserver enabled="false">

     <jmxName>managesieveserver</jmxName>

     <bind>0.0.0.0:4190</bind>

     <connectionBacklog>200</connectionBacklog>

     <tls socketTLS="false" startTLS="false">
       <!-- To create a new keystore execute:
        keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
         -->
       <keystore>file://conf/keystorepkcs12</keystore>
       <secret>shoelaces</secret>
       <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
       <!-- The algorithm is optional and only needs to be specified when using something other
        than the Sun JCE provider - You could use IbmX509 with IBM Java runtime. -->
       <algorithm>SunX509</algorithm>
     </tls>

        <!-- connection timeout in secconds -->
        <connectiontimeout>360</connectiontimeout>

        <!-- Set the maximum simultaneous incoming connections for this service -->
        <connectionLimit>0</connectionLimit>

        <!-- Set the maximum simultaneous incoming connections per IP for this service -->
        <connectionLimitPerIP>0</connectionLimitPerIP>
        <maxmessagesize>0</maxmessagesize>
        <addressBracketsEnforcement>true</addressBracketsEnforcement>

   </managesieveserver>

</managesieveservers>

 

pop3server.xml

<?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.
 -->


<pop3servers>
    <pop3server enabled="false">
        <jmxName>pop3server</jmxName>
        <bind>0.0.0.0:110</bind>
        <connectionBacklog>200</connectionBacklog>
        <tls socketTLS="false" startTLS="false">
            <!-- To create a new keystore execute:
                  keytool -genkey -alias james -keyalg RSA -keystore /path/to/james/conf/keystore
             -->
             <keystore>file://conf/keystorepkcs12</keystore>
             <secret>shoelaces</secret>
            <provider>org.bouncycastle.jce.provider.BouncyCastleProvider</provider>
        </tls>
        <connectiontimeout>1200</connectiontimeout>
        <connectionLimit>0</connectionLimit>
        <connectionLimitPerIP>0</connectionLimitPerIP>
        <handlerchain>
            <handler class="org.apache.james.pop3server.core.CoreCmdHandlerLoader"/>
        </handlerchain>
    </pop3server>
</pop3servers>

 

smtpserver.xml

<?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:25</bind>
        <connectionBacklog>200</connectionBacklog>
        <tls socketTLS="false" startTLS="false">
            <keystore>file://conf/keystorepkcs12</keystore>
            <secret>shoelaces</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>127.0.0.0/8</authorizedAddresses>
        <verifyIdentity>true</verifyIdentity>
        <maxmessagesize>0</maxmessagesize>
        <addressBracketsEnforcement>true</addressBracketsEnforcement>
        <smtpGreeting>Shoestring Lab SMTP 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:465</bind>
        <connectionBacklog>200</connectionBacklog>
        <tls socketTLS="true" startTLS="false">
            <keystore>file://conf/keystorepkcs12</keystore>
            <secret>shoelaces</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>127.0.0.0/8</authorizedAddresses>
        <!-- Trust authenticated users -->
        <verifyIdentity>false</verifyIdentity>
        <maxmessagesize>0</maxmessagesize>
        <addressBracketsEnforcement>true</addressBracketsEnforcement>
        <smtpGreeting>Shoestring Lab SMTP 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:587</bind>
        <connectionBacklog>200</connectionBacklog>
        <tls socketTLS="false" startTLS="true">
            <keystore>file://conf/keystorepkcs12</keystore>
            <secret>shoelaces</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>127.0.0.0/8</authorizedAddresses>
        <!-- Trust authenticated users -->
        <verifyIdentity>false</verifyIdentity>
        <maxmessagesize>0</maxmessagesize>
        <addressBracketsEnforcement>true</addressBracketsEnforcement>
        <smtpGreeting>Shoestring Lab SMTP Server</smtpGreeting>
        <handlerchain>
            <handler class="org.apache.james.smtpserver.fastfail.ValidRcptHandler"/>
            <handler class="org.apache.james.smtpserver.CoreCmdHandlerLoader"/>
        </handlerchain>
    </smtpserver>
</smtpservers>

 

usersrepository.xml

<?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.
 -->

<repository name="LocalUsers"
    ldapHost="ldap://localhost:389"
    principal="cn=admin,dc=ldap,dc=shoestringlab,dc=com"
    credentials="<password>"
    userBase="ou=people,dc=ldap,dc=shoestringlab,dc=com"
    userIdAttribute="cn"
    userObjectClass="inetOrgPerson"/>

 

webadmin.properties

#  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=mail.shoestringlab.com

# Defaults to false
https.enabled=false

# Compulsory when enabling HTTPS
#https.keystore=/path/to/keystore
#https.password=password

# Optional when enabling HTTPS (self signed)
#https.trust.keystore
#https.trust.password

# Defaults to false
#jwt.enabled=true

# Defaults to false
#cors.enable=true
#cors.origin

 

For testing on your development system, you need to add several host entries to /etc/hosts:

127.0.0.1   ldap.shoestringlab.com
127.0.0.1   shoestringlab.com
127.0.0.1   mail.shoestringlab.com
127.0.0.1   elasticsearch.shoestringlab.com

 

Once you have everything configured, from the james folder you can run the server:

java -Dworking.directory=. -jar target/james-server-cassandra-ldap-guice.jar