Reputation: 15660
In IMAP4, how can I check the content-type of one part of a body? Or more generally, to get the headers of a body part. ie, the headers of an attachment, headers of a html or text content, etc, which are all some parts of the the whole message body. I tried something like that:
. fetch 3709 (flags body.peek[3][header.fields (content-type)])
. BAD Command Argument Error. 11
My intention was to get the content-type of the body's part 3 so that I can know how to read it. Like whether if the part is a plain text or html or an attachment. My worry is that I don't know if the part number for one message is always the same for the other; eg, the body part 2 may be a html content for message #3700 but the body part 2 may be an attachment for message #3701.
But the above command returned as error. How should I phrase my command on telnet to get the content-type of one part of the body?
Upvotes: 1
Views: 1757
Reputation: 501
You have syntax error per RFC https://www.rfc-editor.org/rfc/rfc3501#section-6.4.5
body.peek[3][header.fields (content-type)] should be body.peek[3.header.fields (content-type)])
Upvotes: -2