Skip to content

Prefer plain text body when available#136

Open
mjforan wants to merge 3 commits intoYoRyan:mainfrom
mjforan:main
Open

Prefer plain text body when available#136
mjforan wants to merge 3 commits intoYoRyan:mainfrom
mjforan:main

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