james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r425371 - /james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
Date Tue, 25 Jul 2006 11:01:13 GMT
Author: norman
Date: Tue Jul 25 04:01:13 2006
New Revision: 425371

URL: http://svn.apache.org/viewvc?rev=425371&view=rev
Log:
DNSRBLHandler throws now an ConfigurationException on invalid configuration. See JAMES-578

Modified:
    james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java

Modified: james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java?rev=425371&r1=425370&r2=425371&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
(original)
+++ james/server/trunk/src/java/org/apache/james/smtpserver/core/filter/fastfail/DNSRBLHandler.java
Tue Jul 25 04:01:13 2006
@@ -61,6 +61,7 @@
      * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
      */
     public void configure(Configuration handlerConfiguration) throws ConfigurationException
{
+        boolean validConfig = false;
 
         Configuration rblserverConfiguration = handlerConfiguration.getChild("rblservers",
false);
         if ( rblserverConfiguration != null ) {
@@ -77,6 +78,7 @@
                 if (rblserverCollection != null && rblserverCollection.size() >
0) {
                     setWhitelist((String[]) rblserverCollection.toArray(new String[rblserverCollection.size()]));
                     rblserverCollection.clear();
+                    validConfig = true;
                 }
             }
             children = rblserverConfiguration.getChildren("blacklist");
@@ -91,8 +93,14 @@
                 if (rblserverCollection != null && rblserverCollection.size() >
0) {
                     setBlacklist((String[]) rblserverCollection.toArray(new String[rblserverCollection.size()]));
                     rblserverCollection.clear();
+                    validConfig = true;
                 }
             }
+        }
+        
+        // Throw an ConfiigurationException on invalid config
+        if (validConfig == false){
+            throw new ConfigurationException("Please configure whitelist or blacklist");
         }
         
         Configuration configuration = handlerConfiguration.getChild("getDetail",false);



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


Mime
View raw message