From f3b659935f3386c077746cd7a84770532ed0ec50 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sun, 23 Oct 2005 10:39:09 -0400
Subject: [PATCH] Added patches for default language and sorting function

---
 program/lib/imap.inc |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 3d37bed..fc5ff09 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -52,6 +52,7 @@
 	var $recent;
 	var $rootdir;
 	var $delimiter;
+	var $capability = array();
 }
 
 class iilBasicHeader{
@@ -246,6 +247,9 @@
 function iil_C_NameSpace(&$conn){
 	global $my_prefs;
 	
+	if (!in_array('NAMESPACE', $conn->capability))
+	  return false;
+	
 	if ($my_prefs["rootdir"]) return true;
 	
 	fputs($conn->fp, "ns1 NAMESPACE\r\n");
@@ -334,7 +338,7 @@
 
 	$iil_error.="Socket connection established\r\n";
 	$line=iil_ReadLine($conn->fp, 300);
-						
+
 	if (strcasecmp($auth_method, "check")==0){
 		//check for supported auth methods
 		
@@ -349,6 +353,8 @@
 			$a = explode(" ", $line);
 			if ($line[0]=="*"){
 				while ( list($k, $w) = each($a) ){
+				    if ($w!='*' && $w!='CAPABILITY')
+    					$conn->capability[] = $w;
 					if ((strcasecmp($w, "AUTH=CRAM_MD5")==0)||
 						(strcasecmp($w, "AUTH=CRAM-MD5")==0)){
 							$auth_method = "auth";

--
Gitblit v1.9.1