NoDecode
property NoDecode: Boolean read write;
Example
procedure LoadWithoutMIMEDecoding(const FileName: string);
var
Msg: TIdMessage;
begin
Msg := Email;
if Msg = nil then Exit;
Msg.NoDecode := True;
Msg.LoadFromFile(FileName, False);
end;
Usage
NoDecode makes receive processing capture the remaining wire body as text instead of MIME or transfer decoding it, while still parsing headers first.
Additional Technical Info
NoDecode controls receive-body processing. The default is False. When false, Indy selects transfer decoders, recognizes MIME boundaries and builds MessageParts. When true, it captures the entire remaining message body into Body and does not construct MIME text or attachment parts.
Headers are still read and ProcessHeaders still runs before the body. Typed header properties—including ContentType, CharSet, Encoding and MIMEBoundary—are therefore populated even though the subsequent body is not structurally decoded.
The no-decode path captures bytes with Indy's 8-bit transport handling and converts them through the declared message charset into Delphi strings. Transfer encodings such as base64 or quoted-printable and MIME boundary lines remain as textual payload. This is not a byte-exact raw-message mode: line handling, dot transparency and charset conversion still occur.
Retained configuration
Clear, ClearHeader and clear-first LoadFromStream do not reset NoDecode. Set it before loading; it survives the internal clear and affects that load. Remember to restore it explicitly if the same message object will later need decoded parts.
Combining NoDecode with NoEncode can be useful for a mostly raw textual pass-through, but it still is not lossless: headers and body are stored as strings and output uses RFC line writers. Validate size before capturing untrusted input because the whole encoded body is retained in memory rather than attachments being separated into managed files.
The example is source-reviewed only; no file was opened and no message parser was executed.
External references
- Indy upstream:
TIdMessageClient.ReceiveBody- no-decode capture and charset path. - Indy upstream:
IdMessage.pas- default and retained property lifetime. - RFC 2045, transfer encodings - encodings deliberately left undecoded by this mode.