Module MrMime_address

module MrMime_address: sig .. end
Module Address

type word = [ `Atom of string | `String of string ] 
word is a combinations of atoms and/or quoted-strings:

    word         =   atom / quoted-string
    

    atext        =   ALPHA / DIGIT /    ; Printable US-ASCII
                     "!" / "#" /        ;  characters not including
                     "$" / "%" /        ;  specials.  Used for atoms.
                     "&" / "'" /
                     "*" / "+" /
                     "-" / "/" /
                     "=" / "?" /
                     "^" / "_" /
                     "`" / "{" /
                     "|" / "}" /
                     "~"

    atom         =   [CFWS] 1*atext [CFWS]
    

    qtext           =   %d33 /             ; Printable US-ASCII
                        %d35-91 /          ;  characters not including
                        %d93-126 /         ;  "\\" or the quote character
                        obs-qtext
    obs-qp          =   "\\" (%d0 / obs-NO-WS-CTL / LF / CR)
    obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
                        %d11 /             ;  characters that do not
                        %d12 /             ;  include the carriage
                        %d14-31 /          ;  return, line feed, and
                        %d127              ;  white space characters

    quoted-pair     =   ("\\" (VCHAR / WSP)) / obs-qp
    qcontent        =   qtext / quoted-pair

    quoted-string   =   [CFWS]
                        DQUOTE *([FWS] qcontent) [FWSDQUOTE
                        [CFWS]
    

A quoted-string is treated as a unit. That is, quoted-string is identical to atom, semantically. Since a quoted-string is allowed to contain FWS, fold is permitted. Also note that since quoted-pair is allowed in a quoted-string, the quote and backslash characters may appear in a quoted-string so long as they appear as a quoted-pair. MrMime interprets directly a quoted-pair to its value.

Semantically, neither the optional CFWS outside of the quote characters nor the quote characters themselves are part of the quoted-string; the quoted-string is what is contained beteen the two quote characters. As stated ealier, the "\\" in any quoted-pair and the CRLF in any FWS/CFWS that appears within the quoted-string are semantically invisible and therefore not part of the quoted-string either.
See also

type local = word list 
type raw = Rfc2047.raw = 
| QuotedPrintable of string
| Base64 of MrMime_base64.Decoder.result
It's an encoded-word from RFC2047. An encoded-word is a sequence of printable ASCII characters that begins with "=?", ends with "?=", and has two "?"s in between. It specifies a character set and an encoding method, and also includes the original text encoded as graphic ASCII characters, according to the rules for that encoding method.

MrMime recognizes encoded-words when they appear in certain protions of the message header. Instead of displaying the encoded-word "as is", it will reverse the encoding and display the original text.

NOTE: the client need to translate the original text into the designated character set (like utf-8) - this feature is in TODO.
See also RFC2047

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 .. end
module Decoder: sig .. 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 .. end
module Make: sig .. end
module Extension: sig .. end