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 ma...@apache.org on 2012/05/04 13:00:04 UTC

svn commit: r1333874 - in /james/hupa/trunk/server/src/main/java/org/apache/hupa/server: InMemoryIMAPStoreCache.java guice/GuiceServletConfig.java

Author: manolo
Date: Fri May  4 11:00:04 2012
New Revision: 1333874

URL: http://svn.apache.org/viewvc?rev=1333874&view=rev
Log:
Append domain to gmail accounts. Configuration in user home was not being read

Modified:
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
    james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java?rev=1333874&r1=1333873&r2=1333874&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/InMemoryIMAPStoreCache.java Fri May  4 11:00:04 2012
@@ -92,7 +92,13 @@ public class InMemoryIMAPStoreCache impl
      * @see org.apache.hupa.server.IMAPStoreCache#get(org.apache.hupa.shared.data.User)
      */
     public IMAPStore get(User user) throws MessagingException {
-        return get(user.getName(),user.getPassword());
+    	IMAPStore ret =  get(user.getName(),user.getPassword());
+    	
+    	// TODO: this is a hack, we should have a default domain suffix in configuration files
+    	if (address.contains("gmail.com") && !user.getName().contains("@")) {
+    		user.setName(user.getName() + "@gmail.com");
+    	}
+    	return ret;
     }
     
     /*

Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java?rev=1333874&r1=1333873&r2=1333874&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/guice/GuiceServletConfig.java Fri May  4 11:00:04 2012
@@ -106,7 +106,7 @@ public class GuiceServletConfig extends 
         if (demoHostName == null || System.getProperty(demoHostName) == null) {
         	List<String> configurationList = new ArrayList<String>();
             configurationList.add(System.getProperty(SYS_PROP_CONFIG_FILE));
-            configurationList.add(System.getProperty(System.getenv("HOME") + "/.hupa/" + CONFIG_FILE_NAME));
+            configurationList.add(System.getenv("HOME") + "/.hupa/" + CONFIG_FILE_NAME);
             configurationList.add("/etc/default/hupa");
             configurationList.add(servletContextRealPath + "/" + CONFIG_DIR_IN_WAR + CONFIG_FILE_NAME);
 



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