Class SmtpParser.

Inherits AbnfParser

SMTP-specific ABNF parsing functions.

This subclass of AbnfParser provides functions to parse SMTP protocol elements as defined in RFC 2821.

SmtpParser::SmtpParser( const EString & s )

Creates a new SmtpParser object for the string s, which is assumed to be a complete SMTP command line (not including the terminating CRLF), as received from the client.

Reimplements AbnfParser::AbnfParser().

Address * SmtpParser::address()

Returns a pointer to an address, which is never a null pointer but may point to a somewhat strange address if there is a parse error.

EString SmtpParser::atom()

Returns the atom production from RFC 2821 and RFC 2822. (atext from 2822, atom from 2821.)

EString SmtpParser::command()

Returns an SMTP cmmand, always in lower case.

EString SmtpParser::domain()

Parses and returns a domain. The domain literal form is somewhat too flexible (read: totally botched).

As a hack, a final "." is overlooked if the next character is a ">", as in "rcpt to: <>".

EString SmtpParser::dotString()

Returns an RFC 2821 dot-string.

EString SmtpParser::esmtpKeyword()

Parses and returns an ESMTP parameter name: esmtp-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")

Always returns lower case.

EString SmtpParser::esmtpValue()

Parses an ESMTP parameter value: esmtp-value = 1*(%d33-60 / %d62-127)

EString SmtpParser::quotedString()

Returns a quoted-string as defined in RFC 2822 (and used in RFC 2821). Does not enforce the ASCII-only rule.

EString SmtpParser::subDomain()

Returns the RFC 2821 sub-domain production: sub-domain = Let-dig [Ldh-str]

void SmtpParser::whitespace()

Skips whitespace.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.