Index: RemoteAddrInNetwork.java
===================================================================
RCS file: /home/cvspublic/jakarta-james/src/java/org/apache/james/transport/matchers/RemoteAddrInNetwork.java,v
retrieving revision 1.2
diff -u -r1.2 RemoteAddrInNetwork.java
--- RemoteAddrInNetwork.java	18 Jan 2002 02:48:38 -0000	1.2
+++ RemoteAddrInNetwork.java	7 Jun 2002 05:53:43 -0000
@@ -20,13 +20,13 @@
 
 /**
  * Checks the IP address of the sending server against a comma-
- * delimited list of  IP addresses.
+ * delimited list of IP addresses or domain names.
  * <P>Networks should be indicated with a wildcard *, e.g. 192.168.* 
  * <br>Note: The wildcard can go at any level, the matcher will match if the
  * sending host's IP address (as a String based on the octet representation)
  * starts with the String indicated in the configuration file, excluding the
  * wildcard.
- * <p>Multiple addresses can be indicated, e.g: '127.0.0.1,192.168.*'
+ * <p>Multiple addresses can be indicated, e.g: '127.0.0.1,192.168.*,domain.tld'
  *
  * @author  Serge Knystautas <sergek@lokitech.com>
  */
@@ -46,10 +46,16 @@
                 } catch (UnknownHostException uhe) {
                 }
             }
-            if (addr.endsWith("*")) {
-                addr = addr.substring(0, addr.length() - 1);
+
+            try {
+                if (addr.endsWith("*")) {
+                    addr = addr.substring(0, addr.length() - 1);
+                }
+                else addr = InetAddress.getByName(addr).getHostAddress();
+                networks.add(addr);
+            } catch (UnknownHostException uhe) {
+                log("Cannot match against invalid domain: " + uhe.getMessage());
             }
-            networks.add(addr);
         }
     }
 

