Author: norman
Date: Tue Dec 28 17:47:38 2010
New Revision: 1053400

URL: http://svn.apache.org/viewvc?rev=1053400&view=rev
Log:
Fix NPE in FetchMail. See JAMES-1157

Modified:
    
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.java
    
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchScheduler.java

Modified: 
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.java?rev=1053400&r1=1053399&r2=1053400&view=diff
==============================================================================
--- 
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.java
 (original)
+++ 
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.java
 Tue Dec 28 17:47:38 2010
@@ -39,6 +39,7 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.HierarchicalConfiguration.Node;
 import org.apache.commons.logging.Log;
 import org.apache.james.dnsservice.api.DNSService;
+import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.lifecycle.api.LogEnabled;
 import org.apache.james.queue.api.MailQueue;
@@ -401,6 +402,8 @@ public class FetchMail implements Runnab
     private Log logger;
 
     private MailQueue queue;
+
+    private DomainList domainList;
     
     /**
      * Constructor for POP3mail.
@@ -432,6 +435,8 @@ public class FetchMail implements Runnab
                 logger,
                 getLocalUsers(),
                 getDNSService());
+        parsedConfiguration.setDomainList(domainList);
+        
         setParsedConfiguration(parsedConfiguration);
 
         // Setup the Accounts
@@ -983,4 +988,8 @@ public class FetchMail implements Runnab
         return queue;
     }
 
+    public void setDomainList(DomainList domainList) {
+        this.domainList = domainList;
+    }
+
 }

Modified: 
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchScheduler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchScheduler.java?rev=1053400&r1=1053399&r2=1053400&view=diff
==============================================================================
--- 
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchScheduler.java
 (original)
+++ 
james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchScheduler.java
 Tue Dec 28 17:47:38 2010
@@ -36,6 +36,7 @@ import org.apache.commons.configuration.
 import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.james.dnsservice.api.DNSService;
+import org.apache.james.domainlist.api.DomainList;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.lifecycle.api.LogEnabled;
 import org.apache.james.queue.api.MailQueue;
@@ -81,6 +82,9 @@ public class FetchScheduler implements F
 
     private MailQueue queue;
     private MailQueueFactory queueFactory;
+
+
+    private DomainList domainList;
  
 
     
@@ -100,6 +104,13 @@ public class FetchScheduler implements F
     public void setUsersRepository(UsersRepository urepos) {
         this.urepos = urepos;
     }
+
+
+    
+    @Resource(name="domainlist")
+    public void setDomainList(DomainList domainList) {
+        this.domainList = domainList;
+    }
     
     /*
      * (non-Javadoc)
@@ -145,6 +156,8 @@ public class FetchScheduler implements F
                 fetcher.setDNSService(dns);
                 fetcher.setUsersRepository(urepos);
                 fetcher.setMailQueue(queue);
+                fetcher.setDomainList(domainList);
+
                 fetcher.configure(fetchConf);
                 
                 // initialize scheduling



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to