2004-07-08 [長年日記]

IMAP4のBODYのセクション指定 (2)

昨日の例で具体的に何が返されるかです。

例1

元のデータ
MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[]
MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[HEADER]
MIME-Version: 1.0
Content-Type: text/plain
BODY[TEXT]
abc

例2

元のデータ
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[HEADER]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123
BODY[TEXT]
--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[1]
abc
BODY[1.MIME]
Content-Type: text/plain
BODY[2]
xyz
BODY[2.MIME]
Content-Type: application/octet-stream

例3

元のデータ
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

123
BODY[]
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

123
BODY[HEADER]
MIME-Version: 1.0
Content-Type: message/rfc822
BODY[TEXT]
MIME-Version: 1.0
Content-Type: text/plain

123
BODY[1]
MIME-Version: 1.0
Content-Type: text/plain

123
BODY[1.HEADER]
MIME-Version: 1.0
Content-Type: text/plain
BODY[1.TEXT]
123

例4

元のデータ
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[HEADER]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123
BODY[TEXT]
--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[1]
MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[1.HEADER]
MIME-Version: 1.0
Content-Type: text/plain
BODY[1.TEXT]
abc
BODY[1.MIME]
Content-Type: message/rfc822
BODY[2]
xyz
BODY[2.MIME]
Content-Type: application/octet-stream

例5

元のデータ
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[]
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[HEADER]
MIME-Version: 1.0
Content-Type: message/rfc822
BODY[TEXT]
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[1]
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[1.HEADER]
MIME-Version: 1.0
Content-Type: message/rfc822
BODY[1.TEXT]
MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[1.1]
MIME-Version: 1.0
Content-Type: text/plain

abc
BODY[1.1.HEADER]
MIME-Version: 1.0
Content-Type: text/plain
BODY[1.1.TEXT]
abc

例6

元のデータ
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[]
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[HEADER]
MIME-Version: 1.0
Content-Type: message/rfc822
BODY[TEXT]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[1]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[1.HEADER]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123
BODY[1.TEXT]
--123
Content-Type: text/plain

abc

--123
Content-Type: application/octet-stream

xyz

--123--
BODY[1.1]
abc
BODY[1.1.MIME]
Content-Type: text/plain
BODY[1.2]
xyz
BODY[1.2.MIME]
Content-Type: application/octet-stream

例7

元のデータ
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc


--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--

--123
Content-Type: application/octet-stream

rrr

--123--
BODY[]
MIME-Version: 1.0
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc


--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--

--123
Content-Type: application/octet-stream

rrr

--123--
BODY[HEADER]
MIME-Version: 1.0
Content-Type: message/rfc822
BODY[TEXT]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc


--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--

--123
Content-Type: application/octet-stream

rrr

--123--
BODY[1]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123


--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc


--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--

--123
Content-Type: application/octet-stream

rrr

--123--
BODY[1.HEADER]
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=123
BODY[1.TEXT]
--123
Content-Type: message/rfc822

MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc


--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--

--123
Content-Type: application/octet-stream

rrr

--123--
BODY[1.1]
MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc


--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--
BODY[1.1.HEADER]
MIME-Version: 1.0
Content-Type: multipart/related; boundary=abc
BODY[1.1.TEXT]
--abc
Content-Type: text/plain

abc

--abc
Content-Type: image/jpeg

xyz
--abc--
BODY[1.1.MIME]
Content-Type: message/rfc822
BODY[1.1.1]
abc
BODY[1.1.1.MIME]
Content-Type: text/plain
BODY[1.1.2]
xyz
BODY[1.1.2.MIME]
Content-Type: image/jpeg
BODY[1.2]
rrr
BODY[1.2.MIME]
Content-Type: application/octet-stream
[]