steffen: server/kolab-resource-handlers/kolab-resource-handlers/resmgr kolabmailtransport.php, 1.10, 1.11

cvs at kolab.org cvs at kolab.org
Fri Sep 22 14:25:13 CEST 2006


Author: steffen

Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr
In directory doto:/tmp/cvs-serv15976

Modified Files:
	kolabmailtransport.php 
Log Message:
formatting

Index: kolabmailtransport.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/kolabmailtransport.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- kolabmailtransport.php	19 Jul 2006 17:54:18 -0000	1.10
+++ kolabmailtransport.php	22 Sep 2006 12:25:11 -0000	1.11
@@ -51,43 +51,44 @@
     $reciperrors = array();
     foreach( $recips as $recip ) {
       if (PEAR::isError($error = $this->transport->rcptTo($recip))) {
-	$resp = $this->transport->getResponse();
-	$msg = "Failed to set recipient $recip: " .$resp[1]. ", code=".$resp[0];
-	myLog($msg, RM_LOG_ERROR);
-	$reciperrors[] = new PEAR_Error('Failed to set recipient: '.$resp[1], $resp[0]);
+        $resp = $this->transport->getResponse();
+        $msg = "Failed to set recipient $recip: " .$resp[1]. ", code=".$resp[0];
+        myLog($msg, RM_LOG_ERROR);
+        $reciperrors[] = new PEAR_Error('Failed to set recipient: '.$resp[1], $resp[0]);
       }
     }
-	if( count($reciperrors) == count($recips) ) {
-	  // OK, all failed, just give up
-	  if( count($reciperrors) == 1 ) {
-		// Only one failure, just return that
-		return $reciperrors[0];
-	  }
-	  // Multiple errors
-	  return $this->createErrorObject( $reciperrors, 'Delivery to all recipients failed' );
-	}
+    if( count($reciperrors) == count($recips) ) {
+      // OK, all failed, just give up
+      if( count($reciperrors) == 1 ) {
+        // Only one failure, just return that
+        return $reciperrors[0];
+      }
+      // Multiple errors
+      return $this->createErrorObject( $reciperrors, 'Delivery to all recipients failed' );
+    }
+
     if (PEAR::isError($error = $this->transport->_put('DATA'))) {      
       return $error;
     }
     if (PEAR::isError($error = $this->transport->_parseResponse(354))) {
       return $error;
     }
-	if( !empty($reciperrors) ) {
-	  return $this->createErrorObject( $reciperrors, 'Delivery to some recipients failed' );
-	}
+    if( !empty($reciperrors) ) {
+      return $this->createErrorObject( $reciperrors, 'Delivery to some recipients failed' );
+    }
     return true;
   }
 
   // Encapsulate multiple errors in one
   function createErrorObject( $reciperrors, $msg = null ) {
-	// Return the lowest errorcode to not bounce more
-	// than we have to
-	if($msg == null) $msg = 'Delivery to recipients failed.';
-	$code = 1000;
-	foreach( $reciperrors as $err ) {
-	  if( $err->code < $code ) $code = $err->code;
-	}
-	return new PEAR_Error( $msg, $code, null, null, $reciperrors);	
+        // Return the lowest errorcode to not bounce more
+        // than we have to
+        if($msg == null) $msg = 'Delivery to recipients failed.';
+        $code = 1000;
+        foreach( $reciperrors as $err ) {
+          if( $err->code < $code ) $code = $err->code;
+        }
+        return new PEAR_Error( $msg, $code, null, null, $reciperrors);  
   }
 
   /* Modified implementation from Net_SMTP that supports
@@ -123,9 +124,9 @@
 
   function end() {
     if ($this->got_newline) 
-    	$dot = ".\r\n";
+        $dot = ".\r\n";
     else
-    	$dot = "\r\n.\r\n";
+        $dot = "\r\n.\r\n";
 
     if (PEAR::isError($this->transport->_send($dot))) {
       return new PEAR_Error('write to socket failed');





More information about the commits mailing list