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 bt...@apache.org on 2020/06/21 09:16:25 UTC

[james-project] 02/12: JAMES-3252 DomainList autoDection should be turned off by default

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 506d8811e954c352e9c8d69a1fdfa25d36627751
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Fri Jun 19 13:22:37 2020 +0700

    JAMES-3252 DomainList autoDection should be turned off by default
    
    Also take this opportunity to clean default domains within all configurations
---
 CHANGELOG.md                                       |  1 +
 .../cassandra-ldap/destination/conf/domainlist.xml |  7 ++--
 .../destination/conf/domainlist.xml                |  7 ++--
 .../destination/conf/domainlist.xml                |  7 ++--
 .../cassandra/destination/conf/domainlist.xml      |  7 ++--
 .../guice/jpa-smtp/destination/conf/domainlist.xml |  5 +--
 .../run/guice/jpa/destination/conf/domainlist.xml  |  7 ++--
 .../guice/memory/destination/conf/domainlist.xml   |  7 ++--
 .../run/spring/destination/conf/domainlist.xml     |  7 ++--
 server/app/src/main/resources/domainlist.xml       |  4 +--
 .../sample-configuration/domainlist.xml            |  7 ++--
 .../jpa-smtp/sample-configuration/domainlist.xml   |  7 ++--
 .../sample-configuration/domainlist.xml            |  7 ++--
 .../domainlist/lib/DomainListConfiguration.java    |  6 ++--
 .../lib/DomainListConfigurationTest.java           | 38 ++++++++++++++++++++++
 .../rrt/lib/AliasReverseResolverImplTest.java      |  4 +--
 .../apache/james/rrt/lib/CanSendFromImplTest.java  |  4 +--
 .../impl/JamesMailetContextTest.java               | 14 --------
 .../methods/SetMessagesCreationProcessorTest.java  |  4 +--
 .../methods/SetMessagesUpdateProcessorTest.java    |  9 +----
 .../james/webadmin/routes/AliasRoutesTest.java     |  4 +--
 .../james/webadmin/routes/ForwardRoutesTest.java   |  4 +--
 .../routes/DeletedMessagesVaultRoutesTest.java     |  4 +--
 .../routes/ScanningQuotaSearchExtension.java       |  4 +--
 src/site/xdoc/server/config-domainlist.xml         |  4 +--
 25 files changed, 76 insertions(+), 103 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 65505c2..37d30f9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,7 @@ of tasks being currently executed.
 - Differentiation between domain alias and domain mapping. Read upgrade instructions.
 - JAMES-3122 Log4J2 adoption for Spring product. Log file configuration needs to be updated. See upgrade instructions.
 - JAMES-2760 mailqueue.size.metricsEnabled should be false by default
+- JAMES-3252 DomainList autoDection should be turned off by default. Operators relying on implicit values for enabling DomainList autoDection now needs to explicitly configure it.
 
 ### Fixed
 - JAMES-2828 & JAMES-2929 bugs affecting JDBCMailRepository usage with PostgresSQL thanks to Jörg Thomas & Sergey B
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/conf/domainlist.xml b/dockerfiles/run/guice/cassandra-ldap/destination/conf/domainlist.xml
index 851e7cc..605439f 100644
--- a/dockerfiles/run/guice/cassandra-ldap/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/conf/domainlist.xml
@@ -21,10 +21,7 @@
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/domainlist.xml b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/domainlist.xml
index 851e7cc..605439f 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/domainlist.xml
@@ -21,10 +21,7 @@
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/domainlist.xml b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/domainlist.xml
index 851e7cc..605439f 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/domainlist.xml
@@ -21,10 +21,7 @@
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/dockerfiles/run/guice/cassandra/destination/conf/domainlist.xml b/dockerfiles/run/guice/cassandra/destination/conf/domainlist.xml
index 851e7cc..605439f 100644
--- a/dockerfiles/run/guice/cassandra/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/cassandra/destination/conf/domainlist.xml
@@ -21,10 +21,7 @@
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/conf/domainlist.xml b/dockerfiles/run/guice/jpa-smtp/destination/conf/domainlist.xml
index d897f06..2473eed 100644
--- a/dockerfiles/run/guice/jpa-smtp/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/jpa-smtp/destination/conf/domainlist.xml
@@ -19,10 +19,7 @@
  -->
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
-<domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
+<domainlist>
     <autodetect>true</autodetect>
     <autodetectIP>true</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
