Author: norman
Date: Mon Nov 30 19:53:58 2009
New Revision: 885569

URL: http://svn.apache.org/viewvc?rev=885569&view=rev
Log:
Only send idle command if the store supports it (HUPA-56)

Modified:
    
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java

Modified: 
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java?rev=885569&r1=885568&r2=885569&view=diff
==============================================================================
--- 
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java
 (original)
+++ 
james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/NoopHandler.java
 Mon Nov 30 19:53:58 2009
@@ -19,6 +19,7 @@
 
 package org.apache.hupa.server.handler;
 
+import javax.mail.MessagingException;
 import javax.servlet.http.HttpSession;
 
 import net.customware.gwt.dispatch.server.ExecutionContext;
@@ -55,10 +56,16 @@
             throws ActionException {
         try {
             IMAPStore store = cache.get(getUser());
+            
             if (store.getURLName() != null &&
                 
!DemoModeConstants.DEMO_MODE.equals(store.getURLName().getHost()) ) {
-                // just send a noop to keep the connection alive
-                store.idle();
+               
+                // check if the store supports the IDLE command
+                if (store.hasCapability("IDLE")) {
+                    // just send a noop to keep the connection alive
+                    store.idle();
+                }
+               
             }
             return new NoopResult();
         } catch (Exception e) {



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

Reply via email to