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

Prefer plain text body when available #136

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

mjforan
Copy link

@mjforan mjforan commented Dec 15, 2024

Problem: #135

Solution: While familiarizing with the python email library, I noticed that get_body() accepts a parameter for which MIME type you want to receive. I found that adding this parameter and removing the current multipart parser works for my use case. I also added a config option to switch between text/html-preferred.

Testing: I only tested on my personal use case. I'm not sure why _getmultiparttext exists in the first place; maybe there are some cases where get_body() fails? Maybe when this was first implemented get_body() did not parse multipart messages?

I wasn't sure if the config option should be global or per-address.

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

Successfully merging this pull request may close these issues.

1 participant