cvs: pear /Net_IMAP IMAPProtocol.php
| From: | Anish Mistry | Date: | Wed, 22 Mar 2006 05:00:20 +0000 |
| Subject: | cvs: pear /Net_IMAP IMAPProtocol.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39234@lists.php.net to get a copy of this message | ||
amistry Wed Mar 22 05:00:20 2006 UTC
Modified files:
/pear/Net_IMAP IMAPProtocol.php
Log:
Fix Request #2657.
http://cvs.php.net/viewcvs.cgi/pear/Net_IMAP/IMAPProtocol.php?r1=1.4&r2=1.5&diff_format=u
Index: pear/Net_IMAP/IMAPProtocol.php
diff -u pear/Net_IMAP/IMAPProtocol.php:1.4 pear/Net_IMAP/IMAPProtocol.php:1.5
--- pear/Net_IMAP/IMAPProtocol.php:1.4 Wed Mar 22 04:53:05 2006
+++ pear/Net_IMAP/IMAPProtocol.php Wed Mar 22 05:00:20 2006
@@ -1462,7 +1462,16 @@
//Make the command request
$param=sprintf("%s (",$mailbox_name);
if($storageQuota != null ){
- $param=sprintf("%sSTORAGE %s",$param,$storageQuota);
+ if ($storageQuota == -1) {
+ // set -1 to remove a quota
+ $param = sprintf("%s", $param);
+ } elseif ($storageQuota == strtolower('remove')) {
+ // this is a cyrus rmquota specific feature
+ // see http://email.uoa.gr/projects/cyrus/quota-patches/rmquota/
+ $param = sprintf("%sREMOVE 1", $param);
+ } else {
+ $param = sprintf("%sSTORAGE %s", $param, $storageQuota);
+ }
if( $messagesQuota != null ){
//if we have both types of quota on the same call we must append an space between
// those parameters
@@ -2542,6 +2551,12 @@
C: A0004 GETQUOTA user.damian
S: * QUOTA user.damian (STORAGE 1781460 4000000)
S: A0004 OK Completed
+
+ RFC 2087 section 5.1 says the list could be empty:
+
+ C: A0004 GETQUOTA user.damian
+ S: * QUOTA user.damian ()
+ S: A0004 OK Completed
*/
$mailbox = $this->_parseOneStringResponse( $str,__LINE__ , __FILE__ );
@@ -2550,6 +2565,10 @@
$ret_aux = array("MAILBOX"=>$this->utf_7_decode($mailbox) );
$this->_getNextToken( $str , $quota_resp );
+ if ($quota_resp == ')' ) {
+ // empty list, apparently no STORAGE or MESSAGE quota set
+ return array($token => $ret_aux);
+ }
if( ( $ext = $this->_retrParsedResponse( $str , $quota_resp )) == false){
$this->_prot_error("bogus response!!!!" , __LINE__ , __FILE__ );
}