Code

Updated class sieve. Just added error messages, in some cases the sieve connection...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 5 Dec 2008 09:04:27 +0000 (09:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 5 Dec 2008 09:04:27 +0000 (09:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13168 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/sieve/class_sieve.inc

index b38fe8b2e3e341fd5e27568c85b1d2001e18078c..7eaccfa6a20a77a3e9f43120fc3c717fe6c77fa5 100644 (file)
@@ -282,10 +282,12 @@ class sieve
   function sieve_login()
   {
 
-    $this->fp=@fsockopen($this->host,$this->port);
-    if($this->fp == false)
+    $this->fp=@fsockopen($this->host,$this->port,$err_id,$err_str);
+    if($this->fp == false){
+        $this->error_raw = $err_str;
         return false;
+    }
+
     $this->line=fgets($this->fp,1024);
 
     //Hack for older versions of Sieve Server.  They do not respond with the Cyrus v2. standard
@@ -515,13 +517,16 @@ class sieve
             while(sieve::status($this->line) == F_DATA)
                $this->line=fgets($this->fp,1024);
 
-             if(sieve::status($this->line) == F_NO)
+             if(sieve::status($this->line) == F_NO){
+               $this->error_raw = "Failed to authenticate!";
                return false;
+             }
              $this->loggedin=true;
                return true;    
              break;
 
         default:
+            $this->error_raw = "Unsupported authentication method '".$this->auth_in_use."'!";
             return false;
             break;