-
-
Notifications
You must be signed in to change notification settings - Fork 173
Opening MSG files that contain MS Teams messages throws UnrecognizedMSGTypeError: Could not recognize MSG class type "IPM.SkypeTeams.Message" #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Apparently the response I had to this never got sent, and I only realized now. Apologies for that. Unfortunately, that type isn't actually documented, so I'll need examples to implement code that properly understands it. Any that you can provide would be great, but I can try to see if I can generate my own. |
@TheElementalOfDestruction: Thanks for the response! I am sorry that I did not reply within almost 9 months. 🙏
I cannot share client data, so I looked for ways to create an example MSG file without any sensitive information. Apparently, MSG files of this class are produced by exporting search results from Microsoft Purview eDiscovery. However, the MSG format for MS Teams messages seems to be unavailable for new searches since 2022. Instead of trying to produce example MSG files, I forked the library and in commit Witiko@4b5ff13, I updated the library to recognize the class "IPM.SkypeTeams.Message" as a message type. I verified that this fixes the problem on 107 different client MSG files with the class "IPM.SkypeTeams.Message". Therefore, I opened PR #440 that should close this issue. |
Have you confirmed that there doesn't appear to be any special data entries we should have implemented in a custom type? I'd rather make absolutely sure we get this as implemented as possible. One way I tend to go about this is to try and open the file in outlook and print it if possible. If a print option works to bring up print preview, I take a look at what headers at the top appear and see if there are any that are different from regular outlook messages. If it does have differences you can quickly identify, implementing a new class for it is easy since Message and MessageBase are functionally identical, with Message just being a subclass of MessageBase which adds no functionality, only used for identifying that an MSG file is specifically of type message. If this format doesn't follow along with how standard messages work, id rather it have its own class. |
I took one of the client files at random and I opened it in Outlook from Office 365. Here is the redacted print preview: The rest of the first printed page lists dozens of other recipients, followed by the text of the message on the second page: Therefore, the only headers seem to be From, Date, and To. Opening the same file with my patched version of
>>> import extract_msg
>>> message = extract_msg.openMsg('client-file.msg')
>>> sorted([key for key, value in message.header.items() if value])
['Date', 'From', 'Message-Id', 'To'] There are also empty headers Authentication-Results, Bcc, and Cc: >>> sorted(message.header.keys())
['Authentication-Results', 'Bcc', 'Cc', 'Date', 'From', 'Message-Id', 'To'] Does this seems as sufficient evidence that there are no special data entries or would you like me to try something else? |
Aside from checking that all of that data appears in the body itself, that all looks good enough for me to consider it just a new flavor of Message and call it a day. If you discover a problem with that implementation, you can just submit a new pull request while I accept the original one. |
I just finished submitting the current code to a new release, 0.51.0. If everything looks good, you can close this issue |
Looks good to me, thanks! |
Bug Metadata
extract_msg
packageDescribe the bug
Opening MSG files that contain MS Teams messages causes the following exception to be thrown:
Calling the function
extract_msg.openMsg()
immediately causes the exception to be thrown.Traceback
The text was updated successfully, but these errors were encountered: