Passa al contenuto principale

Appendice A. Grammatica Raccolta (Collected Grammar)

Questa appendice contiene la grammatica BNF completa per tutte le regole di sintassi MIME definite nella RFC 2045.

Campi di Intestazione MIME

MIME-message-headers := entity-headers
fields
version CRLF

entity-headers := [ content CRLF ]
[ encoding CRLF ]
[ id CRLF ]
[ description CRLF ]
*( MIME-extension-field CRLF )

version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT

Content-Type

content := "Content-Type" ":" type "/" subtype
*(";" parameter)

type := discrete-type / composite-type

discrete-type := "text" / "image" / "audio" / "video" /
"application" / extension-token

composite-type := "message" / "multipart" / extension-token

extension-token := ietf-token / x-token

ietf-token := <An extension token defined by a
standards-track RFC and registered
with IANA.>

x-token := <The two characters "X-" or "x-" followed, with
no intervening white space, by any token>

subtype := extension-token / iana-token

iana-token := <A publicly-defined extension token.>

parameter := attribute "=" value

attribute := token

value := token / quoted-string

token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
or tspecials>

tspecials := "(" / ")" / "<" / ">" / "@" /
"," / ";" / ":" / "\" / <">
"/" / "[" / "]" / "?" / "="

Content-Transfer-Encoding

encoding := "Content-Transfer-Encoding" ":" mechanism

mechanism := "7bit" / "8bit" / "binary" /
"quoted-printable" / "base64" /
ietf-token / x-token

Content-ID

id := "Content-ID" ":" msg-id

Content-Description

description := "Content-Description" ":" *text

Nota:

  • Questa grammatica è usata in combinazione con il BNF di RFC 822
  • Alcune regole fanno riferimento a termini definiti in RFC 822
  • La grammatica completa richiede riferimento a RFC 822 e RFC 1123