The email headers in your screenshot have been encoded per RFC 2047 ("MIME Part Three: Message Header Extensions for Non-ASCII Text"). TIdIMAP4.UIDRetrieveAllEnvelopes()
captures and stores the raw data and does not automatically decode it. You can use the various Decode...()
functions in the IdCoderHeaader.pas
unit to decode the headers manually, eg:
uses
..., IdCoderHeader;
var
IdMsg: TIdMessage;
s: String
begin
...
for c := 0 to FIMAPClnt.MessageList.Count - 1 do
begin
IdMsg := FIMAPClnt.MessageList[c];
IdMsg.Subject := DecodeHeader(IdMsg.Subject);
DecodeAddresses(IdMsg.FromList);
DecodeAddress(IdMsg.Sender);
DecodeAddresses(IdMsg.ReplyTo);
DecodeAddresses(IdMsg.Recipients);
DecodeAddresses(IdMsg.CCList);
DecodeAddresses(IdMsg.BccList);
...
end;
...
end;