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

trac at roundcube.net trac at roundcube.net
Thu Feb 5 18:43:54 CET 2009


Author: alec
Date: 2009-02-05 11:43:54 -0600 (Thu, 05 Feb 2009)
New Revision: 2273

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/lib/imap.inc
Log:
- Support NGINX as IMAP backend: better BAD response handling (#1485720)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2009-02-04 11:22:52 UTC (rev 2272)
+++ trunk/roundcubemail/CHANGELOG	2009-02-05 17:43:54 UTC (rev 2273)
@@ -1,6 +1,10 @@
 CHANGELOG RoundCube Webmail
 ---------------------------
 
+2009/02/05 (alec)
+----------
+- Support NGINX as IMAP backend: better BAD response handling (#1485720)
+
 2009/02/04 (alec)
 ----------
 - performance fix: don't fetch attachment parts headers twice to parse filename

Modified: trunk/roundcubemail/program/lib/imap.inc
===================================================================
--- trunk/roundcubemail/program/lib/imap.inc	2009-02-04 11:22:52 UTC (rev 2272)
+++ trunk/roundcubemail/program/lib/imap.inc	2009-02-05 17:43:54 UTC (rev 2273)
@@ -68,7 +68,7 @@
 		- iil_C_HandlePartBody(): added 6th argument and fixed endless loop
 		- added iil_PutLineC() 
 		- fixed iil_C_Sort() to support very long and/or divided responses
-		- added BYE response simple support for endless loop prevention
+		- added BYE/BAD response simple support for endless loop prevention
 		- added 3rd argument in iil_StartsWith* functions
 		- fix iil_C_FetchPartHeader() in some cases by use of iil_C_HandlePartBody()
 		- allow iil_C_HandlePartBody() to fetch whole message
@@ -307,8 +307,8 @@
 	return -4;
 }
 
-// check if $string starts with $match
-function iil_StartsWith($string, $match, $bye=false) {
+// check if $string starts with $match (or * BYE/BAD)
+function iil_StartsWith($string, $match, $error=false) {
 	$len = strlen($match);
 	if ($len == 0) {
 		return false;
@@ -316,7 +316,7 @@
 	if (strncmp($string, $match, $len) == 0) {
 		return true;
 	}
-	if ($bye && strncmp($string, '* BYE ', 6) == 0) {
+	if ($error && preg_match('/^\* (BYE|BAD) /', $string)) {
 		return true;
 	}
 	return false;

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



More information about the Svn mailing list