Parsing of mail addresses
Addresses indicate the senders and recipients of messages and correspond to either an individual mailbox or a group of mailboxes.
Usually the user name
The domain of the mailbox
The name of the mailbox. Raises
Not_found if not set
The route to the mailbox
mailbox has a name, optionally a route (not used nowadays), and
a formal address specification.
new mailbox ~name route addr_spec
route =  if not used (formerly, routes were used to specify
the way the mail should take from the sender to the receiver, and
contained a list of hostnames/IP addresses).
A parsing error. The
int is the position in the parsed string
Parse a list of addresses in string representation, and return them as list of mailboxes or groups.
parse "firstname.lastname@example.org"returns a single
mailboxwithout name and route, and the given spec
parse "Gerd Stolpmann <email@example.com>"returns a single
mailboxwith name and spec, but without route
parse "firstname.lastname@example.org, ghi"returns two
mailboxes without name and route, and the two specs. The second address only has a local part, but no domain.
parse "g:email@example.com, Me <firstname.lastname@example.org>;, email@example.com"returns one group
firstname.lastname@example.org, and another
Old-style naming of mailboxes is not supported (e.g. "email@example.com (Gerd Stolpmann)" - the part in parentheses is simply ignored.