verdammelt / tnef

tnef
GNU General Public License v2.0
58 stars 21 forks source link

tnef support for recognising / handling e-mail bodies in TNEF format #38

Closed martin-cs closed 6 years ago

martin-cs commented 6 years ago

Hi, I've been having issue with TNEF format and thought it best to write up what I've found so far. I've been receiving e-mail from a colleague running what I suspect to be a newer Microsoft mail client. These have an "attachment" in TNEF format which (with the aid of a hex editor) turns out to be the HTML formatted (ofcourse) contents of the e-mail. tnef silently "fails" to handle these because:

. TNEF key is 695e rather than 363 . There is no attATTACHRENDDATA 0x9002 object, so no file is set-up and hence there is no output, debug or otherwise. *. However the 0x9003 field is still present and contains a byte stream which is the e-mail.

I'll see if I can get you an example.

Although it may be outside of scope of tnef, would it be possible to warn in verbose or debug mode that the winmail.dat file is not empty but does not contain an attachment? Thanks.

verdammelt commented 6 years ago

Please give me an example I'll need it for testing and investigation. Especially good would be an example file that I could include in the project for my automated tests.

It could be that the TNEF format has been changed (thus the change in key) - I'll need to research that.

If you can, it would be interesting to see if --save-body option of tnef could be used to get the HTML body out (after working around the key issue...)

martin-cs commented 6 years ago

On Fri, 2018-05-25 at 09:19 -0700, Mark Simpson wrote:

Please give me an example I'll need it for testing and investigation. Especially good would be an example file that I could include in the project for my automated tests.

It could be that the TNEF format has been changed (thus the change in key) - I'll need to research that.

If you can, it would be interesting to see if --save-body option of tnef could be used to get the HTML body out (after working around the key issue...)

Thanks for the prompt response. If you send me an e-mail address I'll send over an example.

verdammelt commented 6 years ago

Please email me the example at verdammelt@gmail.com

verdammelt commented 6 years ago

It looks like the examle file ended up in my spam folder (thanks gmail!). I will try to review it soon.

martin-cs commented 6 years ago

Oh the irony! Thanks for chasing this.

martin-cs commented 6 years ago

On Sun, 2018-06-24 at 07:06 -0700, Mark Simpson wrote:

It looks like the examle file ended up in my spam folder (thanks gmail!). I will try to review it soon.

I've sent you some more (no hassle / urgency) and just in case GMail decides to eat them ... you've got mail.

verdammelt commented 6 years ago

I got them - thanks. And, hopefully I'll get a chance to look at them soon. Sorry for the delay.

martin-cs commented 6 years ago

On Wed, 2018-07-11 at 18:41 -0700, Mark Simpson wrote:

I got them - thanks. And, hopefully I'll get a chance to look at them soon. Sorry for the delay.

No worries; no urgency.

verdammelt commented 6 years ago

I have taken a look at the 3 data files you have sent me. In no case have I had any particular problem using tnef to process the files. In no case were there any problems with the TNEF keys.

The first file (which you sent to me in a compressed tar archive contained an RTF message body which matches the body.rtf file you sent me.

The second and third (which you sent me as copies of email messages - I extracted the attachment and base64-decoded them...) contained HTML message bodies.

I was using tnef version 1.4.17 which is the latest version (released on 2018-01-13) on the MacOSX platform. What version and OS are you using?

martin-cs commented 6 years ago

On Wed, 2018-07-18 at 19:04 -0700, Mark Simpson wrote:

I have taken a look at the 3 data files you have sent me. In no case have I had any particular problem using tnef to process the files. In no case were there any problems with the TNEF keys.

The first file (which you sent to me in a compressed tar archive contained an RTF message body which matches the body.rtf file you sent me.

The second and third (which you sent me as copies of email messages - I extracted the attachment and base64-decoded them...) contained HTML message bodies.

I was using tnef version 1.4.17 which is the latest version (released on 2018-01-13) on the MacOSX platform. What version and OS are you using?

1.4.17 on Debian Stretch. When I opened this I didn't know about -- save-body / that TNEF can contain things other than attachments. I think this may have been the original issue as there was a non- trivially sized TNEF that the tools couldn't extract any attachments from.

Thanks for looking at this. I'm happy for you to close this for now and if I run into similar issues again I will open another issue.

Cheers,

verdammelt commented 6 years ago

Excellent! Glad it was just a misunderstanding / poorly advertised features. Sorry it took so long to figure that out.