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

Change EML parser/viewer behavior to inline extra txt/html body parts instead of extracting them as attachments #1623

Closed
lfcnassif opened this issue Apr 7, 2023 · 5 comments · Fixed by #1562
Assignees
Labels

Comments

@lfcnassif
Copy link
Member

lfcnassif commented Apr 7, 2023

Current (intended) behavior is to take the first html or txt part and inline it as body, extracting all other html/txt parts as attachments. But this is not the behavior used by EML reader applications. We should always respect the Content-Disposition field value (inline or attachment), if it exists. Finally, sometimes the attachment name goes in the Content-Type name field, and not in Content-Disposition filename field. If any of them are populated, I think it is safe to consider the part as attachment, if the disposition field is not inline or if it doesn't exist, there are many eml files not following the specification out there...

@lfcnassif lfcnassif added the bug label Apr 7, 2023
@lfcnassif
Copy link
Member Author

A challenge here is inlining together html parts with different encodings, although the most common scenario is a single encoding used by all html parts.

@lfcnassif
Copy link
Member Author

Another detail is that inline images are inlined but also extracted as attachment, this was intentional to display them in the gallery and I think this behavior should be kept.

@lfcnassif lfcnassif changed the title Fix EML parser/viewer to inline extra txt/html body parts instead of extracting them as attachments Change EML parser/viewer behavior to inline extra txt/html body parts instead of extracting them as attachments Apr 7, 2023
lfcnassif added a commit that referenced this issue Apr 11, 2023
@lfcnassif
Copy link
Member Author

Reopening this since I detected some email bodies are now being rendered empty.

@lfcnassif lfcnassif reopened this Apr 11, 2023
@lfcnassif
Copy link
Member Author

The issue probably is related to detecting alternative bodies, we should hide just the simpler duplicated version, usually txt.

@lfcnassif
Copy link
Member Author

Closing, seems there was no regression, a very few files (3) are just taking a while to render because they are trying to download Internet resources, what is being blocked by the security manager.

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

Successfully merging a pull request may close this issue.

1 participant