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 no...@apache.org on 2010/11/16 12:51:28 UTC

svn commit: r1035599 - /james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.java

Author: norman
Date: Tue Nov 16 11:51:27 2010
New Revision: 1035599

URL: http://svn.apache.org/viewvc?rev=1035599&view=rev
Log:
Correctly handle more then one account in FetchMail configuration. See JAMES-1134. Thx to Toël Hartmann for the patch and for reporting. Se committed code is based on his patch

Modified:
    james/server/trunk/fetchmail/src/main/java/org/apache/james/fetchmail/FetchMail.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=1035599&r1=1035598&r2=1035599&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 Nov 16 11:51:27 2010
@@ -460,13 +460,15 @@ public class FetchMail implements Runnab
             
             String accountsChildName = accountsChild.getName();
         
-            HierarchicalConfiguration accountsChildConfig = accounts.configurationAt(accountsChildName);
+            List<HierarchicalConfiguration> accountsChildConfig = accounts.configurationsAt(accountsChildName);
+            HierarchicalConfiguration conf = accountsChildConfig.get(i);
+            
             if ("alllocal".equals(accountsChildName))
             {
                 // <allLocal> is dynamic, save the parameters for accounts to
                 // be created when the task is triggered
                 getParsedDynamicAccountParameters().add(
-                    new ParsedDynamicAccountParameters(i, accountsChildConfig));
+                    new ParsedDynamicAccountParameters(i, conf));
                 continue;
             }
 
@@ -478,12 +480,12 @@ public class FetchMail implements Runnab
                     new Account(
                         i,
                         parsedConfiguration,
-                        accountsChildConfig.getString("[@user]"),
-                        accountsChildConfig.getString("[@password]"),
-                        accountsChildConfig.getString("[@recipient]"),
-                        accountsChildConfig.getBoolean(
+                        conf.getString("[@user]"),
+                        conf.getString("[@password]"),
+                        conf.getString("[@recipient]"),
+                        conf.getBoolean(
                             "[@ignorercpt-header]"),
-                        accountsChildConfig.getString("[@customrcpt-header]",""),
+                            conf.getString("[@customrcpt-header]",""),
                         getSession()));
                 continue;
             }



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