module Address: MrMime_address
typeword =
[ `Atom of string | `String of string ]
word
is a combinations of atoms
and/or quoted-strings
:
word = atom / quoted-string
atom
is interpreted as a single unit, comprising the string of
characters that make it up. Semantically, the optional comments and FWS
surrounding the rest of the characters are not part of the atom; the atom is
only the run of atext
characters in an atom. 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) [FWS] DQUOTE
[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
typelocal =
word list
typeraw =
Rfc2047.raw
=
| |
QuotedPrintable of |
| |
Base64 of |
"=?"
, 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
typeliteral_domain =
Rfc5321.literal_domain
= ..
type
MrMime_address.literal_domain +=
| |
IPv4 of |
type
MrMime_address.literal_domain +=
| |
IPv6 of |
typephrase =
[ `Dot
| `Encoded of string * raw
| `Word of word ] list
typedomain =
[ `Domain of string list | `Literal of literal_domain ]
typemailbox =
Rfc5322.mailbox
= {
|
name : |
|
local : |
|
domain : |
typegroup =
Rfc5322.group
= {
|
name : |
|
mailbox : |
typeaddress =
[ `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