diff --git a/dockerfiles/run/guice/jpa/destination/conf/domainlist.xml b/dockerfiles/run/guice/jpa/destination/conf/domainlist.xml
index 851e7cc..605439f 100644
--- a/dockerfiles/run/guice/jpa/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/jpa/destination/conf/domainlist.xml
@@ -21,10 +21,7 @@
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/dockerfiles/run/guice/memory/destination/conf/domainlist.xml b/dockerfiles/run/guice/memory/destination/conf/domainlist.xml
index 851e7cc..605439f 100644
--- a/dockerfiles/run/guice/memory/destination/conf/domainlist.xml
+++ b/dockerfiles/run/guice/memory/destination/conf/domainlist.xml
@@ -21,10 +21,7 @@
 <!-- Read https://james.apache.org/server/config-domainlist.html for further details -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/dockerfiles/run/spring/destination/conf/domainlist.xml b/dockerfiles/run/spring/destination/conf/domainlist.xml
index fc64fd2..89b01d1 100644
--- a/dockerfiles/run/spring/destination/conf/domainlist.xml
+++ b/dockerfiles/run/spring/destination/conf/domainlist.xml
@@ -19,10 +19,7 @@
  -->
 
 <domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-    <domainnames>
-        <domainname>james.linagora.com</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/server/app/src/main/resources/domainlist.xml b/server/app/src/main/resources/domainlist.xml
index 4147550..e7377dc 100644
--- a/server/app/src/main/resources/domainlist.xml
+++ b/server/app/src/main/resources/domainlist.xml
@@ -45,8 +45,8 @@
 
 <!-- JPA implementation for DomainList -->
 <domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-   <autodetect>true</autodetect>
-   <autodetectIP>true</autodetectIP>
+   <autodetect>false</autodetect>
+   <autodetectIP>false</autodetectIP>
    <defaultDomain>localhost</defaultDomain>
 </domainlist>
 
diff --git a/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml b/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml
index 8d00118..89b01d1 100644
--- a/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml
+++ b/server/container/guice/jpa-smtp-mariadb/sample-configuration/domainlist.xml
@@ -19,10 +19,7 @@
  -->
 
 <domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-    <domainnames>
-        <domainname>james.apache.org</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/server/container/guice/jpa-smtp/sample-configuration/domainlist.xml b/server/container/guice/jpa-smtp/sample-configuration/domainlist.xml
index 8d00118..89b01d1 100644
--- a/server/container/guice/jpa-smtp/sample-configuration/domainlist.xml
+++ b/server/container/guice/jpa-smtp/sample-configuration/domainlist.xml
@@ -19,10 +19,7 @@
  -->
 
 <domainlist class="org.apache.james.domainlist.jpa.JPADomainList">
-    <domainnames>
-        <domainname>james.apache.org</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/server/container/guice/memory-guice/sample-configuration/domainlist.xml b/server/container/guice/memory-guice/sample-configuration/domainlist.xml
index 3dc58d2..10d8981 100644
--- a/server/container/guice/memory-guice/sample-configuration/domainlist.xml
+++ b/server/container/guice/memory-guice/sample-configuration/domainlist.xml
@@ -19,10 +19,7 @@
  -->
 
 <domainlist>
-    <domainnames>
-        <domainname>james.apache.org</domainname>
-    </domainnames>
-    <autodetect>true</autodetect>
-    <autodetectIP>true</autodetectIP>
+    <autodetect>false</autodetect>
+    <autodetectIP>false</autodetectIP>
     <defaultDomain>localhost</defaultDomain>
 </domainlist>
diff --git a/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/DomainListConfiguration.java b/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/DomainListConfiguration.java
index 892cbea..5260b68 100644
--- a/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/DomainListConfiguration.java
+++ b/server/data/data-library/src/main/java/org/apache/james/domainlist/lib/DomainListConfiguration.java
@@ -93,13 +93,15 @@ public class DomainListConfiguration {
 
         public DomainListConfiguration build() {
             return new DomainListConfiguration(
-                autoDetectIp.orElse(true),
-                autoDetect.orElse(true),
+                autoDetectIp.orElse(false),
+                autoDetect.orElse(false),
                 defaultDomain.orElse(Domain.LOCALHOST),
                 configuredDomains.build());
         }
     }
 
