Skip to content

Text attachments appear as message body in some mail clients #655

tlconnor opened this Issue Jan 17, 2014 · 2 comments

3 participants


The default part sort order is [ "text/plain", "text/enriched", "text/html" ]. If a multipart email contains text and html parts as well as a text attachment, the text attachment will often appear before the text body in the message.

In some mail clients this results in the attachment being treated as the message body.

I'm not sure if this is something that should be fixed, but if it is, a simple solution would be to look for content-disposition=attachment when sorting parts.

I can send a pull request if this seems like a legitimate bug.


This is technically a problem with the email client, since it is ignoring "Content-Disposition: attachment". That being said, I think it should be worked around on this side of things. Outlook 2013 will just hide a plain-text attachment if it comes before the html version of the message body because it assumes the attachment is the plain-text version of the message body. Moving the plain-text attachment after the html message body causes it to be interpreted correctly as an attachment.

jeremy commented Apr 20, 2016
@jeremy jeremy closed this Apr 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.