Engine/Mime Rules PEG
Generic MIME rules using PEG Grammar
mail <- (header)* EOL (body)?
header <- [simple_header| long_header]
simple_header <- header_key “:” header_value (CRLF)*
long_header <- (CRLF) text (WSP CRLF)*
header_key <- text_without_colon
header_value <- text
body <- preamble (body_part)* end_boundary
preamble <- (text)?
body_part <- inicial_boundary part EOL
inicial_boundary <- “–” text EOL
end_boundary <- inicial_boundary “–” EOL
part <- (header)* text
text_without_colon <- [ALPHA] [DIGIT] [SYMBOL]
text <- [ALPHA] [DIGIT] [SYMBOL] [COLON]
ALPHA <- [A-Z] [a-z]
DIGIT <- [0-9]
SYMBOL <- [“!” “#” “$” “%” “&” “’” “*" “+” “-” “/” “\” “=” “?” “^” “_" “`” “{” “|” “}” “~” “\[" “\]” “@” “;” “.” “<” “>” “\”“]
COLON <- [“:”]