protected function _sendID($info)
{
$cmd = $this->_command('ID');
if (empty($info)) {
$cmd->add(new Horde_Imap_Client_Data_Format_Nil());
} else {
$tmp = new Horde_Imap_Client_Data_Format_List();
foreach ($info as $key => $val) {
$tmp->add(array(new Horde_Imap_Client_Data_Format_String(Horde_String::lower($key)), new Horde_Imap_Client_Data_Format_Nstring($val)));
}
$cmd->add($tmp);
}
$temp =& $this->_temp;
/* Add to queue - this doesn't need to be sent immediately. */
$cmd->on_error = function () use(&$temp) {
/* Ignore server errors. E.g. Cyrus returns this:
* 001 NO Only one Id allowed in non-authenticated state
* even though NO is not allowed in RFC 2971[3.1]. */
$temp['id'] = array();
return true;
};
$cmd->on_success = function () use($cmd, &$temp) {
$temp['id'] = $cmd->pipeline->data['id'];
};
$this->_cmdQueue[] = $cmd;
}