Title: Email package issue with Outlook msg files
Type: Stage:
Components: email Versions: Python 3.9, Python 3.8, Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, heghine, r.david.murray
Priority: normal Keywords:

Created on 2021-07-20 16:02 by heghine, last changed 2021-07-24 01:08 by r.david.murray.

File name Uploaded Description Edit
msg file.msg heghine, 2021-07-20 16:02 The attached file is an msg file with which issue is reproducible
Messages (2)
msg397885 - (view) Author: Heghine (heghine) Date: 2021-07-20 16:02
The email package has an issue with extracting the attachments from the email if the email is sent with the Outlook application with .msg files.

When I'm sending an email from the Outlook app by attaching .msg files to the email, the recipient receives the email but instead of .msg files, the email contains .eml files. So Outlook auto transforms the attached .msg to .eml.
When I'm trying to read and extract attachments with the email package by using the Message class "get_payload" method, the extracted data for the mentioned attachment doesn't contain necessary information like "content-disposition" or "filename", so working with that attachment is impossible.

For all other .eml files everything works fine. The issue exists only in the case of transformed .eml files. However, that .eml looks like any other eml file in the received mail.
msg398110 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2021-07-24 01:08
That file appears to be a binary file?  By itself it isn't enough to reproduce the problem.  Can you provide a complete script as well as the email message you are parsing that demonstrates the problem?

By "looks like any other eml file", are you including the MIME headers associated with the part?  Because it is the MIME headers that contain the information you say is missing.  Mostly likely, outlook is not supplying that information for these transformed eml files.  If you can supply a copy of the actual email message you are parsing, we should be able to confirm that.
Date User Action Args
2021-07-24 01:08:00r.david.murraysetmessages: + msg398110
2021-07-20 16:02:15heghinecreate