Anders Jenbo - 2010-01-06 22:04:34
This fixes the functions for mailboxes with spaces in the name.
/* The select_mailbox command selects a mailbox so that messages in the
mailbox can be accessed. */
function select_mailbox($mailbox_name)
{
if($this->state=="AUTHORIZATION")
{
$this->error= "Error : User is not authorised or logged in.!<br>";
return false;
}
if($this->put_line($this->tag.' SELECT "'.$mailbox_name.'"'))
{
$response=$this->get_server_responce();
if(substr($response,strpos($response,$this->tag.' ')+strlen($this->tag)+1,2)!="OK")
{
$this->error= "Error : $response !<br>";
return false;
}
}
else
{
$this->error= "Error : Could not send User request. <br>";
return false;
}
$this->state="SELECTED";
return $response;
}
/* The examin_mailbox command is identical to SELECT and returns the same
output; however, the EXAMINE is identified as read-only.*/
function examin_mailbox($mailbox_name)
{
if($this->state=="AUTHORIZATION")
{
$this->error= "Error : User is not authorised or logged in.!<br>";
return false;
}
if($this->put_line($this->tag.' EXAMINE "'.$mailbox_name.'"'))
{
$response=$this->get_server_responce();
if(substr($response,strpos($response,$this->tag." ")+strlen($this->tag)+1,2)!="OK")
{
$this->error= "Error : $response !<br>";
return false;
}
}
else
{
$this->error= "Error : Could not send User request. <br>";
return false;
}
$this->state="SELECTED";
return $response;
}