sig
type local = Rfc822.local
type domain = Rfc5322.domain
type word = Rfc822.word
type field = Rfc5322.trace
type received =
[ `Addr of local * (domain * domain list)
| `Domain of domain
| `Word of word ]
type trace = {
trace : (local * (domain * domain list)) option;
received : (received list * MrMime_date.date option) list;
}
module Address :
sig
type word = [ `Atom of string | `String of string ]
type local = word list
type raw =
Rfc2047.raw =
QuotedPrintable of string
| Base64 of MrMime_base64.Decoder.result
type literal_domain = Rfc5321.literal_domain = ..
type literal_domain += IPv4 of Ipaddr.V4.t
type literal_domain += IPv6 of Ipaddr.V6.t
type phrase = [ `Dot | `Encoded of string * raw | `Word of word ] list
type domain = [ `Domain of string list | `Literal of literal_domain ]
type mailbox =
Rfc5322.mailbox = {
name : phrase option;
local : local;
domain : domain * domain list;
}
type group = Rfc5322.group = { name : phrase; mailbox : mailbox list; }
type address = [ `Group of group | `Mailbox of mailbox ]
val pp_word : Format.formatter -> word -> unit
val pp_domain : Format.formatter -> domain -> unit
val pp_phrase : Format.formatter -> phrase -> unit
val pp_local : Format.formatter -> local -> unit
val pp_mailbox' :
Format.formatter -> local * (domain * domain list) -> unit
val pp_mailbox : Format.formatter -> mailbox -> unit
val pp_group : Format.formatter -> group -> unit
val pp : Format.formatter -> address -> unit
module Encoder :
sig
val w_word :
(MrMime_address.word,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_domain :
(MrMime_address.domain,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_safe_string :
(string,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_raw :
(MrMime_address.raw,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_phrase :
(MrMime_address.phrase,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_local :
(MrMime_address.local,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_mailbox' :
(MrMime_address.local *
(MrMime_address.domain * MrMime_address.domain list),
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_mailbox :
(MrMime_address.mailbox,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_group :
(MrMime_address.group,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_address :
(MrMime_address.address,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_addresses :
(MrMime_address.address list,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
end
module Decoder :
sig
val p_address : MrMime_address.address MrMime_parser.t
val p_addresses : MrMime_address.address list MrMime_parser.t
val p_local : MrMime_address.local MrMime_parser.t
val p_domain : MrMime_address.domain MrMime_parser.t
end
val to_string : address -> string
val of_string : ?chunk:int -> string -> address option
val of_string_raw :
?chunk:int -> string -> int -> int -> (address * int) option
val equal : address -> address -> bool
module List :
sig
val pp : Format.formatter -> MrMime_address.address list -> unit
val to_string : MrMime_address.address list -> string
val of_string :
?chunk:int -> string -> MrMime_address.address list option
val of_string_raw :
?chunk:int ->
string ->
int -> int -> (MrMime_address.address list * int) option
val equal :
MrMime_address.address list ->
MrMime_address.address list -> bool
end
module Make :
sig
type z = MrMime_address.Make.z = Z
type 'a s = 'a MrMime_address.Make.s = S
type 'a word = 'a MrMime_address.Make.word
type ('data, 'peano) llist =
('data, 'peano) MrMime_address.Make.llist
val word : string -> [ `Atom | `String ] word
val atom : string -> [> `Atom ] word
val e : ([> `Atom ] word, z) llist
val ( & ) : 'a word -> ('a word, 'x) llist -> ('a word, 'x s) llist
val ( @ ) :
([ `Atom | `String ] word, 'a s) llist ->
([ `Atom ] word, 'b s) llist -> MrMime_address.mailbox
end
module Extension :
sig
val add_literal_domain :
string -> MrMime_address.literal_domain MrMime_parser.t -> unit
end
end
module Date :
sig
type day = Rfc5322.day = Mon | Tue | Wed | Thu | Fri | Sat | Sun
type month =
Rfc5322.month =
Jan
| Feb
| Mar
| Apr
| May
| Jun
| Jul
| Aug
| Sep
| Oct
| Nov
| Dec
type zone =
Rfc5322.zone =
UT
| GMT
| EST
| EDT
| CST
| CDT
| MST
| MDT
| PST
| PDT
| Military_zone of char
| TZ of int
type date =
Rfc5322.date = {
day : day option;
date : int * month * int;
time : int * int * int option;
zone : zone;
}
val pp_zone : Format.formatter -> zone -> unit
val pp_month : Format.formatter -> month -> unit
val pp_day : Format.formatter -> day -> unit
val pp : Format.formatter -> date -> unit
module Encoder :
sig
val w_day :
(MrMime_date.day,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_time :
(int * int * int option,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_zone :
(MrMime_date.zone,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
val w_date :
(MrMime_date.date,
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial)
Wrap.k1
end
module Decoder :
sig
val p_hour : int MrMime_parser.t
val p_minute : int MrMime_parser.t
val p_second : int MrMime_parser.t
val p_year : int MrMime_parser.t
val p_day : int MrMime_parser.t
val p_month : MrMime_date.month MrMime_parser.t
val p_day_of_week : MrMime_date.day MrMime_parser.t
val p_zone : MrMime_date.zone MrMime_parser.t
val p_time :
((int * int * int option) * MrMime_date.zone) MrMime_parser.t
val p_date : (int * MrMime_date.month * int) MrMime_parser.t
val p_date_time : MrMime_date.date MrMime_parser.t
end
val to_string : date -> string
val of_string : ?chunk:int -> string -> date option
val of_string_raw :
?chunk:int -> string -> int -> int -> (date * int) option
val equal : date -> date -> bool
end
val pp_lst :
sep:(Format.formatter -> unit -> unit) ->
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a list -> unit
val pp_path :
Format.formatter ->
Address.local * (Address.domain * Address.domain list) -> unit
val pp_received :
Format.formatter ->
[< `Addr of Address.local * (Address.domain * Address.domain list)
| `Domain of Address.domain
| `Word of Address.word ]
list * Date.date option -> unit
val pp : Format.formatter -> trace -> unit
module Encoder :
sig
val w_crlf :
(Encoder.t ->
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial) ->
Encoder.t -> 'a Encoder.partial
val w_lst :
(('a -> 'b) -> 'a -> 'b) ->
('c -> ('a -> 'b) -> 'a -> 'b) -> 'c list -> ('a -> 'b) -> 'a -> 'b
val w_field' :
[< `Received of
[< `Addr of
MrMime_address.local *
(MrMime_address.domain * MrMime_address.domain list)
| `Domain of MrMime_address.domain
| `Word of MrMime_address.word ]
list * MrMime_date.date option
| `ReturnPath of
(MrMime_address.local *
(MrMime_address.domain * MrMime_address.domain list))
option ] ->
(Encoder.t ->
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial Encoder.partial Encoder.partial Encoder.partial
Encoder.partial Encoder.partial) ->
Encoder.t ->
'a Encoder.partial Encoder.partial Encoder.partial Encoder.partial
Encoder.partial Encoder.partial
val w_field :
[< `Trace of
(MrMime_address.local *
(MrMime_address.domain * MrMime_address.domain list))
option *
([< `Addr of
MrMime_address.local *
(MrMime_address.domain * MrMime_address.domain list)
| `Domain of MrMime_address.domain
| `Word of MrMime_address.word ]
list * MrMime_date.date option)
list ] ->
(Encoder.t ->
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial Encoder.partial Encoder.partial Encoder.partial
Encoder.partial Encoder.partial) ->
Encoder.t ->
'a Encoder.partial Encoder.partial Encoder.partial Encoder.partial
Encoder.partial Encoder.partial
val w_trace :
trace ->
(Encoder.t ->
([> `Partial of Bytes.t * int * int * (int -> 'a) ] as 'a)
Encoder.partial Encoder.partial Encoder.partial Encoder.partial
Encoder.partial Encoder.partial) ->
Encoder.t ->
'a Encoder.partial Encoder.partial Encoder.partial Encoder.partial
Encoder.partial Encoder.partial
end
val decoder : ([> field ] as 'a) list -> (trace list * 'a list) Parser.t
val equal : 'a -> 'a -> bool
end