= Distributed James Server &mdash; Configuration
:navtitle: Configuration

This section presents how to configure the Distributed server.

The Distributed Server relies on separated files for configuring various components. Some files follow a *xml* format
and some others follow a *property* format. Some files can be omitted, in which case the functionality can be disabled,
or rely on reasonable defaults.

The following configuration files are exposed:

== For protocols

By omitting these files, the underlying protocols will be disabled.

** xref:configure/imap.adoc[*imapserver.xml*] allows configuration for the IMAP protocol link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/imapserver.xml[example]
** xref:configure/jmap.adoc[*jmap.properties*] allows to configure the JMAP protocol link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/jmap.properties[example]
** xref:configure/jmx.adoc[*jmx.properties*] allows configuration of JMX being used by the Command Line Interface link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/jmx.properties[example]
** xref:configure/smtp.adoc#_lmtp_configuration[*lmtpserver.xml*] allows configuring the LMTP protocol link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/lmtpserver.xml[example]
** *managesieveserver.xml* allows configuration for ManagedSieve (unsupported) link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/managesieveserver.xml[example]
** xref:configure/pop3.adoc[*pop3server.xml*] allows configuration for the POP3 protocol (experimental) link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/pop3server.xml[example]
** xref:configure/smtp.adoc[*smtpserver.xml*] allows configuration for the SMTP protocol link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/smtpserver.xml[example]
*** xref:configure/smtp-hooks.adoc[This page] list SMTP hooks that can be used out of the box with the Distributed Server.
** xref:configure/webadmin.adoc[*webadmin.properties*] enables configuration for the WebAdmin protocol link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/webadmin.properties[example]
** xref:configure/ssl.adoc[This page] details SSL & TLS configuration.
** xref:configure/sieve.adoc[This page] details Sieve setup and how to enable ManageSieve.

== For storage dependencies

Except specific documented cases, these files are required, at least to establish a connection with the storage components.

** xref:configure/blobstore.adoc[*blobstore.properties*] allows to configure the BlobStore link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/blob.properties[example]
** xref:configure/cassandra.adoc[*cassandra.properties*] allows to configure the Cassandra driver link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/cassandra.properties[example]
** xref:configure/opensearch.adoc[*opensearch.properties*] allows to configure OpenSearch driver link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/opensearch.properties[example]
** xref:configure/rabbitmq.adoc[*rabbitmq.properties*] allows configuration for the RabbitMQ driver link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/rabbitmq.properties[example]
** xref:configure/redis.adoc[*redis.properties*] allows configuration for the Redis driver link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/redis.properties[example], that is used by optional
distributed rate limiting component.
** xref:configure/tika.adoc[*tika.properties*] allows configuring Tika as a backend for text extraction link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/tika.properties[example]

== For core components

By omitting these files, sane default values are used.

** xref:configure/batchsizes.adoc[*batchsizes.properties*] allows to configure mailbox read batch sizes link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/batchsizes.properties[example]
** xref:configure/dns.adoc[*dnsservice.xml*] allows to configure DNS resolution link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/dnsservice.xml[example]
** xref:configure/domainlist.adoc[*domainlist.xml*] allows to configure Domain storage link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/domainlist.xml[example]
** xref:configure/healthcheck.adoc[*healthcheck.properties*] allows to configure periodical healthchecks link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/healthcheck.properties[example]
** xref:configure/mailetcontainer.adoc[*mailetcontainer.xml*] allows configuring mail processing link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/mailetcontainer.xml[example]
*** xref:configure/mailets.adoc[This page] list matchers that can be used out of the box with the Distributed Server.
*** xref:configure/matchers.adoc[This page] list matchers that can be used out of the box with the Distributed Server.
** xref:configure/mailrepositorystore.adoc[*mailrepositorystore.xml*] enables registration of allowed MailRepository protcols and link them to MailRepository implementations link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/mailrepositorystore.xml[example]
** xref:configure/recipientrewritetable.adoc[*recipientrewritetable.xml*] enables advanced configuration for the Recipient Rewrite Table component link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/recipientrewritetable.xml[example]
** xref:configure/usersrepository.adoc[*usersrepository.xml*] allows configuration of user storage link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/usersrepository.xml[example]

== For extensions

By omitting these files, no extra behaviour is added.

** xref:configure/vault.adoc[*deletedMessageVault.properties*] allows to configure the DeletedMessageVault link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/deletedMessageVault.properties[example]
** xref:configure/listeners.adoc[*listeners.xml*] enables configuration of Mailbox Listeners link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/listeners.xml[example]
** xref:configure/extensions.adoc[*extensions.properties*] allows to extend James behaviour by loading your extensions in it link:https://github.com/apache/james-project/blob/master/server/apps/distributed-app/sample-configuration/extensions.properties[example]
** xref:configure/jvm.adoc[*jvm.properties*] lets you specify additional system properties without cluttering your command line
** xref:configure/spam.adoc[This page] documents Anti-Spam setup with SpamAssassin, Rspamd.
** xref:configure/remote-delivery-error-handling.adoc[This page] proposes a simple strategy for RemoteDelivery error handling.
** xref:configure/collecting-contacts.adoc[This page] documents contact collection
** xref:configure/collecting-events.adoc[This page] documents event collection
** xref:configure/dsn.adoc[this page] specified how to support SMTP Delivery Submission Notification (link:https://tools.ietf.org/html/rfc3461[RFC-3461])

== System properties

Some tuning can be done via system properties. This includes:

.System properties
|===
| Property name | explanation

| james.message.memory.threshold
| (Optional). String (size, integer + size units, example: `12 KIB`, supported units are bytes KIB MIB GIB TIB). Defaults to 100KIB.
This governs the threshold MimeMessageInputStreamSource relies on for storing MimeMessage content on disk.
Below, data is stored in memory. Above data is stored on disk.
Lower values will lead to longer processing time but will minimize heap memory usage. Modern SSD hardware
should however support a high throughput. Higher values will lead to faster single mail processing at the cost
of higher heap usage.


| james.message.usememorycopy
|Optional. Boolean. Defaults to false. Recommended value is false.
Should MimeMessageWrapper use a copy of the message in memory? Or should bigger message exceeding james.message.memory.threshold 
be copied to temporary files?

|===