DomainList Configuration

Consult domainlist.xml in GIT to get some examples and hints.

This configuration block is defined by the domainlist tag.

Using Spring, you must specify the DomainList class as attribute of the domainlist tag (org.apache.james.domainlist.jpa.JPADomainList, or org.apache.james.domainlist.xml.XMLDomainList, or...). This have no effect when using Guice.

JAMES-Guice uses a bundled domain list and you don't need to specify class attribute in domainlist tag

Domainnames identifies the DNS namespace served by this instance of James. These domainnames are used for both matcher/mailet processing and SMTP auth to determine when a mail is intended for local delivery - Only applicable for XMLDomainList. The entries mentionned here will be created upon start.
true or false - If autodetect is true, James wil attempt to discover its own host name AND use any explicitly specified servernames. If autodetect is false, James will use only the specified domainnames. Defaults to false.
true or false - If autodetectIP is not false, James will also allow add the IP address for each servername. The automatic IP detection is to support RFC 2821, Sec 4.1.3, address literals. Defaults to false.
Experimental. Boolean, defaults to false. Whether or not to cache domainlist.contains calls. Enable a faster execution however writes will take time to propagate.
Experimental. String (duration), defaults to 10 seconds (10s). Supported units are ms, s, m, h, d, w, month, y. Expiracy of the cache. Longer means less reads are performed to the backend but writes will take longer to propagate. Low values (a few seconds) are advised.
Set the default domain which will be used if an email is send to a recipient without a domain part. If not defaultdomain is set the first domain of the DomainList get used. If the default is not yet contained by the Domain List, the domain will be created upon start.

Please note that you can expose the DOMAIN variable to create a domain upon start without requiring further configuration.

To override autodetected domainames names simply add explicit domainname elements. In most cases this will be necessary. By default, the domainname 'localhost' is specified. This can be removed, if required.

Warning: If you are using fetchmail it is important to include the fetched domains in the server name list to prevent looping.