Legend:
Library
Module
Module type
Parameter
Class
Class type
Local part of a mailbox is a non-empty list of word elements. You can construct local-part like this:
let local = Local.(v [ w "romain"; w "calascibetta" ]) ;;
val local : local = [ `Atom "romain"; `Atom "calascibetta" ]
Spaces and control characters are allowed in the local-part:
let local = Local.(v [ w "Romain Calascibetta"; w "to+mrmime" ]) ;;
val local : local = [ `String "Romain Calascibetta"; `Atom "to+mrmime" ]
Local.to_string local ;;
- : string = "\"Romain Calascibetta\".to+mrmime"
NOTE: + permits your MUA to tag e-mails received with this local-part.
Valid UTF-8 string is allowed according RFC 6532 - and will be surrounded by double-quote.
w produces a safe word. w will try to escape control characters and verify if contents respects standards. Otherwise, w raises an Invalid_argument. `Word produced by w can be surrounded by double-quote.
val word : string ->(Emile.word, [> Rresult.R.msg ])Stdlib.result
word x tries to normalize x as a `Word according RFC 5322. It returns Error if x does not respect standards. If contents is an UTF-8 contents, word will surround x with double-quote and will escape control characters (see escape_string).
NOTE: UTF-8 is allowed in e-mails according RFC 6532.
val word_exn : string ->Emile.word
Same as word but raises an exception instead to return Error.