package mrmime

  1. Overview
  2. Docs
type ('discrete, 'extension) t =
  1. | Discrete of {
    1. content : Content.t;
    2. fields : (int * [ `Unsafe of Field_name.t * Unstructured.t | `Lines of (string * Location.t) list ] * Location.t) list;
    3. body : 'discrete;
    }
  2. | Extension of {
    1. content : Content.t;
    2. fields : (int * [ `Unsafe of Field_name.t * Unstructured.t | `Lines of (string * Location.t) list ] * Location.t) list;
    3. body : 'extension;
    }
  3. | Multipart of {
    1. content : Content.t;
    2. fields : (int * [ `Unsafe of Field_name.t * Unstructured.t | `Lines of (string * Location.t) list ] * Location.t) list;
    3. parts : ('discrete, 'extension) atom list;
    }
  4. | Message of {
    1. content : Content.t;
    2. header : Header.t;
    3. fields : (int * [ `Unsafe of Field_name.t * Unstructured.t | `Lines of (string * Location.t) list ] * Location.t) list;
    4. message : ('discrete, 'extension) t;
    }
and ('discrete, 'extension) part =
  1. | Part_discrete of 'discrete
  2. | Part_extension of 'extension
  3. | Part_multipart of ('discrete, 'extension) atom list
  4. | Part_message of {
    1. header : Header.t;
    2. message : ('discrete, 'extension) t;
    }
and ('discrete, 'extension) atom = {
  1. content : Content.t;
  2. fields : (int * field_part * Location.t) list;
  3. part : ('discrete, 'extension) part option;
}
and garbage = [
  1. | `Unsafe of Field_name.t * Unstructured.t
  2. | `Lines of (string * Location.t) list
]
type ('valid, 'invalid) contents =
  1. | Contents of 'valid
  2. | Invalid of 'invalid
type mail = ((string, string) contents, string) t
type 'id stream = ('id, 'id) t
val header : (Header.t * (int * [ `Unsafe of Field_name.t * Unstructured.t | `Lines of (string * Location.t) list ] * Location.t) list) Angstrom.t

Angstrom parser of a RFC 5322 header.

val heavy_octet : string option -> Content.t -> (string, string) contents Angstrom.t

Heavy parser of a body - it will stores bodies into string.

val light_octet : emitter:(string option -> unit) -> string option -> Content.t -> unit Angstrom.t

Light parser of body - it sends contents to given emitter.

val mail : (Header.t * mail) Angstrom.t

Angstrom parser of an entire RFC 5322 mail (including header).

type 'id emitters = Content.t -> (string option -> unit) * 'id
val stream : emitters:(Content.t -> (string option -> unit) * 'id) -> (Header.t * 'id stream) Angstrom.t

stream ~emitters is an Angstrom parser of an entire RFC 5322 mail which will use given emitters by emitters to store bodies.

OCaml

Innovation. Community. Security.