module MrMime_msgID:sig..end
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
"@".typedomain =[ `Domain of string list | `Literal of string ]
"@".typemsg_id =local * domain
msg-id syntax is a limited version of the
addr-spec construct enclosed in the angle bracket characters, "<" and
">". Unlike æddr-spec, this syntax only permits the dot-atom-text form
on the left-hand side of the "@" and does not have internal CFWS
anywhere in the message identifier.val pp_local : Format.formatter -> local -> unitpp_local fmt local prints an human readable representation of the
left-hand side of the "@".val pp_domain : Format.formatter -> domain -> unitpp_domain fmt local prints an human readable representation of the
right-hand side of the "@".val pp : Format.formatter -> msg_id -> unitpp fmt msg_id prints an human readable representation of msg_id.module Encoder:sig..end
module Decoder:sig..end
val of_string : ?chunk:int -> string -> msg_id optionof_string ~chunk:1024 buf parses an
RFC5322 message ID
starting at 0 in buf.
This function allocates a internal buffer with chunk size (default to
1024).
val of_string_raw : ?chunk:int -> string -> int -> int -> (msg_id * int) optionof_string_raw ~chunk:1024 buf off len parses an
RFC5322 message ID
starting at off in buf to a tuple (msg_id, count) with;
msg_id the message IDcount the number of bytes read starting at off to parse the date.chunk size (default to
1024).