I this this configuration should be:

<domainlist autodetect="true" autodetectIP="true">
  <domain>localhost</domain>
</domainlist>

In fact there is a level we don't need anymore and we shouldn't use "servername" for a generic domain listing service.

[EMAIL PROTECTED] wrote:
+   <domainlist>
+      <!-- servernames identifies the DNS namespace served by this instance of 
James. -->
+      <!-- These servernames are used for both matcher/mailet processing and SMTP 
auth -->
+      <!-- to determine when a mail is intended for local delivery. -->
+      <!-- -->
+      <!-- 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 servernames. 
-->
+      <!-- -->
+      <!-- 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. -->
+      <!-- -->
+      <!-- To override autodetected server names simply add explicit servername 
elements. -->
+      <!-- In most cases this will be necessary. -->
+      <!-- By default, the servername '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.       
-->
+      <servernames autodetect="true" autodetectIP="true">
+         <servername>localhost</servername>
+      </servernames>
+   </domainlist>


Furthermore the current solution read the domainList only the first time.
We should probably add a "contains(String domain)" to the DomainList service so that we can make "James.isLocalServer" to delegate to DomainList and this way calls to isLocalServer will become dynamic and automatically refreshed (implementation specific).

    /**
* @see org.apache.james.services.MailServer#isLocalServer(java.lang.String)
     */
    public boolean isLocalServer( final String serverName ) {
        String lowercase = serverName.toLowerCase(Locale.US);
return "localhost".equals(serverName) || serverNames.contains(lowercase);
    }

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to