sig
  type field_message = Top.field_message
  type field_part = Top.field_part
  type ('a, 'b) message =
    ('a, 'b) Top.message =
      Discrete of MrMime_content.t * MrMime_message.field_message list * 'a
    | Extension of MrMime_content.t * MrMime_message.field_message list * 'b
    | Multipart of MrMime_content.t * MrMime_message.field_message list *
        (MrMime_content.t * MrMime_message.field_part list *
         ('a, 'b) MrMime_message.part option)
        list
    | Message of MrMime_content.t * MrMime_message.field_message list *
        MrMime_header.header * ('a, 'b) MrMime_message.message
  and ('a, 'b) part =
    ('a, 'b) Top.part =
      PDiscrete of 'a
    | PExtension of 'b
    | PMultipart of
        (MrMime_content.t * MrMime_message.field_part list *
         ('a, 'b) MrMime_message.part option)
        list
    | PMessage of MrMime_header.header * ('a, 'b) MrMime_message.message
  type encoding = ..
  type encoding += Base64 of MrMime_base64.Decoder.result
  type encoding += QuotedPrintable of string
  type encoding += Raw of string
  type content = ..
  type content += Unit
  module Decoder :
    sig
      val p_message :
        (MrMime_header.header *
         (MrMime_message.encoding, MrMime_message.content)
         MrMime_message.message)
        MrMime_parser.t
      val p_header :
        (MrMime_header.header * MrMime_content.t *
         [ `Bcc of Rfc5322.address list
         | `Cc of Rfc5322.address list
         | `Comments of Rfc5322.unstructured
         | `Content of string * Rfc5322.unstructured
         | `ContentDescription of Rfc5322.unstructured
         | `ContentEncoding of Rfc2045.mechanism
         | `ContentID of Rfc822.msg_id
         | `ContentType of Rfc2045.content
         | `Date of Rfc5322.date
         | `Field of string * Rfc5322.unstructured
         | `From of Rfc5322.mailbox list
         | `InReplyTo of Rfc5322.phrase_or_msg_id list
         | `Keywords of Rfc5322.phrase list
         | `MessageID of Rfc822.msg_id
         | `MimeVersion of Rfc2045.version
         | `References of Rfc5322.phrase_or_msg_id list
         | `ReplyTo of Rfc5322.address list
         | `ResentBcc of Rfc5322.address list
         | `ResentCc of Rfc5322.address list
         | `ResentDate of Rfc5322.date
         | `ResentFrom of Rfc5322.mailbox list
         | `ResentMessageID of Rfc822.msg_id
         | `ResentReplyTo of Rfc5322.address list
         | `ResentSender of Rfc5322.mailbox
         | `ResentTo of Rfc5322.address list
         | `Sender of Rfc5322.mailbox
         | `Skip of string
         | `Subject of Rfc5322.unstructured
         | `To of Rfc5322.address list
         | `Trace of
             (Rfc822.local * (Rfc5322.domain * Rfc5322.domain list)) option *
             ([ `Addr of
                  Rfc822.local * (Rfc5322.domain * Rfc5322.domain list)
              | `Domain of Rfc5322.domain
              | `Word of Rfc822.word ] list * Rfc5322.date option)
             list
         | `Unsafe of string * Rfc5322.unstructured ] list)
        MrMime_parser.t
      val p_first_part :
        MrMime_content.t ->
        (MrMime_content.t *
         [ `Bcc of Rfc5322.address list
         | `Cc of Rfc5322.address list
         | `Comments of Rfc5322.unstructured
         | `Content of string * Rfc5322.unstructured
         | `ContentDescription of Rfc5322.unstructured
         | `ContentEncoding of Rfc2045.mechanism
         | `ContentID of Rfc822.msg_id
         | `ContentType of Rfc2045.content
         | `Date of Rfc5322.date
         | `Field of string * Rfc5322.unstructured
         | `From of Rfc5322.mailbox list
         | `InReplyTo of Rfc5322.phrase_or_msg_id list
         | `Keywords of Rfc5322.phrase list
         | `MessageID of Rfc822.msg_id
         | `MimeVersion of Rfc2045.version
         | `References of Rfc5322.phrase_or_msg_id list
         | `ReplyTo of Rfc5322.address list
         | `ResentBcc of Rfc5322.address list
         | `ResentCc of Rfc5322.address list
         | `ResentDate of Rfc5322.date
         | `ResentFrom of Rfc5322.mailbox list
         | `ResentMessageID of Rfc822.msg_id
         | `ResentReplyTo of Rfc5322.address list
         | `ResentSender of Rfc5322.mailbox
         | `ResentTo of Rfc5322.address list
         | `Sender of Rfc5322.mailbox
         | `Skip of string
         | `Subject of Rfc5322.unstructured
         | `To of Rfc5322.address list
         | `Trace of
             (Rfc822.local * (Rfc5322.domain * Rfc5322.domain list)) option *
             ([ `Addr of
                  Rfc822.local * (Rfc5322.domain * Rfc5322.domain list)
              | `Domain of Rfc5322.domain
              | `Word of Rfc822.word ] list * Rfc5322.date option)
             list
         | `Unsafe of string * Rfc5322.unstructured ] list)
        MrMime_parser.t
      val p_next_part :
        MrMime_content.t ->
        (MrMime_content.t *
         [ `Bcc of Rfc5322.address list
         | `Cc of Rfc5322.address list
         | `Comments of Rfc5322.unstructured
         | `Content of string * Rfc5322.unstructured
         | `ContentDescription of Rfc5322.unstructured
         | `ContentEncoding of Rfc2045.mechanism
         | `ContentID of Rfc822.msg_id
         | `ContentType of Rfc2045.content
         | `Date of Rfc5322.date
         | `Field of string * Rfc5322.unstructured
         | `From of Rfc5322.mailbox list
         | `InReplyTo of Rfc5322.phrase_or_msg_id list
         | `Keywords of Rfc5322.phrase list
         | `MessageID of Rfc822.msg_id
         | `MimeVersion of Rfc2045.version
         | `References of Rfc5322.phrase_or_msg_id list
         | `ReplyTo of Rfc5322.address list
         | `ResentBcc of Rfc5322.address list
         | `ResentCc of Rfc5322.address list
         | `ResentDate of Rfc5322.date
         | `ResentFrom of Rfc5322.mailbox list
         | `ResentMessageID of Rfc822.msg_id
         | `ResentReplyTo of Rfc5322.address list
         | `ResentSender of Rfc5322.mailbox
         | `ResentTo of Rfc5322.address list
         | `Sender of Rfc5322.mailbox
         | `Skip of string
         | `Subject of Rfc5322.unstructured
         | `To of Rfc5322.address list
         | `Trace of
             (Rfc822.local * (Rfc5322.domain * Rfc5322.domain list)) option *
             ([ `Addr of
                  Rfc822.local * (Rfc5322.domain * Rfc5322.domain list)
              | `Domain of Rfc5322.domain
              | `Word of Rfc822.word ] list * Rfc5322.date option)
             list
         | `Unsafe of string * Rfc5322.unstructured ] list)
        MrMime_parser.t
      val p_bound_of_content :
        MrMime_content.t -> unit MrMime_parser.t * unit MrMime_parser.t
      val p_store_part :
        MrMime_content.t ->
        MrMime_content.t ->
        [ `End of MrMime_message.encoding option
        | `Next of MrMime_message.encoding option ] MrMime_parser.t
      val p_discard_part :
        MrMime_content.t -> [ `End | `Next ] MrMime_parser.t
      val p_end_of_part :
        MrMime_content.t -> [ `End | `Next ] MrMime_parser.t
    end
  module Extension :
    sig
      val add_encoding :
        string ->
        (unit MrMime_parser.t ->
         unit MrMime_parser.t -> MrMime_message.encoding MrMime_parser.t) ->
        unit
      val add_content :
        string ->
        (string option ->
         MrMime_content.t ->
         MrMime_message.field_message list ->
         MrMime_message.content MrMime_parser.t) ->
        unit
    end
  val of_string_raw :
    ?chunk:int ->
    string ->
    int ->
    int ->
    ((MrMime_header.header *
      (MrMime_message.encoding, MrMime_message.content)
      MrMime_message.message) *
     int)
    option
end