Internet Direct (Indy) Version 9.0.2 Beta
TIdMessageDecoderMIME.ReadHeader
Implements the method used to read an RFC message header from a MIME-encoded message part.

procedure ReadHeader; override;
Description
ReadHeader is an overridden procedure in TIdMessageDecoderMIME that implements the method used to read an RFC-822 compliant message header from a MIME-encoded message part.

ReadHeader calls ReadLn to retrieve lines from the message part until a blank line, that signals the end of message headers, is retrieved. Message headers are added to the Headers property, with folded header lines being added to the most recent message header.

When ReadHeader has retrieved all message header line, the content-disposition header is examined to determine if the message part contains an attachment.

ReadHeader will update the message part type to ptText when an attachment is not found. When an attachment is indicated in the content-disposition message header, ReadHeader sets the message part type to ptAttachment and parses an optional filename into the Filename property.