steffen: server/kolab-resource-handlers/kolab-resource-handlers/resmgr kolabmailtransport.php, 1.8, 1.9 misc.php, 1.4, 1.5

cvs at intevation.de cvs at intevation.de
Mon May 22 12:49:31 CEST 2006


Author: steffen

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

Modified Files:
	kolabmailtransport.php misc.php 
Log Message:
Fix for Issue1195 (error message in bounce)

Index: kolabmailtransport.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/kolabmailtransport.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- kolabmailtransport.php	8 Mar 2006 20:18:40 -0000	1.8
+++ kolabmailtransport.php	22 May 2006 10:49:29 -0000	1.9
@@ -42,7 +42,8 @@
     }
 
     if (PEAR::isError($error = $this->transport->mailFrom($sender))) {
-      return new PEAR_Error('Failed to set sender: ' . $error->getMessage(), $this->transport->_code );
+      $resp = $this->transport->getResponse();
+      return new PEAR_Error('Failed to set sender: ' . $resp[1], $resp[0] );
     }
     
     if( !is_array( $recips ) ) $recips = array($recips);
@@ -50,9 +51,10 @@
     $reciperrors = array();
     foreach( $recips as $recip ) {
       if (PEAR::isError($error = $this->transport->rcptTo($recip))) {
-		$msg = "Failed to set recipient $recip: " . $error->getMessage(). ", code=".$this->transport->_code;;
-		myLog($msg, RM_LOG_ERROR);
-		$reciperrors[] = new PEAR_Error('Failed to set recipient: '.$error->getMessage(), $this->transport->_code);
+	$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) ) {

Index: misc.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/misc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- misc.php	2 Apr 2005 02:47:34 -0000	1.4
+++ misc.php	22 May 2006 10:49:29 -0000	1.5
@@ -178,7 +178,7 @@
 	  $i++;
 	}
 	$i--;
-	if( is_array( $ret[$arg[1]] ) ) $ret[$arg[1]] = array_merge($ret[$arg[1]] ,$val);
+	if( array_key_exists($arg[1],$ret) && is_array( $ret[$arg[1]] ) ) $ret[$arg[1]] = array_merge($ret[$arg[1]] ,$val);
 	else if( count($val) == 1 ) $ret[$arg[1]] = $val[0];
 	else $ret[$arg[1]] = $val;
       }
@@ -187,4 +187,4 @@
   return $ret;
 }
 
-?>
\ No newline at end of file
+?>





More information about the commits mailing list