Skip to content
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

message/rfc822 part containing text/html subpart incorrectly gets used as body (despite content_disposition being 'attachment') #393

Open
tbraeutigam opened this issue Sep 8, 2016 · 0 comments

Comments

@tbraeutigam
Copy link
Contributor

Hi all,

Today I had received an Email, that has two parts:

  1. text/plain
  2. message/rfc822 with Content-Disposition: attachment

The message/rfc822 contained an html email generated by 'Office Communicator conversation history archiver'.

What was supposed to happen (and happens in Outlook Web App):

  • text/plain is used as the message body
  • An attachment EML is created (with the filename being set to the contained emails Subject)

What actually happened:

  • text/plain part was discarded
  • message/rfc822 had the contained text/html part extracted and used as the msg.body
  • A 0 byte attachment named 'Unnamed Attachment' was created

The Problem seems to be with the usage of walk().
Going with a single, standard flanker run (for part in msg.parts: [...]) yields the expected two messages.
Using for part in msg.walk(with_self=msg.content_type.is_singlepart()): yields three messages -- the text/html one has been extracted.

The following zip contains the python scripts and example message that illustrate the issue:
nylas.zip

Best Regards,
Thorben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant