3
我正在使用python的IMAPClient
從IMAP服務器中檢索電子郵件。我檢索的屬性之一是BODYSTRUCTURE
。但是,我找不到有關如何解釋返回值的任何文檔。以下是IMAP服務器返回的身體結構如何理解IMAP服務器返回的BODYSTRUCTURE信息?
16:12.679978 < FLAGS (NotJunk $NotJunk \Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "QUOTED-PRINTABLE" 4888 170 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "us-ascii") NIL NIL "QUOTED-PRINTABLE" 32407 479 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "Apple-Mail=_3AAA7CD7-3B07-406A-83CB-2C7762C3306E") NIL NIL)("APPLICATION" "PKCS7-SIGNATURE" ("NAME" "smime.p7s") NIL NIL "BASE64" 2414 NIL ("ATTACHMENT" ("FILENAME" "smime.p7s")) NIL) "SIGNED" ("BOUNDARY" "Apple-Mail=_DF4FE6BB-F796-46D7-A593-9723F4315DD2" "MICALG" "sha1" "PROTOCOL" "application/pkcs7-signature") NIL NIL))
下面是與python類型解析相同的身體結構。
"BODYSTRUCTURE": [
[
[
[
"TEXT",
"PLAIN",
[
"CHARSET",
"us-ascii"
],
null,
null,
"QUOTED-PRINTABLE",
4888,
170,
null,
null,
null
],
[
"TEXT",
"HTML",
[
"CHARSET",
"us-ascii"
],
null,
null,
"QUOTED-PRINTABLE",
32407,
479,
null,
null,
null
],
"ALTERNATIVE",
[
"BOUNDARY",
"Apple-Mail=_3AAA7CD7-3B07-406A-83CB-2C7762C3306E"
],
null,
null
],
[
"APPLICATION",
"PKCS7-SIGNATURE",
[
"NAME",
"smime.p7s"
],
null,
null,
"BASE64",
2414,
null,
[
"ATTACHMENT",
[
"FILENAME",
"smime.p7s"
]
],
null
]
],
"SIGNED",
[
"BOUNDARY",
"Apple-Mail=_DF4FE6BB-F796-46D7-A593-9723F4315DD2",
"MICALG",
"sha1",
"PROTOCOL",
"application/pkcs7-signature"
],
null,
null
],
該陣列似乎不是恆定的長度。陣列的每個元素代表什麼?