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 pair local_part@domain
as O'Caml type. The domain may be
missing.
The name of the mailbox. Raises Not_found
if not set
The route to the mailbox
A mailbox
has a name, optionally a route (not used nowadays), and
a formal address specification.
Create a mailbox
with
new mailbox ~name route addr_spec
Pass 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.
Examples:
parse "gerd@gerd-stolpmann.de"
returns a single mailbox
without name and route, and the given specparse "Gerd Stolpmann <gerd@gerd-stolpmann.de>"
returns a
single mailbox
with name and spec, but without routeparse "abc@def.net, ghi"
returns two mailbox
es without
name and route, and the two specs. The second address only
has a local part, but no domain.parse "g:abc@def.net, Me <me@domain.net>;, gs@npc.de"
returns one group g
with members abc@def.net
and
me@domain.net
, and another mailbox
gs@npc.de
.Old-style naming of mailboxes is not supported (e.g. "gerd@gerd-stolpmann.de (Gerd Stolpmann)" - the part in parentheses is simply ignored.