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 mimetype to support inline images in thunderbird #144

Merged
merged 3 commits into from
May 27, 2022
Merged

Change mimetype to support inline images in thunderbird #144

merged 3 commits into from
May 27, 2022

Conversation

philpagel
Copy link

Change the content type from multipart/mixed to multipart/related so
that thunderbird will correctly recognize inline images.

Closes #142

Change the content type from `multipart/mixed` to `multipart/related` so
that thunderbird will correctly recognize inline images.

Closes #142
@awdeorio
Copy link
Owner

Looking good! I think the unit tests need a few minor tweaks to get them to pass. Also, have you had a chance to send a message with an inline attachment from this branch and verified that it looks correct on Thunderbird (and also Gmail)?

@philpagel
Copy link
Author

philpagel commented May 25, 2022

Oops – sorry for missing the testcase. I fixed that now.

I have sent emails with this branch to 3 different email accounts I have using both html and markdown templates including inline images. The emails did render as expected in all MUAs tried:

  • thunderbird (Linux)
  • gmail web
  • gmail app (Android)
  • k-9 Mail (Android)
  • t-online web email
  • 1&1 ionos web email

@awdeorio
Copy link
Owner

Great! Thanks for the thorough check. One last thing: it looks like there are a few outdated comments that need a tweak:

$ ag mixed
mailmerge/template_message.py
90:        method will create a new `multipart/mixed` message, copy message
131:        multipart/mixed
137:        top-level `multipart/mixed` message.
189:        Attachments are added to the payload of a `multipart/mixed` message.
193:        multipart/mixed
202:        multipart/mixed

@awdeorio
Copy link
Owner

awdeorio commented May 25, 2022

I'm tagging @seshrs who wrote the original attachments feature. The only exceptional case I can think of is a Markdown message without an inline attachment. It would have this message structure:

multipart/related
 └── multipart/alternative
     ├── text/plain (original markdown plaintext)
     └── text/html (converted markdown)

Instead of this one:

multipart/mixed
 └── multipart/alternative
     ├── text/plain (original markdown plaintext)
     └── text/html (converted markdown)

I tested this in GMail and it seems to work fine.

@codecov-commenter
Copy link

codecov-commenter commented May 27, 2022

Codecov Report

Merging #144 (64681ce) into develop (1a695a7) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop     #144   +/-   ##
========================================
  Coverage    99.70%   99.70%           
========================================
  Files            5        5           
  Lines          344      344           
========================================
  Hits           343      343           
  Misses           1        1           
Impacted Files Coverage Δ
mailmerge/template_message.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a695a7...64681ce. Read the comment docs.

Copy link
Owner

@awdeorio awdeorio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@awdeorio awdeorio merged commit 76b5d55 into awdeorio:develop May 27, 2022
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.

Inline images not working in thunderbird?
3 participants