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

Inline images break in resent emails #1846

Open
voffch opened this issue Nov 18, 2024 · 0 comments
Open

Inline images break in resent emails #1846

voffch opened this issue Nov 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@voffch
Copy link

voffch commented Nov 18, 2024

Describe the bug
Inline images are displayed inline (as they should) in newly created emails. However, when I forward an email with an embedded image, or reply to such email, or even edit such an email (Edit as new) and then send it, the image remains in the attachments but is no longer displayed as embedded.

Screenshots
изображение

To the left: an embedded public domain happy pig in the original message.
To the right: an invisible pig, no longer happy because its source is broken:

<img title=" (image.jpeg)" loading="lazy" data-x-src-broken="/demo/?/Raw/&amp;q%5B%5D=/0/View/&amp;q%5B%5D=/eyJmb2xkZXIiOiJJTkJPWCIsInVpZCI6IjM0IiwibWltZUluZGV4IjoiMiIsIm1pbWVUeXBlIjoiaW1hZ2UvanBlZyIsImZpbGVOYW1lIjoiaW1hZ2UuanBlZyIsImFjY291bnRIYXNoIjoiZDAxOTU4MWRmZmZjNTQ1OTM5ZGFiMjBjYjA0YTY5MzhmOGQ0ZmQ2OSJ9">

To Reproduce
In fact, the issue remains even when you try to forward or reply to someone's email, but here we'll create a new email from scratch.

  1. Create a new HTML mail in snappymail.
  2. Add an embedded image to the mail body (either with the Image select button or via the clipboard). I've tried png and jpg images.
  3. Send an image to someone (yourself or an external address, doesn't matter).
  4. Go to the Sent folder and select the email that you've just sent.
  5. Now either forward the email or edit it as new and send it again.
  6. Go to the inbox of the address to which you've sent two emails - the new one and the forwarded one.

In the new email, the inline image is correctly displayed, because if you check out the source it is correctly linked via CID with something like

<img src=3D"cid:c3acf26e03319100c7658fff563862bd@9056ee1a745e67860ca4c57011b530d0">

in the body of the message and Content-ID: <c3acf26e03319100c7658fff563862bd@9056ee1a745e67860ca4c57011b530d0> as the content ID of the image.

In the forwarded email, however, the image is no longer displayed. While it is still attached and the Content-ID value stays the same as in the original new email, the image tag in the forwarded email body becomes something like

<img src=3D"/demo/?/Raw/&amp;q%5B%5D=3D/0/View/&amp;q%5B%5D=3D/eyJmb2xkZXIiOiJJTkJPWCIsInVpZCI6IjI4IiwibWltZUluZGV4IjoiMiIsIm1pbWVUeXBlIjoiaW1hZ2UvcG5nIiwiZmlsZU5hbWUiOiJpbWFnZS5wbmciLCJhY2NvdW50SGFzaCI6ImQwMTk1ODFkZmZmYzU0NTkzOWRhYjIwY2IwNGE2OTM4ZjhkNGZkNjkifQ" title=3D" (image.png)">

which is the link that does not work for the recipient. Actually, you can see this code if, in the process of reproducing this issue, you click HTML <-> SOURCE button in Step 5 before sending the emai that you're forwarding.

In addition, I observed the same behavior when replying to the emails with embedded images - in the quoted (past) emails the images also seem to be incorrectly linked.

Expected behavior
Embedded images should stay embedded when you forward, reply to or resend an existing email.

  • Browser: Firefox 115 (desktop), Firefox 132 (mobile)
  • IMAP daemon: dovecot
  • PHP version: 8.2
  • SnappyMail Version: 2.38.2 (latest)
  • Mode: standalone

Additional context
The issue can be easily reproduced using the official demo mail.

@the-djmaze the-djmaze added the bug Something isn't working label Nov 18, 2024
the-djmaze pushed a commit that referenced this issue Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants