package mrmime

  1. Overview
  2. Docs

This module provides an alternative to Unstructured which handles encoded words. It is meant for the Subject and other unstructured header fields, where RFC-2047 adds additional semantics on top of the SMTP protocol. The addition of encoded words allows sending UTF-8 content in a 7 bit protocol, like SMTP without the SMTPUTF8 extension.

When decoding, it is necessary to pass the following witness

let witness =
  Field_name.Map.singleton Field_name.subject
    Field.(Witness Unstructured_with_encoded)
type elt = [
  1. | Unstructured.elt
  2. | `Encoded of string * Emile.raw
]
type t = elt list
val pp_elt : Format.formatter -> elt -> unit

Pretty printer of elt mostly useful for debugging.

val pp : Format.formatter -> t -> unit

Pretty printer of t mostly useful for debugging.

module Decoder : sig ... end
module Encoder : sig ... end
module Craft : sig ... end
OCaml

Innovation. Community. Security.