Code

Updated Quota progress bar.
[gosa.git] / gosa-plugins / mail / personal / mail / class_mail-methods-cyrus.inc
index dc1bc39c8bad24c5ded282d1d304c48d79854a01..152daee4d5ec2d1d74fb3b119f82c1b704143116 100644 (file)
@@ -56,9 +56,15 @@ class mailMethodCyrus extends mailMethod{
     /* Mailbox reachable? */
     if ($this->imap_handle === FALSE){
       $this->error = imap_last_error();
+
+      @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,"<b>Failed</b> :".imap_last_error(),
+        "<b>IMAP:</b> ".$cfg['admin']."@".$cfg['connect']);
+
       return (FALSE);
       $this->connected = FALSE;
     }
+    @DEBUG (DEBUG_MAIL, __LINE__, __FUNCTION__, __FILE__,"<b>successful</b>",
+        "<b>IMAP:</b> ".$cfg['admin']."@".$cfg['connect']);
     $this->connected = TRUE;
 
     return (TRUE);
@@ -107,10 +113,16 @@ class mailMethodCyrus extends mailMethod{
       return(FALSE);
     }
 
+    $this->reset_error();
+
     /* Load quota settings */
     $result = array("quotaUsage"=>"","gosaMailQuota"=>"");
     $quota_value = @imap_get_quota($this->imap_handle, $this->account_id);
 
+    /* Reset error queue, imap_qet_quota() will fail if the quota wasn't set yet.
+     */
+    imap_errors();
+
     if(is_array($quota_value) && count($quota_value)) {
       if (isset($quota_value["STORAGE"]) && is_array($quota_value["STORAGE"])){