steffen: server/kolab-resource-handlers/kolab-resource-handlers/resmgr kolabmailtransport.php, 1.3.2.1, 1.3.2.2

cvs at intevation.de cvs at intevation.de
Thu Dec 22 18:48:21 CET 2005


Author: steffen

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

Modified Files:
      Tag: kolab_2_0_branch
	kolabmailtransport.php 
Log Message:
Fix for Issue1042 (dot-escaping bug)

Index: kolabmailtransport.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/resmgr/kolabmailtransport.php,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -d -r1.3.2.1 -r1.3.2.2
--- kolabmailtransport.php	28 Jul 2005 02:20:36 -0000	1.3.2.1
+++ kolabmailtransport.php	22 Dec 2005 17:48:19 -0000	1.3.2.2
@@ -32,6 +32,7 @@
   function start($sender,$recips) {
     $this->createTransport();
     $myclass = get_class($this->transport);
+    $this->got_newline = false;
 
     if (!$this->transport) {
       return new PEAR_Error('Failed to connect to $myclass: ' . $error->getMessage(), 421);
@@ -99,8 +100,10 @@
      * Because a single leading period (.) signifies an end to the data,
      * legitimate leading periods need to be "doubled" (e.g. '..').
      */
-    if( $data[0] == '.' ) $data = '.'.$data;
+    if( $this->got_newline && $data[0] == '.' ) $data = '.'.$data;
     $data = str_replace("\n.", "\n..", $data);
+    if( $data[count($data)] == "\n" ) $this->got_newline = true;
+    else $this->got_newline = false;
   }
 
   function data( $data) {
@@ -126,6 +129,7 @@
   var $host;
   var $port;
   var $transport;
+  var $got_newline;
 };
 
 class KolabLMTP extends KolabMailTransport {





More information about the commits mailing list