protected function _authInitialResponse($method, $ir, $username = null)
{
$cmd = $this->_command('AUTHENTICATE')->add($method);
if ($this->_capability('SASL-IR')) {
// IMAP Extension for SASL Initial Client Response (RFC 4959)
$cmd->add($ir);
if ($username) {
$cmd->debug = array(sprintf('AUTHENTICATE %s [INITIAL CLIENT RESPONSE (username: %s)]', $method, $username));
}
} else {
$cmd->add(new Horde_Imap_Client_Interaction_Command_Continuation(function ($ob) use($ir) {
return new Horde_Imap_Client_Data_Format_List($ir);
}));
if ($username) {
$cmd->debug = array(null, sprintf('[INITIAL CLIENT RESPONSE (username: %s)]', $username));
}
}
return $cmd;
}