[Imap-protocol] Question on BODYSTRUCTURE
李艾倫 <[email protected]>
| Newsgroups | gmane.mail.imap.general |
|---|---|
| Message-ID | <[email protected]> |
I'm working on parsing email to construct BODYSTRUCTURE response back to
client.
I put together a simple email with some text, image and an attachment on
gmail, so I can have a guideline by comparing its response back to RFC.
Here's the response :
* 35 FETCH (BODYSTRUCTURE (((("TEXT" "PLAIN" ("CHARSET" "big5") NIL NIL
"7BIT" 860 14 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "big5") NIL NIL
"QUOTED-PRINTABLE" 4347 63 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY"
"----=_NextPart_002_0025_01CE5E06.E9940610") NIL NIL)("IMAGE" "PNG" ("NAME"
"image001.png") "<[email protected]>" NIL "BASE64" 231788 NIL
NIL NIL) "RELATED" ("BOUNDARY" "----=_NextPart_001_0024_01CE5E06.E9940610")
NIL NIL)("IMAGE" "PNG" ("NAME" "DNS_MX_RECORD.png") NIL NIL "BASE64" 73572
NIL ("ATTACHMENT" ("FILENAME" "DNS_MX_RECORD.png")) NIL) "MIXED" ("BOUNDARY"
"----=_NextPart
_000_0023_01CE5E06.E9940610") NIL NIL))
However, when I tried to match up the fields with RFC, it seemed to be
missing an extension data item or am I misinterpreting the RFC?
For the non-multipart body part, I thought the format should be :
body-type body-subtype (parenthesized list of parameter) body-id body-desc
body-encoding body-size
if body-type = "text" then follow by <number of lines in body>
if body-type = "message" and body-subtype = "rfc822" then follow by
envelope, body structure, number of lines in message
lastly, follow by 4 extension data items : MD5, body disposition, body
language, body location
so, shouldn’t the first part look like this instead?
("TEXT" "PLAIN" ("CHARSET" "big5") NIL NIL "7BIT" 860 14 NIL NIL NIL NIL)
<--- I added body location data item
Also, I couldn't figure out what are the remaining fields for the multipart.
In my example above, what do the last 2 NIL represent after "MIXED"
("BOUNDARY" "----=_NextPart
_000_0023_01CE5E06.E9940610")? I thought for multipart, it also follows by
4 extension data?
Thank you for your help~~
Helen
======================================
Powered by Rainbow Mail Server 6.0
本通訊之資訊可能含有受機密或特殊管制之資訊,僅供指定之收件人使用。若您並非指定之收件人,切勿轉寄、散佈、複製或公開本通訊內容之任何部份,並請即通知寄件人並完全刪除本通訊。
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. Please consider the environment before printing this email.
_______________________________________________
Imap-protocol mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-protocol