g'day ...

I'm trying to fix up the mailadmin interface we are using for Cyrus, and the last thing I know to be broken is PHPs internal 'imap_set_quota' command ... namely, it no longer accept a non-integer value for the quota, so you can't pass 'none' to it ...

So, I'm looking at the Pear Net_Cyrus module, which looks like it should work ...

  I'm trying to do:

  $quota = &new Net_Cyrus();
  $quota->connect("[EMAIL PROTECTED]",
                          $password,
                          $mail_server_name,
                          $mail_server_port);
  $quota->setQuota("user.".$user, "none");

but, its not removing the quota, altho changing none -> any #, it will set the quota properly ... so my syntax looks to be right ...

tracing the code, it gets down to Net_IMAPProtocol.php, with the function being:

    function cmdSetQuota($mailbox_name, $storageQuota = null ,$messagesQuota = 
null )
    {
        //Check if the IMAP server has QUOTA support
        if( ! $this->hasQuotaSupport() ){
            return new PEAR_Error("This IMAP server does not support QUOTA's! 
");
        }

        if( ($messagesQuota == null) && ( $storageQuota == null) ){
            return new PEAR_Error('$storageQuota and $messagesQuota parameters 
can\'t be both null if you want to use quota');
        }
        $mailbox_name=sprintf("\"%s\"",$this->utf_7_encode($mailbox_name) );
        //Make the command request
        $param=sprintf("%s (",$mailbox_name);
        if($storageQuota != null ){
            $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
                $param=sprintf("%s ",$param);
            }
        }
        if($messagesQuota != null ){
            $param=sprintf("%sMESSAGES %s",$param,$messagesQuota);

        }
        $param=sprintf("%s)",$param);

        return $this->_genericCommand('SETQUOTA', $param );
    }


Putting a 'print $param' just before the _genericCommand, the output is:

"user.cotton" (STORAGE none)

So, it would be passing:

SETQUOTA "user.cotton" (STORAGE none)

to the backend ... again, if none == an integer #, the quota gets set, so it looks like the syntax itself is right, but 'none' is wrong ...

Is anyone doing this with PHP that has gotten around the above issue? Is there something obviously wrong with the way the SETQUOTA is being generated?

Thanks ...


----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]           Yahoo!: yscrappy              ICQ: 7615664
----
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Reply via email to