mooijtech / go-pst

Personal Storage Table implementation in Go/Golang
https://mooijtech.github.io/go-pst/
Apache License 2.0
25 stars 8 forks source link

Unable to receive .msg files as an attachments #10

Open yakomisar opened 1 year ago

yakomisar commented 1 year ago

Is your feature request related to a problem? Please describe. During the parsing procedures we are unable to receive attachments that represent .msg files. Instead we have files with "UNKNOWN..." names.

Describe the solution you'd like Would like to get attachments in their native format. In this particular case -> .msg files. It would be great for further analysis using proprietary applications.

mooijtech commented 1 year ago

If you open the file the content should still be of the .msg file, the problem is attachment.GetAttachLongFilename() is empty so a fallback is used (UNKNOWN...).

yakomisar commented 1 year ago

I understand, but when encountering an attachment with an unknown extension, it is difficult to determine its specific format and, therefore, an application that can open it.

mooijtech commented 1 year ago

You could check the magic bytes via https://github.com/gabriel-vasile/mimetype Possibly GetAttachExtension() returns something but I haven't checked.

McFlip commented 1 year ago

I attempted to write out an .msg attachment as a file and only got a small amount of garbage data. I created a test PST file with a single message containing a single attachment - an .msg file. I followed the example code. I believe it's not parsing .msg attachments.

mooijtech commented 1 year ago

@McFlip Would it be possible to send me the test PST file (my email is info@mooijtech.com) so I can reproduce and possibly fix this issue?

McFlip commented 1 year ago

@McFlip Would it be possible to send me the test PST file (my email is info@mooijtech.com) so I can reproduce and possibly fix this issue?

On the way! edit: I had a typo in your address. I sent it again.

mooijtech commented 1 year ago

Thanks for the test PST files, makes it much easier to solve. It seems these are using a different attachment method than the norm as I have never seen this before. I am attempting to support more attachment methods now (embedded).

mooijtech commented 1 year ago

I can now read the embedded attachment, this should be the OLE format. Possibly it's also compressed because I am getting 11.7KiB instead of 60.5KiB.

Should be solved in a few days.

mooijtech commented 1 year ago

ETA may be extended a week since support for writing PST files came up

McFlip commented 10 months ago

@mooijtech Hi friend. Any updates? I've been using readpst as a workaround but I would love to use your lib instead.