Class RFC822Parser

Superclasses :
util::Error
Package :
mail

Source

Class summary
Methods inherited from util::Error
error(a) get_reason()
Variables inherited from util::Error
reason
Methods defined in this class
initially() next_token() parse_2dig() parse_addr_spec(mb) parse_address_list(s, can_be_empty) parse_address_list_impl(can_be_empty) parse_atom() parse_comment() parse_content_disposition(s, ct) parse_content_disposition_impl(cd) parse_content_transfer_encoding(s) parse_content_transfer_encoding_impl() parse_content_type(s, ct) parse_content_type_impl(ct) parse_date_time(s) parse_date_time_impl() parse_day() parse_disposition_type() parse_domain() parse_domain_literal() parse_error(s) parse_extension_token() parse_field(s, message) parse_field_impl(message) parse_group(s, group) parse_group_impl(group) parse_local_part() parse_mailbox(s, mb) parse_mailbox_impl(mb) parse_mailbox_list(s, can_be_empty) parse_mailbox_list_impl(can_be_empty) parse_mailbox_or_group() parse_month() parse_phrase() parse_quoted_string() parse_route(mb) parse_route_addr(mb) parse_sub_domain() parse_token_1521() parse_type() parse_word() parse_year() parse_zone()

Method detail

initially()


next_token()

Source

parse_2dig()

Source

parse_addr_spec(mb)

addr_spec = local-part "@" domain
Source

parse_address_list(s, can_be_empty)

Source

parse_address_list_impl(can_be_empty)

Source

parse_atom()

atom = 1*<any CHAR except specials, SPACE and CTLs> ie one or more atom_char

Must be preceded by a call to next_token()

Source

parse_comment()

comment = "(" *(ctext / quoted-pair / comment) ")"
Source

parse_content_disposition(s, ct)

Source

parse_content_disposition_impl(cd)

disposition := "Content-Disposition" ":" disposition-type *(";" disposition-parm)

disposition-type := "inline" / "attachment" / extension-token ; values are not case-sensitive

disposition-parm := filename-parm / parameter

filename-parm := "filename" "=" value;

Source

parse_content_transfer_encoding(s)

Source

parse_content_transfer_encoding_impl()

encoding := "Content-Transfer-Encoding" ":" mechanism

mechanism := "7bit" ; case-insensitive / "quoted-printable" / "base64" / "8bit" / "binary" / x-token

Source

parse_content_type(s, ct)

Source

parse_content_type_impl(ct)

content := "Content-Type" ":" type "/" subtype *(";" parameter) ; case-insensitive matching of type and subtype parameter := attribute "=" value

attribute := token ; case-insensitive

value := token / quoted-string

Source

parse_date_time(s)

Source

parse_date_time_impl()

date-time = [ day "," ] date time day = "Mon" / "Tue" / "Wed" / "Thu"/ "Fri" / "Sat" / "Sun" date = 1*2DIGIT month 2DIGIT time = hour zone hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT]
Source

parse_day()

Source

parse_disposition_type()

disposition-type := "inline" / "attachment" / extension-token ; values are not case-sensitive
Source

parse_domain()

domain = sub-domain *("." sub-domain)
Source

parse_domain_literal()

domain-literal = "[" *(dtext / quoted-pair) "]" dtext = <any CHAR excluding "[","]", "\" & CR>

Must be preceded by a call to next_token()

Source

parse_error(s)

Source

parse_extension_token()

extension-token := x-token / iana-token

iana-token := <a publicly-defined extension token, registered with IANA, as specified in appendix E>

x-token := <The two characters "X-" or "x-" followed, with no intervening white space, by any token>

Source

parse_field(s, message)

Source

parse_field_impl(message)

field = field-name ":" [field-body] CRLF field-name = 1*<any CHAR, excluding CTLs, SPACE, and ":"> field-body = *text [CRLF LWSP-char field-body]
Source

parse_group(s, group)

Source

parse_group_impl(group)

group = phrase ":" [#mailbox] ";" #X means empty or X,X,X...

Source

parse_local_part()

local-part = word *("." word)
Source

parse_mailbox(s, mb)

Source

parse_mailbox_impl(mb)

mailbox = addr-spec | phrase route-addr
Source

parse_mailbox_list(s, can_be_empty)

Source

parse_mailbox_list_impl(can_be_empty)

Source

parse_mailbox_or_group()

Source

parse_month()

month = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" / "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
Source

parse_phrase()

phrase = 1*word

In fact this is parsed as just "*word". This allows parsing of mailboxes such as, for example "<rparlett@xyz.com>" and groups such as :joe@soap.com;

Source

parse_quoted_string()

qtext = <any CHAR excepting <">, "\" & CR, and including linear-white-space> quoted-pair = "\" CHAR quoted-string = <"> *(qtext/quoted-pair) <">

Must be preceded by a call to next_token()

Source

parse_route(mb)

route = 1#("@" domain) ":" where 1#X means '(X *("," X))'
Source

parse_route_addr(mb)

route-addr = "<" [route] addr-spec ">"
Source

parse_sub_domain()

sub-domain = domain-ref / domain-literal domain-ref = atom
Source

parse_token_1521()

token := 1*<any (ASCII) CHAR except SPACE, CTLs, or tspecials>

tspecials := "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> / "/" / "[" / "]" / "?" / "=" ; Must be in quoted-string, ; to use within parameter values

Source

parse_type()

type := "application" / "audio" / "image" / "message" / "multipart" / "text" / "video" / extension-token ; All values case-insensitive
Source

parse_word()

word = atom / quoted-string
Source

parse_year()

Source

parse_zone()

Source