Better IMAP error reporting
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 29 Mar 2009 20:14:14 +0000 (14:14 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 29 Mar 2009 20:14:14 +0000 (14:14 -0600)
imp/lib/Auth/imp.php

index 351c6ca..a4294d4 100644 (file)
@@ -62,7 +62,11 @@ class Auth_imp extends Auth
             return true;
         } catch (Horde_Imap_Client_Exception $e) {
             IMP::loginLogMessage($e->getMessage(), __FILE__, __LINE__);
-            $this->_setAuthError(AUTH_REASON_BADLOGIN);
+            if ($e->getCode() == Horde_Imap_Client_Exception::SERVER_CONNECT) {
+                $this->_setAuthError(AUTH_REASON_MESSAGE, _("Could not connect to the remote server."));
+            } else {
+                $this->_setAuthError(AUTH_REASON_BADLOGIN);
+            }
             return false;
         }
     }