+    public static DomainListConfiguration DEFAULT = builder().build();
+
     public static final String CONFIGURE_AUTODETECT = "autodetect";
     public static final String CONFIGURE_AUTODETECT_IP = "autodetectIP";
     public static final String CONFIGURE_DEFAULT_DOMAIN = "defaultDomain";
diff --git a/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/DomainListConfigurationTest.java b/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/DomainListConfigurationTest.java
new file mode 100644
index 0000000..b1de7aa
--- /dev/null
+++ b/server/data/data-library/src/test/java/org/apache/james/domainlist/lib/DomainListConfigurationTest.java
@@ -0,0 +1,38 @@
+/****************************************************************
+ * 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.domainlist.lib;
+
+import org.apache.james.core.Domain;
+import org.assertj.core.api.SoftAssertions;
+import org.junit.jupiter.api.Test;
+
+class DomainListConfigurationTest {
+    @Test
+    void buildShouldDefaultToDefaultProperties() {
+        DomainListConfiguration actual = DomainListConfiguration.builder().build();
+
+        SoftAssertions.assertSoftly(softly -> {
+            softly.assertThat(actual.isAutoDetect()).isFalse();
+            softly.assertThat(actual.isAutoDetectIp()).isFalse();
+            softly.assertThat(actual.getConfiguredDomains()).isEmpty();
+            softly.assertThat(actual.getDefaultDomain()).isEqualTo(Domain.LOCALHOST);
+        });
+    }
+}
\ No newline at end of file
diff --git a/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/AliasReverseResolverImplTest.java b/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/AliasReverseResolverImplTest.java
index 35e7cda..1bbca6e 100644
--- a/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/AliasReverseResolverImplTest.java
+++ b/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/AliasReverseResolverImplTest.java
@@ -42,9 +42,7 @@ public class AliasReverseResolverImplTest implements AliasReverseResolverContrac
 
         DNSService dnsService = mock(DNSService.class);
         MemoryDomainList domainList = new MemoryDomainList(dnsService);
-        domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false));
+        domainList.configure(DomainListConfiguration.DEFAULT);
         domainList.addDomain(DOMAIN);
         domainList.addDomain(OTHER_DOMAIN);
         recipientRewriteTable.setDomainList(domainList);
diff --git a/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/CanSendFromImplTest.java b/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/CanSendFromImplTest.java
index 55e339f..8d9b47e 100644
--- a/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/CanSendFromImplTest.java
+++ b/server/data/data-memory/src/test/java/org/apache/james/rrt/lib/CanSendFromImplTest.java
@@ -43,9 +43,7 @@ public class CanSendFromImplTest implements CanSendFromContract {
 
         DNSService dnsService = mock(DNSService.class);
         MemoryDomainList domainList = new MemoryDomainList(dnsService);
-        domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false));
+        domainList.configure(DomainListConfiguration.DEFAULT);
         domainList.addDomain(DOMAIN);
         domainList.addDomain(OTHER_DOMAIN);
         recipientRewriteTable.setDomainList(domainList);
diff --git a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailetContextTest.java b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailetContextTest.java
index 0215f09..3434d08 100644
--- a/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailetContextTest.java
+++ b/server/mailet/mailetcontainer-camel/src/test/java/org/apache/james/mailetcontainer/impl/JamesMailetContextTest.java
@@ -84,8 +84,6 @@ public class JamesMailetContextTest {
     public void setUp() throws Exception {
         domainList = spy(new MemoryDomainList(DNS_SERVICE));
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .build());
 
         usersRepository = spy(MemoryUsersRepository.withVirtualHosting(domainList));
@@ -130,8 +128,6 @@ public class JamesMailetContextTest {
     @Test
     public void isLocalUserShouldPropagateUserExceptions() throws Exception {
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .defaultDomain(Domain.of("any"))
             .build());
         domainList.addDomain(DOMAIN_COM);
@@ -145,8 +141,6 @@ public class JamesMailetContextTest {
     @Test
     public void isLocalUserShouldPropagateRrtExceptions() throws Exception {
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .defaultDomain(Domain.of("any"))
             .build());
         domainList.addDomain(DOMAIN_COM);
@@ -175,8 +169,6 @@ public class JamesMailetContextTest {
     @Test
     public void isLocalUserShouldReturnTrueWhenUsedWithLocalPartAndUserExistOnDefaultDomain() throws Exception {
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .defaultDomain(DOMAIN_COM)
             .build());
 
@@ -188,8 +180,6 @@ public class JamesMailetContextTest {
     @Test
     public void isLocalUserShouldReturnFalseWhenUsedWithLocalPartAndUserDoNotExistOnDefaultDomain() throws Exception {
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .defaultDomain(Domain.of("any"))
             .build());
 
@@ -271,8 +261,6 @@ public class JamesMailetContextTest {
     @Test
     public void isLocalEmailShouldPropagateUserExceptions() throws Exception {
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .defaultDomain(Domain.of("any"))
             .build());
         domainList.addDomain(DOMAIN_COM);
@@ -286,8 +274,6 @@ public class JamesMailetContextTest {
     @Test
     public void isLocalEmailShouldPropagateRrtExceptions() throws Exception {
         domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false)
             .defaultDomain(Domain.of("any"))
             .build());
         domainList.addDomain(DOMAIN_COM);
diff --git a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesCreationProcessorTest.java b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesCreationProcessorTest.java
index 430034e..fd3fd85 100644
--- a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesCreationProcessorTest.java
+++ b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesCreationProcessorTest.java
@@ -150,9 +150,7 @@ public class SetMessagesCreationProcessorTest {
 
         DNSService dnsService = mock(DNSService.class);
         MemoryDomainList domainList = new MemoryDomainList(dnsService);
-        domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false));
+        domainList.configure(DomainListConfiguration.DEFAULT);
         domainList.addDomain(Domain.of("example.com"));
         domainList.addDomain(Domain.of("other.org"));
         recipientRewriteTable.setDomainList(domainList);
diff --git a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesUpdateProcessorTest.java b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesUpdateProcessorTest.java
index 4741acb..d6dd11c 100644
--- a/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesUpdateProcessorTest.java
+++ b/server/protocols/jmap-draft/src/test/java/org/apache/james/jmap/draft/methods/SetMessagesUpdateProcessorTest.java
@@ -47,7 +47,6 @@ import org.apache.james.jmap.draft.model.SetMessagesRequest;
 import org.apache.james.jmap.draft.model.SetMessagesResponse;
 import org.apache.james.jmap.draft.model.UpdateMessagePatch;
 import org.apache.james.jmap.draft.send.MailSpool;
-import org.apache.james.jmap.draft.utils.JsoupHtmlTextExtractor;
 import org.apache.james.mailbox.BlobManager;
 import org.apache.james.mailbox.MailboxManager;
 import org.apache.james.mailbox.MailboxSession;
@@ -73,8 +72,6 @@ import org.apache.james.rrt.lib.AliasReverseResolverImpl;
 import org.apache.james.rrt.lib.CanSendFromImpl;
 import org.apache.james.rrt.lib.MappingSource;
 import org.apache.james.rrt.memory.MemoryRecipientRewriteTable;
-import org.apache.james.util.html.HtmlTextExtractor;
-import org.apache.james.util.mime.MessageContentExtractor;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -154,8 +151,6 @@ public class SetMessagesUpdateProcessorTest {
 
     @Before
     public void setUp() throws MailboxException, DomainListException, UnknownHostException, ConfigurationException {
-        MessageContentExtractor messageContentExtractor = new MessageContentExtractor();
-        HtmlTextExtractor htmlTextExtractor = new JsoupHtmlTextExtractor();
         BlobManager blobManager = mock(BlobManager.class);
         when(blobManager.toBlobId(any(MessageId.class))).thenReturn(org.apache.james.mailbox.model.BlobId.fromString("fake"));
         MessageIdManager messageIdManager = mock(MessageIdManager.class);
@@ -163,9 +158,7 @@ public class SetMessagesUpdateProcessorTest {
 
         DNSService dnsService = mock(DNSService.class);
         MemoryDomainList domainList = new MemoryDomainList(dnsService);
-        domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false));
+        domainList.configure(DomainListConfiguration.DEFAULT);
         domainList.addDomain(Domain.of("example.com"));
         domainList.addDomain(Domain.of("other.org"));
         recipientRewriteTable.setDomainList(domainList);
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java
index d17afd2..6128a58 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/AliasRoutesTest.java
@@ -108,9 +108,7 @@ class AliasRoutesTest {
             memoryRecipientRewriteTable = new MemoryRecipientRewriteTable();
             DNSService dnsService = mock(DNSService.class);
             domainList = new MemoryDomainList(dnsService);
-            domainList.configure(DomainListConfiguration.builder()
-                .autoDetect(false)
-                .autoDetectIp(false));
+            domainList.configure(DomainListConfiguration.DEFAULT);
             domainList.addDomain(DOMAIN);
             domainList.addDomain(ALIAS_DOMAIN);
             domainList.addDomain(DOMAIN_MAPPING);
diff --git a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java
index 8425f92..6c3dac7 100644
--- a/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/ForwardRoutesTest.java
@@ -107,9 +107,7 @@ class ForwardRoutesTest {
             memoryRecipientRewriteTable = new MemoryRecipientRewriteTable();
             DNSService dnsService = mock(DNSService.class);
             domainList = new MemoryDomainList(dnsService);
-            domainList.configure(DomainListConfiguration.builder()
-                .autoDetect(false)
-                .autoDetectIp(false));
+            domainList.configure(DomainListConfiguration.DEFAULT);
             domainList.addDomain(DOMAIN);
             domainList.addDomain(ALIAS_DOMAIN);
             domainList.addDomain(DOMAIN_MAPPING);
diff --git a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
index 0c12862..a5ff748 100644
--- a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/test/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRoutesTest.java
@@ -212,9 +212,7 @@ class DeletedMessagesVaultRoutesTest {
     private MemoryUsersRepository createUsersRepository() throws Exception {
         DNSService dnsService = mock(DNSService.class);
         MemoryDomainList domainList = new MemoryDomainList(dnsService);
-        domainList.configure(DomainListConfiguration.builder()
-            .autoDetect(false)
-            .autoDetectIp(false));
+        domainList.configure(DomainListConfiguration.DEFAULT);
         domainList.addDomain(DOMAIN);
 
         MemoryUsersRepository usersRepository = MemoryUsersRepository.withVirtualHosting(domainList);
diff --git a/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ScanningQuotaSearchExtension.java b/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ScanningQuotaSearchExtension.java
index 997476c..3f1848e 100644
--- a/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ScanningQuotaSearchExtension.java
+++ b/server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ScanningQuotaSearchExtension.java
@@ -50,9 +50,7 @@ public class ScanningQuotaSearchExtension implements ParameterResolver, BeforeEa
 
             DNSService dnsService = mock(DNSService.class);
             MemoryDomainList domainList = new MemoryDomainList(dnsService);
-            domainList.configure(DomainListConfiguration.builder()
-                .autoDetect(false)
-                .autoDetectIp(false));
+            domainList.configure(DomainListConfiguration.DEFAULT);
             MemoryUsersRepository usersRepository = MemoryUsersRepository.withVirtualHosting(domainList);
 
 
diff --git a/src/site/xdoc/server/config-domainlist.xml b/src/site/xdoc/server/config-domainlist.xml
index 8337e0d..eb0e61d 100644
--- a/src/site/xdoc/server/config-domainlist.xml
+++ b/src/site/xdoc/server/config-domainlist.xml
@@ -43,10 +43,10 @@ to determine when a mail is intended for local delivery - Only applicable for XM
         <dt><strong>autodetect</strong></dt>
         <dd>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.</dd>
+If autodetect is false, James will use only the specified domainnames. Defaults to false.</dd>
         <dt><strong>autodetectIP</strong></dt>
         <dd>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.</dd>
+The automatic IP detection is to support RFC 2821, Sec 4.1.3, address literals. Defaults to false.</dd>
         <dt><strong>defaultDomain</strong></dt>
         <dd>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.</dd>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org