附属書A. 複雑なマルチパートの例

Appendix A -- A Complex Multipart Example

次に示すのは,複雑なマルチパートメッセージの輪郭である。 このメッセージは,連続的に表示される五つの部分,すなわち,二つの導入のプレーンテキストのオブジェクト,組み込まれたマルチパートメッセージ,text/enrichedのオブジェクト,最後の非ASCII文字集合でのカプセル化されたテキストを含む。 組み込まれたマルチパートメッセージ自体は,二つのオブジェクトを含み,それらは並列に提示される写真及び音声の断片である。

 次のマルチパートメッセージの例の中に,原規定ではすべて説明文がUS-ASCIIで記述されているが,ここでは日本語に翻訳した。したがってUS-ASCIIしか入れることのできない部分にも説明文の日本語が書かれているが,US-ASCIIで書かれているものとして読んでほしい。

What follows is the outline of a complex multipart message. This message contains five parts that are to be displayed serially: two introductory plain text objects, an embedded multipart message, a text/enriched object, and a closing encapsulated text message in a non-ASCII character set. The embedded multipart message itself contains two objects to be displayed in parallel, a picture and an audio fragment.
     MIME-Version: 1.0
     From: Nathaniel Borenstein 
     To: Ned Freed 
     Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT)
     Subject: A multipart example
     Content-Type: multipart/mixed;
                   boundary=unique-boundary-1

     ここはマルチパートの前文の領域である。マルチパート
     フォーマットを理解するメールリーダはこの前文を無視
     したほうがよい。

     あなたがこのテキストを読んでいる場合,マルチパート
     メッセージを正しく表示する方法を理解するメールリーダへ
     変更することを検討したほうがよいかもしれない。

     --unique-boundary-1

       ... テキスト(US-ASCII)が書かれている ...

     [このパートの境界とテキストの開始との間の空白は,
      ヘッダフィールドが与えられなかったことを意味し,
      これはUS-ASCII文字集合でのテキストである。
      次の部分のように,明示的に打ち込むこともできる。]

     --unique-boundary-1
     Content-type: text/plain; charset=US-ASCII

     これは前の部分の一部とすることもできるが、ここでは
     本体部分の打ち込みの明示対暗黙の対比として示す。     

     --unique-boundary-1
     Content-Type: multipart/parallel; boundary=unique-boundary-2

     --unique-boundary-2
     Content-Type: audio/basic
     Content-Transfer-Encoding: base64

       ... ここにbase64符号化された,8000Hzの
           mu-lawフォーマットの音声データが置かれる ...

     --unique-boundary-2
     Content-Type: image/jpeg
     Content-Transfer-Encoding: base64

       ... ここにbase64符号化された画像が置かれる ...

     --unique-boundary-2--

     --unique-boundary-1
     Content-type: text/enriched

     This is <bold><italic>enriched.</italic></bold>
     <smaller>as defined in RFC 1896</smaller>

     Isn't it
     <bigger><bigger>cool?</bigger></bigger>

     --unique-boundary-1
     Content-Type: message/rfc822

     From: (mailbox in US-ASCII)
     To: (address in US-ASCII)
     Subject: (subject in US-ASCII)
     Content-Type: Text/plain; charset=ISO-8859-1
     Content-Transfer-Encoding: Quoted-printable

       ... ここにISO-8859-1での追加のテキストが置かれる ...

     --unique-boundary-1--
MIME-Version: 1.0 From: Nathaniel Borenstein <nsb@nsb.fv.com> To: Ned Freed <ned@innosoft.com> Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) Subject: A multipart example Content-Type: multipart/mixed; boundary=unique-boundary-1 This is the preamble area of a multipart message. Mail readers that understand multipart format should ignore this preamble. If you are reading this text, you might want to consider changing to a mail reader that understands how to properly display multipart messages. --unique-boundary-1 ... Some text appears here ... [Note that the blank between the boundary and the start of the text in this part means no header fields were given and this is text in the US-ASCII character set. It could have been done with explicit typing as in the next part.] --unique-boundary-1 Content-type: text/plain; charset=US-ASCII This could have been part of the previous part, but illustrates explicit versus implicit typing of body parts. --unique-boundary-1 Content-Type: multipart/parallel; boundary=unique-boundary-2 --unique-boundary-2 Content-Type: audio/basic Content-Transfer-Encoding: base64 ... base64-encoded 8000 Hz single-channel mu-law-format audio data goes here ... --unique-boundary-2 Content-Type: image/jpeg Content-Transfer-Encoding: base64 ... base64-encoded image data goes here ... --unique-boundary-2-- --unique-boundary-1 Content-type: text/enriched This is <bold><italic>enriched.</italic></bold> <smaller>as defined in RFC 1896</smaller> Isn't it <bigger><bigger>cool?</bigger></bigger> --unique-boundary-1 Content-Type: message/rfc822 From: (mailbox in US-ASCII) To: (address in US-ASCII) Subject: (subject in US-ASCII) Content-Type: Text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: Quoted-printable ... Additional text in ISO-8859-1 goes here ... --unique-boundary-1--