public bool TryMakeEhlo(TokenEnumerator enumerator, out SmtpCommand command, out SmtpResponse errorResponse)
{
Debug.Assert(enumerator.Peek() == new Token(TokenKind.Text, "EHLO"));
command = null;
errorResponse = null;
enumerator.Take();
enumerator.TakeWhile(TokenKind.Space);
string domain;
if (_parser.TryMakeDomain(enumerator, out domain))
{
command = new EhloCommand(domain, _options);
return true;
}
string address;
if (_parser.TryMakeAddressLiteral(enumerator, out address))
{
command = new EhloCommand(address, _options);
return true;
}
errorResponse = SmtpResponse.SyntaxError;
return false;
}