[Svn] r1960 - in trunk/roundcubemail: . program/lib

trac at roundcube.net trac at roundcube.net
Wed Oct 8 15:26:42 CEST 2008


Author: alec
Date: 2008-10-08 08:26:42 -0500 (Wed, 08 Oct 2008)
New Revision: 1960

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/lib/imap.inc
Log:
- Fix imap searching on ISMail (#1485466)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2008-10-08 13:12:34 UTC (rev 1959)
+++ trunk/roundcubemail/CHANGELOG	2008-10-08 13:26:42 UTC (rev 1960)
@@ -1,6 +1,11 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+2008/10/08 (alec)
+----------
+- Fix imap searching on ISMail server (#1485466)
+- Add css class for flagged messages (#1485464)
+
 2008/10/07 (alec)
 ----------
 - Write username instead of id in sendmail log (#1485477)

Modified: trunk/roundcubemail/program/lib/imap.inc
===================================================================
--- trunk/roundcubemail/program/lib/imap.inc	2008-10-08 13:12:34 UTC (rev 1959)
+++ trunk/roundcubemail/program/lib/imap.inc	2008-10-08 13:26:42 UTC (rev 1960)
@@ -66,6 +66,7 @@
 		  optional resposne in iil_Connect(), added iil_C_GetCapability()
 		- remove 'undisclosed-recipients' string from 'To' header
 		- iil_C_HandlePartBody(): added 6th argument and fixed endless loop
+		- added iil_PutLineC() 
 
 ********************************************************/
 
@@ -189,10 +190,30 @@
 }
 
 function iil_PutLine($fp, $string, $endln=true) {
-//	console('C: '. $string);
-	return fputs($fp, $string . ($endln ? "\r\n" : ''));
+//      console('C: '. rtrim($string));
+        return fputs($fp, $string . ($endln ? "\r\n" : ''));
 }
 
+// iil_PutLine replacement with Command Continuation Requests (RFC3501 7.5) support
+function iil_PutLineC($fp, $string, $endln=true) {
+	if ($endln)
+		$string .= "\r\n";
+
+	$res = 0;
+	if ($parts = preg_split('/(\{[0-9]+\}\r\n)/m', $string, -1, PREG_SPLIT_DELIM_CAPTURE)) {
+		for($i=0, $cnt=count($parts); $i<$cnt; $i++) {
+			if(preg_match('/^\{[0-9]+\}\r\n$/', $parts[$i+1])) {
+				$res += iil_PutLine($fp, $parts[$i].$parts[$i+1], false);
+				$line = iil_ReadLine($fp, 1000);
+				$i++;
+			}
+			else
+				$res += iil_PutLine($fp, $parts[$i], false);
+		}
+	}
+	return $res;
+}
+
 function iil_ReadLine($fp, $size) {
 	$line = '';
 
@@ -2062,7 +2083,7 @@
 		$c = 0;
 		
 		$query = 'srch1 SEARCH ' . chop($criteria);
-		iil_PutLine($fp, $query);
+		iil_PutLineC($fp, $query);
 		do {
 			$line=trim(iil_ReadLine($fp, 10000));
 			if (eregi("^\* SEARCH", $line)) {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list