Closed princeoffoods closed 10 years ago
I hadn't originally planned on implementing support for it, but you are the second person who has asked about it... perhaps I need to reconsider.
Let me do some research into this to figure out what it would involve...
In either case, it's probably worth keeping this open so other people can perhaps chime in.
It seems like the damn TNEF just won't go away. Thank you for looking into this.
Looks like the spec can be found here: http://msdn.microsoft.com/en-us/library/cc425498%28v=exchg.80%29.aspx
I'm going to need some sample tnef files that I can use to make sure my code works and also, if possible, to include in the unit tests
It's great how quickly you are implementing this! Can't publish customer emails, but I'll be happy to test all emails in our database.
I found tnef samples on the web, which can hopefully help to get testing started: http://sourceforge.net/p/tnef/git/ci/master/tree/tests/files/datafiles/
It's not quite ready for testing, but hopefully it will be soon. Thanks for the link to some test files.
What kind of info are you hoping to get out of the TNEF files, btw? I'm told modern clients don't put much of anything but some MAPI properties in them anymore?
I just need to access the attachments contained in tnef files just like all other attachments.
When a potential new customer wants a quick quotation and sends specifications or drawings contained inside a tnef file it's not an option to lecture them on configuring vintage outlook clients or exchange servers :)
Getting close to having this working... hopefully you don't need to extract compressed rtf attachments? or if you do, is it enough to extract the compressed blob rather than decompressing them?
Got all of the unit tests passing except for 1 which is a TNEF stream embedded in a TNEF stream.
Give the new MimeKit.Tnef.TnefPart API a try...
You probably want MimeKit.Tnef.TnefPart.ExtractAttachments()
Thank you very much for the updates!
I'm getting an exception when calling .ConvertToMessage() or .ExtractAttachments(). Looking into it...
System.NotSupportedException occurred HResult=-2146233067 Message=The stream does not support seeking Source=MimeKit StackTrace: at MimeKit.IO.FilteredStream.get_Position() at MimeKit.Tnef.TnefReader.ReadAhead(Int32 atleast) at MimeKit.Tnef.TnefReader.ReadInt32() at MimeKit.Tnef.TnefReader.DecodeHeader() at MimeKit.Tnef.TnefReader..ctor(Stream inputStream, Int32 defaultMessageCodepage, TnefComplianceMode complianceMode) at MimeKit.Tnef.TnefReader..ctor(Stream inputStream) at MimeKit.Tnef.TnefPart.ConvertToMessage()...
This should be fixed now
Great. But I got another one :)
TnefPart.BodyParts contains too many items.
For example the one rtf is included twice and the single attachment of the message is included 7 times.
ok, try now
Works great.
So far I tested about 50 emails with tnef encoded attachments and I'm happy to report MimeKit handled them all without any problems.
Jeff, I just want to thank you again for providing TNEF support. It's very well integrated and easy to use.
no prob, glad to hear it works!
Hello Jeff,
Is there any chance that support for decoding TNEF encoded messages will be added in the future or is this completely out of the scope of MimeKit?