go-pst icon indicating copy to clipboard operation
go-pst copied to clipboard

Unable to receive .msg files as an attachments

Open yakomisar opened this issue 2 years ago • 10 comments

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.

yakomisar avatar Jun 13 '23 12:06 yakomisar

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...).

mooijtech avatar Jun 13 '23 12:06 mooijtech

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.

yakomisar avatar Jun 13 '23 14:06 yakomisar

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

mooijtech avatar Jun 13 '23 15:06 mooijtech

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.

McFlip avatar Aug 20 '23 18:08 McFlip

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

mooijtech avatar Aug 21 '23 08:08 mooijtech

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

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

McFlip avatar Aug 21 '23 20:08 McFlip

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 avatar Aug 23 '23 13:08 mooijtech

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 avatar Aug 23 '23 19:08 mooijtech

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

mooijtech avatar Aug 26 '23 12:08 mooijtech

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

McFlip avatar Jan 18 '24 20:01 McFlip