module Netaddress:Parsing of mail addressessig
..end
typelocal_part =
string
typedomain =
string
typeaddr_spec =
local_part * domain option
local_part@domain
as O'Caml type. The domain may be
missing.class mailbox :?name:string -> string list -> addr_spec ->
object
..end
mailbox
has a name, optionally a route (not used nowadays), and
a formal address specification.
class group :string -> mailbox list ->
object
..end
group
has a name, and consists of a number of mailboxes.
typet =
[ `Group of group | `Mailbox of mailbox ]
mailbox
and group
exception Parse_error of int * string
int
is the position in the parsed stringval parse : string -> t list
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
.