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 rd...@apache.org on 2009/09/18 08:56:09 UTC

svn commit: r816491 - /james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/core/filter/fastfail/SPFHandler.java

Author: rdonkin
Date: Fri Sep 18 06:56:09 2009
New Revision: 816491

URL: http://svn.apache.org/viewvc?rev=816491&view=rev
Log:
JAMES-923 Replace initialisation with creation when the DNS service is set. https://issues.apache.org/jira/browse/JAMES-923

Modified:
    james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/core/filter/fastfail/SPFHandler.java

Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/core/filter/fastfail/SPFHandler.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/core/filter/fastfail/SPFHandler.java?rev=816491&r1=816490&r2=816491&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/core/filter/fastfail/SPFHandler.java (original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/core/filter/fastfail/SPFHandler.java Fri Sep 18 06:56:09 2009
@@ -21,7 +21,6 @@
 
 package org.apache.james.smtpserver.core.filter.fastfail;
 
-import org.apache.avalon.framework.activity.Initializable;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
@@ -56,7 +55,7 @@
  * <checkAuthNetworks>false&lt/checkAuthNetworks> 
  * </handler>
  */
-public class SPFHandler implements LogEnabled, MailHook, RcptHook, MessageHook,Initializable, Configurable {
+public class SPFHandler implements LogEnabled, MailHook, RcptHook, MessageHook, Configurable {
     
     /** This log is the fall back shared by all instances */
     private static final Log FALLBACK_LOG = LogFactory.getLog(SPFHandler.class);
@@ -81,11 +80,9 @@
     
     private boolean blockPermError = true;
 
-    private DNSService dnsService = null;
-
     private boolean checkAuthNetworks = false;
 
-    private SPF spf;
+    private SPF spf = new DefaultSPF(new SPFLogger());
 
 
     /**
@@ -109,17 +106,6 @@
     
 
     /**
-     * @see org.apache.avalon.framework.activity.Initializable#initialize()
-     */
-    public void initialize() throws Exception {
-        if (dnsService == null) {
-            spf = new DefaultSPF(new SPFLogger());
-        } else {
-            spf = new SPF(dnsService, new SPFLogger());
-        }
-    }
-
-    /**
      * block the email on a softfail
      * 
      * @param blockSoftFail
@@ -145,7 +131,7 @@
      * @param dnsService The DNSService
      */
     public void setDNSService(DNSService dnsService) {
-        this.dnsService = dnsService;
+        spf = new SPF(dnsService, new SPFLogger());
     }
 
     /**



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