RaelB 4 Posted May 8, 2021 Hello, I have been using the IdCoderTNEF unit to decode winmail.dat messages. This has worked fine for me in the past, however in the last couple of months, I have been receiving this error when trying to parse such messages: EIdTnefUnknownMapiType: Encountered unknown MAPI type: 72, attribute: 32768 I am using the latest version of IdCoderTNEF from the github repo (Latest commit 5fb9225 on 26 Nov 2019 ) Part of my code looks like this: var J: Integer; TnefMsg: TIdMessage; TNefCoder: TIdCoderTNEF; begin .... for J := 0 to IdMessage.MessageParts.Count - 1 do begin if IdMessage.MessageParts[J] is TIdText then .... if IdMessage.MessageParts[J] is TIdAttachment then begin ... TNefCoder := TIdCoderTNEF.Create; try if TNefCoder.IsFilenameTnef(IdMessage.MessageParts[J].FileName) then begin TnefMsg := TIdMessage.Create(nil); try TNefCoder.Parse(IdMessage.MessageParts[J] as TIdAttachment, TNefMsg); ProcessMessage(TNefMsg); finally TnefMsg.Free; end; end else SaveMessagePart(IdMessage, IdMessage.MessageParts[J], UserName); finally TNefCoder.Free; end; end; end; .... Are you aware of such an issue? Thanks Share this post Link to post
Remy Lebeau 1436 Posted May 10, 2021 (edited) Type 72 is PT_CLSID, not sure what attribute 32768 ($8000) is. TIdCoderTNEF does not implement either one at this time. There are a LOT of MAPI properties that are not implemented yet. TIdCoderTnef is mainly concerned with extracting things that make sense to apply to a TIdMessage. I can look into maybe having TIdCoderTnef just skip unknown fields instead of raising an exception on them. Or maybe exposing an event so user code can decide what to do with them. Edited May 10, 2021 by Remy Lebeau Share this post Link to post
RaelB 4 Posted May 10, 2021 I changed over to use https://github.com/CleverComponents/Tnef-Parser . It looks like it is a comprehensive implementation. Share this post Link to post